symbols for bfd_simple_get_relocated_section_contents
If symbols are provided by the caller of this function they are
passed on to bfd_get_relocated_section_contents. No surprises there.
It gets a little weird if they are not provided. In that case they
are read from the bfd by _bfd_generic_link_add_symbols, and global
symbols are added to the generic linker hash table. Global symbols
are not added to the linker hash table if symbols *are* provided. Now
the linker hash table symbols are not used by the generic
bfd_get_relocated_section_conents, and also not by most target
versions when called from bfd_simple_get_relocated_section_contents
except for symbols like "_gp". So it mostly doesn't matter whether
symbols are in the linker hash table, but it's odd that there is a
difference. We could always add them, but I'm inclined to think that
is unnecessary work so this patch always leaves them out.
Also, symbols are canonicalized and written into a malloc'd buffer.
The buffer isn't freed, see commit
8e16317ca5eb. I don't know whether
that matters any more, but in any case I can't see why we need another
copy of the symbols when _bfd_generic_link_read_symbols has already
cached symbols.
* simple.c (bfd_simple_get_relocated_section_contents): If not
provided, read symbols via bfd_generic_link_read_symbols. Do
not create another copy of symbols. Tidy failure exits.
Minor tidy of bfd_get_relocated_section_contents and
bfd_get_full_section_contents arguments.