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

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Mon Aug 18 14:16:32 GMT 2025


Hi Jan,

> 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.

the idea here is that this would happen both for an amd64-pc-solaris2.11
gcc and an i386-pc-solaris2.11 one with -m64 (and gcc on Solaris is
built with multilib support by default): the target triple only reflects
the default ABI IIUC.  I vaguely remember that there where issues with
testing binutils with both -m32 and -m64, so I don't usually test that
case but have both 32-bit-default and 64-bit-default gcc's in parallel.

If the above is true, the same would apply to the Linux/x86 case, too.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Binutils mailing list