summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2023-07-26 12:29:57 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-07-26 19:47:53 +0200
commiteff91e2f3863f9e176b383e5c54741c64ca7a636 (patch)
treefa40d2718d03d55dda59556b094bb41b96b93230
parentmkosi: add drop-in to make emergency.service shut down the system (diff)
downloadsystemd-eff91e2f3863f9e176b383e5c54741c64ca7a636.tar.xz
systemd-eff91e2f3863f9e176b383e5c54741c64ca7a636.zip
efi: link with -z nopack-relative-relocs
elf2efi.py cannot handle DT_RELR relocations, so disable it if we can Fixes https://github.com/systemd/systemd/issues/28520
-rw-r--r--src/boot/efi/meson.build4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
index bbffdf76c9..1c52629651 100644
--- a/src/boot/efi/meson.build
+++ b/src/boot/efi/meson.build
@@ -174,6 +174,10 @@ efi_c_ld_args = [
'-T' + elf2efi_lds,
]
+# On CentOS 8 the nopack-relative-relocs linker flag is not supported, and we get:
+# /usr/bin/ld.bfd: warning: -z nopack-relative-relocs ignored
+efi_c_ld_args += cc.get_supported_link_arguments('-Wl,-z,nopack-relative-relocs')
+
# efi_c_args is explicitly passed to targets so that they can override distro-provided flags
# that should not be used for EFI binaries.
efi_disabled_c_args = cc.get_supported_arguments(