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: Gold complains about relocations from note sections to discarded sections


On Fri, Jul 13, 2018 at 03:15:46PM -0700, Cary Coutant wrote:
> I wonder if we shouldn't handle these relocations the same as for
> debug info -- with CB_PRETEND, which tries to map the reference to the
> corresponding kept section (in the case of a COMDAT group). For gc'ed
> sections, it would be equivalent to CB_IGNORE.
> 
> We've got a few options: (1) look for specific section names (ick, but
> that's what we're doing currently), (2) look for SHT_NOTE sections, or
> (3) look for !SHF_ALLOC sections. The third choice would take care of
> both debug and note sections with a single condition.
> 
> There are also SHT_NOTE + SHF_ALLOC sections. I'm not sure if any of
> them would be expected to have such relocations in them, and if so,
> what we should do about them.
> 
> What does ld.bfd do?

I'd say ld.bfd --gc-sections is broken.  The .gnu.build.attributes
relocs cause the otherwise unused section to be kept.

-- 
Alan Modra
Australia Development Lab, IBM


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