diff options
author | Alan Modra <amodra@gmail.com> | 2022-08-20 17:36:41 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-08-21 07:54:27 +0930 |
commit | 77491337229beca6f071282ac4283c46262854ec (patch) | |
tree | 44b033bad4208872657b2dfaad1e697387ea4c51 /bfd/cpu-z80.c | |
parent | 0ade20c5688d328ea91d4822384af46d7f899cb1 (diff) | |
download | gdb-77491337229beca6f071282ac4283c46262854ec.zip gdb-77491337229beca6f071282ac4283c46262854ec.tar.gz gdb-77491337229beca6f071282ac4283c46262854ec.tar.bz2 |
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.
Diffstat (limited to 'bfd/cpu-z80.c')
0 files changed, 0 insertions, 0 deletions