[U-Boot-Users] Can't get strong symbol to override weak one

Ben Warren biggerbadderben at gmail.com
Fri Jun 13 14:40:50 CEST 2008


Hi Haavard,

On Fri, Jun 13, 2008 at 1:44 AM, Haavard Skinnemoen
<haavard.skinnemoen at atmel.com> wrote:
> "Ben Warren" <biggerbadderben at gmail.com> wrote:
>> I propose to wrap both the 'board/$(BOARDDIR)/lib$(BOARD).a' and
>> 'cpu/$(CPU)/lib$(CPU).a' arguments to ld in
>> --whole-module/--no-whole-module in order to accomplish this goal.  We
>> definitely don't want to do this across the board because image size
>> will increase quite a bit due to unused code.
>
> You can counter that additional size and more by adding --gc-sections to
> the linker command line and -ffunction-sections -fdata-sections to gcc.
> That will probably even get rid of the weak implementation if a strong
> definition is provided.
>
> There's a catch though -- if your linker script isn't prepared for
> this, things will break.
>
> Haavard
>
>From what I've read, this --gc-sections thing is pretty new, and lots
of people are using older tools, so that idea has to be thrown out.
Fun stuff...

regards,
Ben




More information about the U-Boot mailing list