tests/run-strip-strmerge.sh contains tests that strip and unstrip an ET_REL binary. On i386 it is possible for the resulting binary of these tests to fail elflint due to the presence of relocations with type R_386_GOTPC that refer to a non-GOT symbol. This is caught on i386 because of the presence of an ebl_gotpc_reloc_check for this arch. Most other ebl backends do not implement this check. It is possible that similar problems are going undetected on other arches. We should ensure that strip/unstrip always produce binaries that pass elflint. We should also implement ebl_gotpc_reloc_check for other backends.
Fixed in the following commit: commit 2f9b180cc1057fb351332689886b2492b3711aad Author: Aaron Merey <amerey@redhat.com> Date: Sun Jan 21 19:44:34 2024 -0500 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.