[PATCH] ld: testsuite: Fix no-plt tests on Solaris/i386
Jan Beulich
jbeulich@suse.com
Mon Aug 18 10:37:04 GMT 2025
On 28.07.2025 15:49, Rainer Orth wrote:
> Several no-plt tests FAIL on 32-bit Solaris/x86:
>
> FAIL: Build libno-plt-1b.so
> FAIL: No PLT (dynamic 1a)
> FAIL: No PLT (dynamic 1b)
> FAIL: No PLT (dynamic 1c)
> FAIL: No PLT (PIE 1e)
> FAIL: No PLT (PIE 1f)
> FAIL: No PLT (PIE 1g)
>
> The failure mode is always similar, e.g.
>
> ../binutils/objdump -dwrj.text tmpdir/libno-plt-1b.so > dump.out
> regexp_diff match failure
> regexp "^ +[a-f0-9]+: 8b 80 ([0-9a-f]{2} ){4}[ ]+mov +-0x[a-f0-9]+\(%eax\),%eax$"
> line " 4aa: 8b 80 14 00 00 00 mov 0x14(%eax),%eax"
> regexp_diff match failure
> regexp "^ +[a-f0-9]+: ff a0 ([0-9a-f]{2} ){4}[ ]+jmp +\*-0x[0-9a-f]+\(%eax\)$"
> line " 4ca: ff a0 14 00 00 00 jmp *0x14(%eax)"
>
> i.e. there's a positive offset from the GOT instead of the expected
> negative one. AFAICS that's because there are additional GOT entries on
> the Solaris side (printed with elfdump -G since there seems to be no
> support for that in either readelf or objdump):
>
> * Solaris/i386:
>
> Global Offset Table Section: .got
> index addr value pending relocation
> [0] 0x15f4 0x1514
> [1] 0x15f8 0
> [2] 0x15fc 0
> [3] 0x1600 0x3a6 R_386_JMP_SLOT __cxa_finalize
> [4] 0x1604 0 R_386_GLOB_DAT _ITM_deregisterTMCloneTable
> [5] 0x1608 0 R_386_GLOB_DAT func
>
> * Linux/i686:
>
> Global Offset Table Section: .got
> index addr value pending relocation
> [0] 0x3fe0 0 R_386_GLOB_DAT _ITM_deregisterTMCloneTable
> [1] 0x3fe4 0 R_386_GLOB_DAT __cxa_finalize
> [2] 0x3fe8 0 R_386_GLOB_DAT __gmon_start__
> [3] 0x3fec 0 R_386_GLOB_DAT func
>
> This patch fixes this by making the sign optional in affected cases.
>
> Tested on i386-pc-solaris2.11 and i686-pc-linux-gnu.
H.J., these are all tests you once introduced - would you mind taking a look?
Rainer: It generally helps if you Cc applicable maintainers.
Jan
More information about the Binutils
mailing list