This is the mail archive of the
mailing list for the binutils project.
Re: gold assert after "relocation refers to discarded section" warnings
>> Actually, though, why is there no GOT offset assigned? ?The code which
>> sets the GOT offset is independent of the code which notices that the
>> symbol is defined in a discarded section. ?It seems like we should still
>> see the GOT reloc against the symbol.
> You're right, there should be one. I need to dig deeper...
It turns out that the relocation causing the internal error was not
the one causing the "discarded section" warning. The relocation
causing the assert was a reference to the .symtab_shndx section, which
is clearly wrong.
It's looking like I'm dealing with an object file with bad section
indices in it. It was generated by LLVM, and has more than 65280
sections, so I'm now trying to figure out which sections all those
relocations really should be pointing to. (It could be that LLVM is
using the incorrect notion that section numbering should leave a gap
between 0xff00 and 0x10000.)
Still, we should be printing a sensible error rather than an assert
failure. I'll follow up with more info.