[PATCH] ld: testsuite: xfail vers26b3 on Solaris/amd64

Jan Beulich jbeulich@suse.com
Mon Aug 18 10:50:04 GMT 2025


On 15.08.2025 10:28, Rainer Orth wrote:
> 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 wrong: vers26b3.o *was* compiled with -fPIC and repeating
> the link with /bin/ld just works.

The error, aiui, is issued on the assumption that a compiler wouldn't emit
this kind of relocation when building PIC code. I came across that before
and found it questionable; I expect H.J. would be able to shed further
light on this.

> Also, the test is already xfail'ed for Linux/x86_64, so this patch does
> the same on Solaris/amd64.

Albeit the reason for the xfail on Linux is different, as per the comment
there.

> Tested on {amd64,i386}-pc-solaris2.11 and {x86_64,i686}-pc-linux-gnu.
> 
> Ok for trunk?

Why is it that you add a two part conditional:

} elseif { [istarget *86*-*-solaris2*] && [is_elf64 $tmpdir/vers26b2.o] } then {

Wouldn't

} elseif { [istarget x86_64-*-solaris2*] } then {

do? At which point this could perhaps be combined with the existing
conditional.

Jan


More information about the Binutils mailing list