]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests/run-ar.sh: disable PIC/PIE/PLT for ar-extract-ar binaries
authorAaron Merey <amerey@redhat.com>
Fri, 24 Oct 2025 22:41:30 +0000 (18:41 -0400)
committerAaron Merey <amerey@redhat.com>
Fri, 24 Oct 2025 23:06:30 +0000 (19:06 -0400)
Architecutres such as Debian i386 may enable PIE by default, resulting
in test binaries that include extra symbols such as
'__x86.get_pc_thunk.ax'.

These extra symbols are added to test archive symbol indices.  This
changes ar-extract-ar output which causes test failures.

Include '-fno-pic -fno-pie -fno-plt' when compiling test binaries to
ensure that no extra symbols are added and no symbols are reordered.

Signed-off-by: Aaron Merey <amerey@redhat.com>
tests/run-ar.sh

index 733d810d188cd15d80b0c05c5b7ee9ca6f3f9683..3389035f3e8501846aa571af0f7658456361f986 100755 (executable)
@@ -66,7 +66,7 @@ EOF
 # Compile the source files.
 for src in *.c; do
   obj=$(echo "$src" | sed 's/\.c$/.o/')
-  gcc -O0 -c "$src" -o "$obj"
+  gcc -O0 -fno-pic -fno-pie -fno-plt -c "$src" -o "$obj"
 done
 
 echo Create nested archives.