Re: [PATCH 0/2] sparc: Fix IFUNC startup and ldd-trace regressions

"Andreas K. Huettel" <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Organization Gentoo Linux
Message-ID <[email protected]>
Am Mittwoch, 15. Juli 2026, 21:10:40 Japanische Normalzeit schrieb Adhemerval Zanella Netto:
> 
> On 15/07/26 09:00, Andreas K. Huettel wrote:
> >> Patch 1 fixes BZ#34396: on a static (non-PIE) binary __libc_setup_tls
> >> issuse _dl_allocate_tls_init which copies the TLS init image with the
> >> IFUNC __mempcpy, which now runs before the static IFUNC (IRELATIVE)
> >> relocations are applied, so the call jumps through an unrelocated PLT
> >> slot and dies with SIGILL.  It redirects the mem* routines reached on
> >> that path to their non-IFUNC ultra1 implementations.
> > [...]
> >> With an working toolchain, running the sparc testsuite with patch 1 applied
> >> exposed two further regressions:
> >>
> >>   FAIL: elf/tst-ifunc-fault-bindnow
> >>   FAIL: elf/tst-ifunc-fault-lazy
> >>
> >> Patch 2 fixes those by proper handling R_SPARC_JMP_IREL.  I also checked
> >> other ABIs for similar issues and powerpc64 (ELFv1) uses a similar second
> >> reloc (R_PPC64_JMP_IREL).  The patch fixes it as well.
> > 
> > Tested on sparc64 (catbus) and improves the situation a lot - down to 12 failures
> > from >200. Feel free to add 
> > 
> > Tested-by: Andreas K. Hüttel <[email protected]>
> 
> Thanks, I think I will install them by the end of the week.
> 
> > 
> > In detail, the remaining failures are:
> > 
> > FAIL: elf/tst-pldd (*)
> > FAIL: elf/tst-thp-1
> > FAIL: elf/tst-thp-1-no-s-code
> > FAIL: elf/tst-thp-1-no-s-code-pde
> > FAIL: elf/tst-thp-1-no-s-code-static
> > FAIL: elf/tst-thp-1-pde
> > FAIL: elf/tst-thp-1-static
> 
> This is because PMD for THP on sparc is 8MB instead of default 2MB, this
> should fix it:
> 
> diff --git a/sysdeps/unix/sysv/linux/sparc/Makefile b/sysdeps/unix/sysv/linux/sparc/Makefile
> index e0056c9413f..57e73d0a14d 100644
> --- a/sysdeps/unix/sysv/linux/sparc/Makefile
> +++ b/sysdeps/unix/sysv/linux/sparc/Makefile
> @@ -14,3 +14,8 @@ endif
>  ifeq ($(subdir),signal)
>  sysdep_routines += sigreturn_stub
>  endif
> +
> +ifeq ($(subdir),elf)
> +# The sparc64 uses an 8KB base page and 8MB PMD transparent huge page
> +THP-PAGE-SIZE = 0x800000
> +endif
> 

That works indeed:

FAIL: elf/tst-pldd
FAIL: math/test-float64x-float128-mul
FAIL: socket/tst-socket-timestamp
FAIL: stdlib/tst-setcontext2
                === Summary of results ===
      4 FAIL
   6735 PASS
     70 UNSUPPORTED
     17 XFAIL
      2 XPASS

(and none of these 4 are regressions compared to 2.41). Thank you! \o/


-- 
PD Dr. Andreas K. Hüttel
[email protected]
Gentoo Linux developer 
(council, comrel, toolchain, base-system, perl, libreoffice)
https://wiki.gentoo.org/wiki/User:Dilfridge
signature.asc (application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE-----

iQJPBAABCAA5FiEE/Rnm0xsZLuTcY+rT3CsWIV7VQSoFAmpXhlAbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwyAAoJENwrFiFe1UEq6LYQAIuWRExo1rTU5eQipkc5
Cgdlo5hwth3PU/VLgoc/8fA3W2JLkcTBEm5tqTLLJDf+iErPQNUdee6o2H74H7Qh
4wjsGOJmjvSGMCUGEYDTkkAxCxmtgTEhx5xEjWqB0bFKXhjRzvAQjNBbJ8AZlfrq
zzCylC8XbK/rT4IX28WJe4EIh0guCBBT2j9p2ftQpbDuGCd9QpLsBpzdN9PwHI6Q
TpLKHUXSyuKPLVLZtNAvlv8Zpfl9zZJS8TH2arfLr2MrQFXWfD6vWz1ccA/y5k76
TrryiEPwwA5me8oac6Mdbi/YtPnm5Eg8eSN6kpMsOo4/cmX1HlnUnQJ4uFbyEhlp
3h03HOMeVQSirXts4tshVBKdwij4B/W9f8u08q4GJVNqrUyM19khD7LceQkaq+sT
LT+7mHg8GFDaFpxX5g6wVhQ5zR+cri7CEsecPkQl6QOODF1K9jX8o2iG1ZPZF35G
/cncOsUQ5a0RYJtOljbCD8+B+DBLSfjTwtyyRrSTR7yWYT0wmSZyg1ZF+/qxsqgj
ljQ/UPZynL+/GtvYHlxyV7um/HDzOCiEEz6m02TBdQ4alBOQe+5GFuzQFuuE0acZ
88nf9b7ygkBuuq24PbqZXoUiQLI/vo76plNZW2/LCB+O2yqYItx8xP1VQswUUYt2
BRdLTvfzEvHljJbO/yXM1Od7
=ucTY
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.