libgot-1 testcases

Alan Modra amodra@gmail.com
Fri Jan 23 06:40:42 GMT 2026


On Thu, Jan 22, 2026 at 05:41:23PM +0100, Jens Remus wrote:
> On 1/22/2026 4:14 PM, Rainer Orth wrote:
> 
> >> There is no need for multiple tests of readelf --got-contents,
> >> nor should the matching be so strict that changes in section layout
> >> force editing of the testsuite.
> >>
> >> It also looks to me that the i386 --got-contents output is wrong,
> >> at least it is confusing to have .rel.plt show
> >> 0020020c  00000307 R_386_JUMP_SLOT   00000000   bar
> >> while the corresponding got-contents dump shows "bar + 156".
> >>      3: 0020020c R_386_JUMP_SLOT   bar + 156
> > 
> > thanks.  Btw., ld-s390/libgot_64-1b.rd has the same issue, probably
> > inspired by HJs tests.
> 
> Alan, will you take care to reduce the s390 tests as well, or shall I?
> 
> Rainer, I can't follow where this disconnect is in ld-s390/libgot_64-1b.rd:

I think Rainer was talking about the unnecessary duplication and just
dumping readelf output into a test file with minor editing for regex
escaping.  The i386 issue will only affect REL targets.  The
confusion is that the section contents are shown as a reloc addend,
which is normally what you want to do for REL relocs, but in this case
R_386_JUMP_SLOT ignores the added.

Hmm, there's another oddity, R_386_JMP_SLOT is how the processor ABI
doc describes the reloc, and what glibc defines, but we define
R_386_JUMP_SLOT in include/elf/i386.h.  It's been that way a long time.

Whether you keep the testcases as-is or edit them doesn't matter that
much.  It is better for future maintenance burden that testcases are
trimmed down as much as possible to just the relevant details you want
the test, and that ideally would be done by the person submitting the
testcase.  Doing so also improves your chances of picking up on things
like the R_386_JUMP_SLOT addend confusion.

I'm not going to change the s390 libgot test myself.  I made the x86
changes because Rainer was hitting a whole lot of superfluous test
differences when trying to run the testcases using solaris emulations.

> .rela.plt test is:
> 0+2003b0  000000040000000b R_390_JMP_SLOT         0000000000000000 bar \+ 0
> 
> and the .got dump rest is:
>   +[0-9]+: 00000000002003b0 R_390_JMP_SLOT         bar \+ 0

-- 
Alan Modra


More information about the Binutils mailing list