Summary: | [toolchain] Adopt SHT_RELR/DT_RELR relative relocation format | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | emacsray |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | bertrand, dilfridge, fads93, gentoo, ionen, lssndrbarbieri, orbea, pacho, pageexec, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugzilla.redhat.com/show_bug.cgi?id=2218018 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 876891, 888055, 911591, 913130, 916405 | ||
Bug Blocks: | 750917 |
Description
emacsray
2021-10-15 21:56:52 UTC
What can be done on Gentoo side? Personally it would be nice to have it supported by ld.bfd in the future to be usable on Android 12 (https://github.com/termux/termux-packages/issues/7382). (In reply to Tee KOBAYASHI from comment #1) > What can be done on Gentoo side? > > Personally it would be nice to have it supported by ld.bfd in the future to > be usable on Android 12 > (https://github.com/termux/termux-packages/issues/7382). Android and Chrome OS have been using ld.lld --pack-dyn-relocs=relr for quite some time. The feature I want to push forward is glibc's DT_RELR support. Distributions' support will be great... I'll also add a note that RELR is more efficient than Firefox's ELF hack and may render it unneeded (https://glandium.org/blog/?p=1177) Status update: - Binutils 2.38 supports it - glibc 2.36 (not yet released) will support it. It's _possibly_ a candidate for 22.0 profiles as default. (In reply to Sam James from comment #3) > Status update: > - Binutils 2.38 supports it > - glibc 2.36 (not yet released) will support it. > > It's _possibly_ a candidate for 22.0 profiles as default. This needs discussion since the feature is quite new. Then again, people will have some time to switch to the new profiles. I guess for ld.bfd this would be -z pack-relative-relocs However, from the manpage: pack-relative-relocs nopack-relative-relocs Generate compact relative relocation in position-independent executable and shared library. It adds "DT_RELR", "DT_RELRSZ" and "DT_RELRENT" entries to the dynamic section. It is ignored when building position-dependent executable and relocatable output. nopack-relative-relocs is the default, which disables compact relative relocation. When linked against the GNU C Library, a GLIBC_ABI_DT_RELR symbol version dependency on the shared C Library is added to the output. Supported for i386 and x86-64. This is in the 23.0 profiles in preparation but we need to drop it for non amd64 as it doesn't exist there yet. (IIRC one other arch supports it but I haven't tested it much on non-amd64) (In reply to Sam James from comment #6) > This is in the 23.0 profiles in preparation but we need to drop it for non > amd64 as it doesn't exist there yet. > > (IIRC one other arch supports it but I haven't tested it much on non-amd64) Depending on how long the 23.0 stuff takes us some other arches might catch up. :o) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57250bdaec26224add7447e8d439d75960645737 commit 57250bdaec26224add7447e8d439d75960645737 Author: Andreas K. Hüttel <dilfridge@gentoo.org> AuthorDate: 2023-11-25 23:12:22 +0000 Commit: Andreas K. Hüttel <dilfridge@gentoo.org> CommitDate: 2023-11-25 23:13:25 +0000 profiles, 23.0: drop global DT_RELR and enable it only on x86 and Power Bug: https://bugs.gentoo.org/show_bug.cgi?id=818376 Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org> profiles/default/linux/amd64/23.0/make.defaults | 4 ++++ profiles/default/linux/ppc/23.0/make.defaults | 4 ++++ profiles/default/linux/ppc64/23.0/make.defaults | 4 ++++ profiles/default/linux/x86/23.0/make.defaults | 4 ++++ profiles/releases/23.0/make.defaults | 4 ++-- 5 files changed, 18 insertions(+), 2 deletions(-) The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fac51cc9370713f6b2764e8e03ee2ff8d652c3af commit fac51cc9370713f6b2764e8e03ee2ff8d652c3af Author: Sam James <sam@gentoo.org> AuthorDate: 2024-03-25 18:46:04 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-03-25 18:48:58 +0000 profiles/default/linux/ppc/23.0: drop DT_RELR bfd doesn't support DT_RELR on ppc32. Bug: https://bugs.gentoo.org/818376 Signed-off-by: Sam James <sam@gentoo.org> profiles/default/linux/ppc/23.0/make.defaults | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) This is fixed in the 23.0 profiles (available and stable now). Closing. (Well, at least for amd64 where the relocation exists. More arches will follow.) |