PR24857, ld: error adding symbols: bad value
This fixes two cases where elf_link_add_object_symbols returns an
error, setting the catch-all bfd_error_bad_value without explaining
the error. The second one is an internal error that can only be
caused by a target elf_add_symbol_hook, so make that one abort. The
first one is my PR24339 fix. PR24339 is another of those fuzzing bugs
and the fix I made catches the problem when loading symbols, rather
than when symbols are used in relocs. While ld is correct to reject
the object file as not complying with the ELF standard, let's be a
little more forgiving for dynamic objects.
PR 24857
PR 24339
* elflink.c (elf_link_add_object_symbols): Report an informative
error on finding local symbols with index equal or greater than
symbol table sh_info. Correct comment. Allow such symbols in
dynamic objects. Abort on NULL section for symbol.