[binutils-gdb] ld: testsuite: Mark vers26b3 unsupported on x86_64

Rainer Orth ro@sourceware.org
Tue Aug 19 13:39:40 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=1bf1357c6827961386ef13462aed9d41221d5911

commit 1bf1357c6827961386ef13462aed9d41221d5911
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date:   Tue Aug 19 15:38:55 2025 +0200

    ld: testsuite: Mark vers26b3 unsupported on x86_64
    
    After enabling the ld-elfvers tests on Solaris/x86, one of them FAILs on
    Solaris/amd64 only:
    
    FAIL: vers26b3
    
    /ld-new: tmpdir/vers26b3.o: relocation R_X86_64_32 against symbol `foo' can not be used when making a shared object; recompile with -fPIC
    ./ld-new: failed to set dynamic section sizes: bad value
    
    The error is strange: vers26b3.o *was* compiled with -fPIC and repeating
    the link with /bin/ld just works.  However, the resulting vers26b3.so
    fails to load:
    
    $ ldd -r tmpdir/vers26b3.so
    [...]
    ld.so.1: vers26b3.so.ld: fatal: relocation error: R_AMD64_32: file tmpdir/vers26b3.so.ld: symbol foo: value 0x7fff34d00830 does not fit
    
    When running the test on Linux/x86_64, it fails with the same ld message
    as above, so the test is marked unsupported for both Linux/x86_64 and
    Solaris/amd64.
    
    Tested on {amd64,i386}-pc-solaris2.11 and {x86_64,i686}-pc-linux-gnu.
    
    2025-07-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
    
            ld:
            * testsuite/ld-elfvers/vers.exp (vers26b3): Mark unsupported on
            Linux/x86_64 and Solaris/amd64.

Diff:
---
 ld/ChangeLog                     | 5 +++++
 ld/testsuite/ld-elfvers/vers.exp | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index e3020df1b5f..8da3788b5bb 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,8 @@
+2025-08-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+	* testsuite/ld-elfvers/vers.exp (vers26b3): Mark unsupported on
+	Linux/x86_64 and Solaris/amd64.
+
 2025-08-19  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	* emultempl/solaris2.em (elf_solaris2_before_allocation): Mark
diff --git a/ld/testsuite/ld-elfvers/vers.exp b/ld/testsuite/ld-elfvers/vers.exp
index 0c553beb738..4f59e0c174b 100644
--- a/ld/testsuite/ld-elfvers/vers.exp
+++ b/ld/testsuite/ld-elfvers/vers.exp
@@ -961,7 +961,10 @@ if [string match "yes" $pic] then {
 build_vers_lib_pic "vers26a" vers26a.c vers26a "" vers26a.map vers26a.ver vers26a.dsym ""
 build_vers_lib_pic "vers26b1" vers26b.c vers26b1 "" "" vers26b.ver vers26b.dsym ""
 build_vers_lib_pic "vers26b2" vers26b.c vers26b2 "vers26a.so vers26b1.so vers26a.o" "" vers26b.ver vers26b.dsym ""
-if [string match "yes" $pic] then {
+if { [istarget x86_64-*-linux*] || [istarget x86_64-*-solaris2*] } then {
+    # gcc -fPIC generates code that ld rejects.
+    unsupported "vers26b3"
+} elseif [string match "yes" $pic] then {
     xfail "vers26b3"
 } else {
     build_vers_lib_no_pic "vers26b3" vers26b.c vers26b3 "vers26a.so vers26b1.so vers26a.o" "" vers26b.ver vers26b.dsym ""


More information about the Binutils-cvs mailing list