This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Gold complains about relocations from note sections to discarded sections
- From: Nick Clifton <nickc at redhat dot com>
- To: Alan Modra <amodra at gmail dot com>, Cary Coutant <ccoutant at gmail dot com>
- Cc: Ian Lance Taylor <iant at google dot com>, Binutils <binutils at sourceware dot org>
- Date: Wed, 18 Jul 2018 11:08:25 +0100
- Subject: Re: Gold complains about relocations from note sections to discarded sections
- References: <87601j8op5.fsf@redhat.com> <CAJimCsFJ3ObLQiPqbNMYkO9pskA694m4=OtNoX-zAzytz2gXUw@mail.gmail.com> <20180718035501.GB3373@bubble.grove.modra.org>
Hi Alan, Hi Cary,
>> What does ld.bfd do?
As Alan mentioned it stops the section from being discarded. :-(
> I'd say ld.bfd --gc-sections is broken. The .gnu.build.attributes
> relocs cause the otherwise unused section to be kept.
Just FYI - I have now updated the annobin plugin that generates these
notes so that it now puts them into a subsection of .gnu.build.attributes.
It also creates a section group containing the code section and the
attribute section, so that if the linker decides to discard the code, it
will also discard the attributes. And it works! :-)
So whilst we should still fix the linkers to behave consistently and
correctly, it is not something that is a major priority for me any more.
Cheers
Nick