From: Aaron Merey Date: Fri, 24 Oct 2025 22:41:30 +0000 (-0400) Subject: tests/run-ar.sh: disable PIC/PIE/PLT for ar-extract-ar binaries X-Git-Tag: elfutils-0.194~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d6a50878c36418c91618e966193d3fd81db97f4;p=thirdparty%2Felfutils.git tests/run-ar.sh: disable PIC/PIE/PLT for ar-extract-ar binaries 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 --- diff --git a/tests/run-ar.sh b/tests/run-ar.sh index 733d810d..3389035f 100755 --- a/tests/run-ar.sh +++ b/tests/run-ar.sh @@ -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.