diff options
author | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2024-06-03 17:20:32 +0100 |
---|---|---|
committer | Szabolcs Nagy <szabolcs.nagy@arm.com> | 2024-06-07 08:23:23 +0100 |
commit | 961befd69308895bf1dc39737d1598246dc296a8 (patch) | |
tree | 6bf507a122f502d2618c9b4159e0d81516b4e53a /gdb/ui-file.c | |
parent | f9478936896ada7786e8d68622f6e6ff78b97b0d (diff) | |
download | gdb-961befd69308895bf1dc39737d1598246dc296a8.zip gdb-961befd69308895bf1dc39737d1598246dc296a8.tar.gz gdb-961befd69308895bf1dc39737d1598246dc296a8.tar.bz2 |
aarch64: Fix DT_RELR support with discarded sections
In case of discarded sections, via /DISCARD/ or .gnu.linkonce,
relr relocation accounting was wrong. This broke building linux.
The issue was that the *_relocate_section logic was copied to
record_relr_non_got_relocs to find the relative relocs that can
be packed, however *_relocate_section is not called on sections
that are discarded, while record_relr_non_got_relocs is called
for all input sections. The fix is to filter out the discarded
sections with the same logic that is used to count non-GOT
relocs in *_late_size_sections for local symbols earlier.
Use the discarded_section helper in both cases to clarify the
intent and handle all corner-cases consistently.
GOT relocations are affected too if all sections are discarded
that reference the GOT entry of a particular symbol, however
this can cause unused GOT entries independently of DT_RELR, and
the only difference with DT_RELR is that a relative reloc may be
emitted instead of a R_AARCH64_NONE for the unused GOT entry
which is acceptable. A proper fix would require redoing the GOT
refcounting after we know the discarded sections, see bug 31850.
Diffstat (limited to 'gdb/ui-file.c')
0 files changed, 0 insertions, 0 deletions