This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How do I get ld to pull sections from archived objects?


David Fernandez <david.fernandez.work@googlemail.com> writes:

> SECTIONS
> {
> ...
>     my_special_thing ORIGIN(rom) : {
>         KEEP(*(my_special_thing))
>     }
> ...
> }
>
> If all the objects containing "my_special_thing" section are in
> archives, this section never makes it to the final elf file.

The KEEP operator is not about forcing a reference, only about not
dropping it, if --gc-sections is in effect.  It will not change in any
way which inputs are considered for inclusion until the garbage
collector runs.  Thus it has no effect unless --gc-sections is used.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]