[PATCH] ld: testsuite: Relax libgot-1-i386 test for Solaris [PR33350]

Alan Modra amodra@gmail.com
Fri Jan 23 23:48:55 GMT 2026


On Fri, Jan 23, 2026 at 04:25:16PM +0100, Rainer Orth wrote:
> When running the ld testsuite with -melf_i386_sol2 instead of -melf_i386
> on Solaris, one test regresses:
> 
> FAIL: Build libgot-1-i386.so
> 
> The issue is that one line in the --got-contents output differs
> unexpectedly:
> 
>  Global Offset Table '.got.plt' contains 4 entries:
>     Index:  Address      Reloc             Sym. Name + Addend/Value
> -       0: 00200200                        20016c
> -       1: 00200204                        0
> -       2: 00200208                        0
> -       3: 0020020c R_386_JUMP_SLOT        bar + 156
> +       0: 00200270                        2001dc
> +       1: 00200274                        0
> +       2: 00200278                        0
> +       3: 0020027c R_386_JUMP_SLOT        bar + 1c6
> 
> While ld-i386/libgot-1.rd already allows for differences in the
> addresses, the addend is assumed to be fixed.  However, this is not the
> case with -melf_i386_sol2.  The difference is that .hash, .dynsym, and
> .symtab have additional entries as required by the Solaris ABI:
> 
> * In .dynsym and .symtab, _DYNAMIC, _GLOBAL_OFFSET_TABLE_, and
>   _PROCEDURE_LINKAGE_TABLE_ are added.
> 
> * .symtab also gains _END_ and _START_.
> 
> This explains the differences in addresses and addends, but they are
> completely benign.
> 
> This patch thus allows for arbitrary addends.
> 
> Tested on {i386,amd64}-pc-solaris2.11 with both -melf_i386_sol2 and
> -melf_i386, and {i686,x86_64}-pc-linux-gnu.
> 
> Ok for trunk?

OK.

> This is the last of the failures originally reported in PR ld/33350.
> 
> 	Rainer
> 
> -- 
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
> 
> 
> 2026-01-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
> 
> 	ld:
> 	PR ld/33350
> 	* testsuite/ld-i386/libgot-1.rd: Allow for different
> 	R_386_JUMP_SLOT addends.
> 

> # HG changeset patch
> # Parent  737bf89fc05f0869c8b32b025ad53bce78a5fc26
> ld: testsuite: Relax libgot-1-i386 test for Solaris
> 
> diff --git a/ld/testsuite/ld-i386/libgot-1.rd b/ld/testsuite/ld-i386/libgot-1.rd
> --- a/ld/testsuite/ld-i386/libgot-1.rd
> +++ b/ld/testsuite/ld-i386/libgot-1.rd
> @@ -15,4 +15,4 @@ Global Offset Table '\.got\.plt' contain
>  .* +[^0][0-9a-f]+
>  .* +0
>  .* +0
> -.* R_386_JUMP_SLOT +bar \+ 156
> +.* R_386_JUMP_SLOT +bar \+ [0-9a-f]+


-- 
Alan Modra


More information about the Binutils mailing list