summaryrefslogtreecommitdiffstats
path: root/tests/Makefile.am
diff options
context:
space:
mode:
authorAaron Merey <[email protected]>2024-01-21 19:44:34 -0500
committerAaron Merey <[email protected]>2024-02-06 15:08:32 -0500
commit2f9b180cc1057fb351332689886b2492b3711aad (patch)
treee819d41c5210546c2e0d025b7be1bb1e08486396 /tests/Makefile.am
parentde60eba95b2dd36fc11de33b32391ae9533a15ac (diff)
unstrip: Call adjust_relocs no more than once per section.
During symtab merging, adjust_relocs might be called multiple times on some SHT_REL/SHT_RELA sections. In these cases it is possible for a relocation's symbol index to be correctly mapped from X to Y during the first call to adjust_relocs but then wrongly remapped from Y to Z during the second call. Fix this by adjusting relocation symbol indices just once per section. Also add stable sorting for symbols during symtab merging so that the symbol order in the output file's symtab does not depend on undefined behaviour in qsort. Note that adjust_relocs still might be called a second time on a section during add_new_section_symbols. However since add_new_section_symbols generates its own distinct symbol index map, this should not trigger the bug described above. https://sourceware.org/bugzilla/show_bug.cgi?id=31097 Signed-off-by: Aaron Merey <[email protected]>
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r--tests/Makefile.am3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2373c980..13bd9d56 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -62,7 +62,7 @@ check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
dwelf_elf_e_machine_string \
getphdrnum leb128 read_unaligned \
msg_tst system-elf-libelf-test system-elf-gelf-test \
- nvidia_extended_linemap_libdw \
+ nvidia_extended_linemap_libdw elf-print-reloc-syms \
$(asm_TESTS)
asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
@@ -810,6 +810,7 @@ getphdrnum_LDADD = $(libelf) $(libdw)
leb128_LDADD = $(libelf) $(libdw)
read_unaligned_LDADD = $(libelf) $(libdw)
nvidia_extended_linemap_libdw_LDADD = $(libelf) $(libdw)
+elf_print_reloc_syms_LDADD = $(libelf)
# We want to test the libelf headers against the system elf.h header.
# Don't include any -I CPPFLAGS. Except when we install our own elf.h.