[U-Boot] non-needed objects added to resulting U-Boot image

Hello
I was building u-boot for ARM based custom board and I found that unused and no needed object files are built and linked to the resulting U-Boot image. For example, my board doesn't have PCI, PCMCIA, USB or Ethernet, but according to the build-log, corresponding archives have been built and linked:
drivers/net/libnet.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a
and so on.
Don't think it is intended behavior, on the other hand I have not included any support for this modules in my configuration. What can be the reason, has anybody had this before?
Thanks.

Dear "Roman Mashak",
In message 40a670230810140530s7143995ex6eaaf251bf9de4c7@mail.gmail.com you wrote:
I was building u-boot for ARM based custom board and I found that unused and no needed object files are built and linked to the resulting U-Boot image. For example, my board doesn't have PCI, PCMCIA, USB or Ethernet, but according to the build-log, corresponding archives have been built and linked:
drivers/net/libnet.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a
and so on.
These libraries may be used in the link command of your image, but do you actually see any unused objects included in your linked image?
Don't think it is intended behavior, on the other hand I have not included any support for this modules in my configuration. What can be the reason, has anybody had this before?
Um... you know what a library is and how the linker processes it?
Best regards,
Wolfgang Denk

Hello
2008/10/14 Wolfgang Denk wd@denx.de:
drivers/net/libnet.a drivers/net/sk98lin/libsk98lin.a drivers/pci/libpci.a drivers/pcmcia/libpcmcia.a
and so on.
These libraries may be used in the link command of your image, but do you actually see any unused objects included in your linked image?
LIBS in Makefile incorporates all drivers, file systems etc., so 'make' command traverses through out the source tree and builds (in many cases the binaries contain only debug information). Isn't it reasonable to add a few variables, say in $(uboot)/config_user.mk, which will more precisely define what to build. Further, $(uboot)/config.mk includes config_local.mk, and later on Makefile organizes LIBS something like that:
... ifdef BUILD_NET LIBS +=drivers/net/libnet.a endif ...
It may slightly speed up a building process.

Dear "Roman Mashak",
In message 40a670230810141657m1e18f4efjedea1cab54149b2c@mail.gmail.com you wrote:
These libraries may be used in the link command of your image, but do you actually see any unused objects included in your linked image?
LIBS in Makefile incorporates all drivers, file systems etc., so 'make' command traverses through out the source tree and builds (in many cases the binaries contain only debug information). Isn't it reasonable to add a few variables, say in $(uboot)/config_user.mk, which will more precisely define what to build. Further,
Um... you didn't follow what's been going on in the Makefiles in the last months, have you?
It may slightly speed up a building process.
This is already being worked on, just differently (using kconfig style).
Best regards,
Wolfgang Denk
participants (2)
-
Roman Mashak
-
Wolfgang Denk