Fix: ld testsuite: pr22001-1 test segfaults on musl/x86
authorA. Wilcox <awilfox@adelielinux.org>
Thu, 5 Oct 2023 11:38:40 +0000 (12:38 +0100)
committerNick Clifton <nickc@redhat.com>
Thu, 5 Oct 2023 11:38:40 +0000 (12:38 +0100)
  PR 30925
  PR 22001
  * testsuite/ld-i386/i386.exp: Skip the pr22001 test with TEXTREL relocations enabled on configurations using the MUSL library.

ld/ChangeLog
ld/testsuite/ld-i386/i386.exp

index d402b59e8f2db35f307d104f34f6b10bec21d118..8ff8511bc6bc117cbfff168209a27b8f84f791fb 100644 (file)
@@ -1,4 +1,11 @@
-2023-10-05  A. Wilcox  <awilfox@adelielinux.org>
+2023-10-05  A. Wilcox  <awilfox@adelielinux.org>w
+
+       PR 30925
+       PR 22001
+       * testsuite/ld-i386/i386.exp: Skip the pr22001 test with TEXTREL
+       relocations enabled on configurations using the MUSL library.
+
+2023-10-05  A. Wilcox  <awilfox@adelielinux.org>w
 
        PR 30924
        * testsuite/ld-elfvers/vers.exp (objdump_emptyverstuff): Handle
index e8ad973eb36027a30b0a7c4ed3c486b16bd8f252..98175d9d39c4a55863034cc83f5d4ec6c60d8050 100644 (file)
@@ -1319,6 +1319,21 @@ if { [isnative]
        ] \
     ]
 
+    # The musl C library does not support TEXTRELs.
+    if { ![istarget i?86-*-musl] } {
+       run_ld_link_exec_tests [list \
+           [list \
+               "Run pr22001-1" \
+               "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
+               "-Wa,-mx86-used-note=yes" \
+               { pr22001-1b.c } \
+               "pr22001-1" \
+               "pass.out" \
+               "$NOPIE_CFLAGS" \
+           ] \
+       ]
+    }
+
     run_ld_link_exec_tests [list \
        [list \
            "Run weakundef1 without PIE" \
@@ -1329,16 +1344,7 @@ if { [isnative]
            "pass.out" \
            "$NOPIE_CFLAGS" \
        ] \
-       [list \
-           "Run pr22001-1" \
-           "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \
-           "-Wa,-mx86-used-note=yes" \
-           { pr22001-1b.c } \
-           "pr22001-1" \
-           "pass.out" \
-           "$NOPIE_CFLAGS" \
-       ] \
-       [list \
+       [list \
            "Run pr22001-1 (PIE 1)" \
            "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed tmpdir/pr22001-1.so" \
            "-Wa,-mx86-used-note=yes" \