This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/13962: Misleading error message when linking a library with an empty library
> FWIW, gold accepts the DSO without dynamic symbols. ld and
> gold should be consistent. ?Ian, Cary, what do you think?
As far as I can tell, gold doesn't ever look at the sh_info field of
the .dynsym section for a DSO -- it just processes all the symbols,
and an empty symbol table section shouldn't cause any problems,
regardless of the value in sh_info.
For relocatable objects, it looks like gold might indeed have a
problem if it ever sees an empty .symtab section with sh_info == 1. If
we don't need the local symbols, we'll end up with a negative count of
symbols to read, but if we do need local symbols (e.g., if there's an
.eh_frame section), it looks like it'll just read all the symbols and
it'll be OK. I'd guess we've never seen such a file, though.
-cary