From ba67c5d97790db949a70ee9152f31b1b4123a79a Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Fri, 2 Feb 2024 02:31:42 +0900 Subject: [PATCH] Fix CI --- elf/mold.h | 3 --- test/elf/shared-abs-sym.sh | 11 ++++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/elf/mold.h b/elf/mold.h index 309eb6e065..5cb0f701c4 100644 --- a/elf/mold.h +++ b/elf/mold.h @@ -2727,9 +2727,6 @@ inline bool Symbol::has_plt(Context &ctx) const { template inline bool Symbol::is_absolute() const { - if (file && file->is_dso) - return esym().is_abs(); - return !is_imported && !get_frag() && !get_input_section() && !get_output_section(); } diff --git a/test/elf/shared-abs-sym.sh b/test/elf/shared-abs-sym.sh index 8f7a1a3727..1742567084 100755 --- a/test/elf/shared-abs-sym.sh +++ b/test/elf/shared-abs-sym.sh @@ -15,8 +15,13 @@ int main() { printf("foo=%p\n", &foo); } EOF $CC -fPIC -c -o $t/d.o $t/c.c -$CC -B. -o $t/exe1 -pie $t/d.o $t/b.so -$QEMU $t/exe1 | grep -q 'foo=0x3' -$CC -B. -o $t/exe2 -no-pie $t/d.o $t/b.so +# This test fails with older glibc +$CC -o $t/exe1 $t/d.o $t/b.so 2> /dev/null || skip +$QEMU $t/exe1 | grep -q 'foo=0x3' || skip + +$CC -B. -o $t/exe2 -pie $t/d.o $t/b.so $QEMU $t/exe2 | grep -q 'foo=0x3' + +$CC -B. -o $t/exe3 -no-pie $t/d.o $t/b.so +$QEMU $t/exe3 | grep -q 'foo=0x3'