From 4daef93aa92347a850cb60b625f5d4993c6267e6 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 3 Jan 2024 17:18:20 +0100 Subject: [PATCH] Missing packed relative relocation support on aarch64, s390x (#2256645) --- buildflags.md | 3 ++- macros | 5 +++-- redhat-rpm-config.spec | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/buildflags.md b/buildflags.md index 811e1cb..4e53c85 100644 --- a/buildflags.md +++ b/buildflags.md @@ -643,7 +643,8 @@ to the compiler driver `gcc`, and not directly to the link editor are essentially ignored due to this flag. * `-z pack-relative-relocs`: Use the portable `DT_RELR` scheme for relative relocations, resulting in reduced startup time compared to - legacy architecture-specific relocations. + legacy architecture-specific relocations. (`-z pack-relative-relocs` + is currently disabled on aarch64 and s390x due to toolchain limitations.) * `-z defs`: Refuse to link shared objects (DSOs) with undefined symbols (optional, see above). diff --git a/macros b/macros index 95b5ceb..2eca9bb 100644 --- a/macros +++ b/macros @@ -372,8 +372,9 @@ for k,_ in pairs(stripped_flags) do print(k .. " ") end %_ld_as_needed 1 %_ld_as_needed_flags %{?_ld_as_needed:-Wl,--as-needed} -%_ld_pack_relocs 1 -%_ld_pack_relocs_flags %{?_ld_pack_relocs:-Wl,-z,pack-relative-relocs} +# aarch64 and s390x currently do not support packed relocations. +%_ld_pack_relocs %[ "%{_arch}" == "x86_64" || "%{_arch}" == "i386" || "%{_arch}" == "ppc64le" ] +%_ld_pack_relocs_flags %[0%{?_ld_pack_relocs} ? "-Wl,-z,pack-relative-relocs" : ""] # LTO is the default in Fedora. # "%define _lto_cflags %{nil}" to opt out diff --git a/redhat-rpm-config.spec b/redhat-rpm-config.spec index 49169d1..aaf3a16 100644 --- a/redhat-rpm-config.spec +++ b/redhat-rpm-config.spec @@ -4,7 +4,7 @@ # 2) When making changes, increment the version (in baserelease) by 1. # rpmdev-bumpspec and other tools update the macro below, which is used # in Version: to get the desired effect. -%global baserelease 273 +%global baserelease 274 Summary: Red Hat specific rpm configuration files Name: redhat-rpm-config @@ -256,6 +256,9 @@ install -p -m 644 -t %{buildroot}%{_rpmluadir}/fedora common.lua %doc buildflags.md %changelog +* Wed Jan 3 2024 Florian Weimer - 275-1 +- Missing packed relative relocation support on aarch64, s390x (#2256645) + * Tue Jan 2 2024 Florian Weimer - 273-1 - Pack relative ELF relocations by default