[PATCH] ld: testsuite: Only xfail "shared (non PIC)" etc. on 64-bit Solaris

Jan Beulich jbeulich@suse.com
Fri Aug 22 07:10:34 GMT 2025


On 20.08.2025 10:42, Rainer Orth wrote:
> Once the ld-shared tests run on both Solaris/SPARC and x86, two tests
> XPASS on 32-bit Solaris, both SPARC and x86 (pre-existing on SPARC,
> newly revealed on x86):
> 
> XPASS: shared (non PIC)
> XPASS: shared (PIC main, non PIC so)
> 
> Consequently, this patch restricts xfailing them to 64-bit Solaris.
> 
> There now remain 1 (32-bit) or 3 (64-bit) XFAILs.  I've checked the
> reasons and found all comments in shared.exp are wrong:
> 
> * The common one (SPARC and x86, 32 and 64-bit) is
> 
> XFAIL: shared (non PIC, load offset)
> 
>   The error is always the same:
> 
> ld.so.1: shnp: fatal: tmpdir/shnp.so: unknown file type
> 
>   Running shnp under truss reveals
> 
> 26170:  openat(AT_FDCWD, "tmpdir/shnp.so", O_RDONLY)    = 3
> 26170:  mmapobj(3, MMOBJ_INTERPRET, 0xFFFFFFFF7F5D0058, 0xFFFFFFFF7FFFE8A0, 0x00000000) Err#48 ENOTSUP
> 
>   which can be traced in the mmapobj(2) implementation to the
>   requirement that a shared object's p_vaddr needs to be 0, which in
>   this test is intentionally not the case.
> 
> * The other two XFAIL's are 64-bit only and for another reason:
> 
> XFAIL: shared (non PIC)
> XFAIL: shared (PIC main, non PIC so)
> 
>   On sparcv9, shnp execution fails:
> 
> ld.so.1: shnp: fatal: relocation error: R_SPARC_H44: file tmpdir/shnp.so: symbol shlibvar2: value 0x3fffffffb9c does not fit
> 
>   On amd64, shmpnp.so fails to link:
> 
> ld/tmpdir/ld/collect-ld: tmpdir/sh1np.o: relocation R_X86_64_32S against symbol `shlib_shlibvar1' can not be used when making a shared object; recompile with -fPIC
> ld/tmpdir/ld/collect-ld: failed to set dynamic section sizes: bad value
> 
>   In both cases, this happens with -z text, too, so the comments are
>   bogus.  Instead, the issue that the code needs to be PIC.
> 
> So I'm updating the comments accordingly.
> 
> Tested on sparc{v9,}-sun-solaris2.11 and {amd64,i386}-pc-solaris2.11.
> 
> Ok for trunk?

Yes. I'm not convinced XFAIL is appropriate to use here (like also mentioned
in an earlier case), but you're only following what is already don for other
targets.

Jan


More information about the Binutils mailing list