]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
efi: link with -z nopack-relative-relocs
authorLuca Boccassi <bluca@debian.org>
Wed, 26 Jul 2023 10:29:57 +0000 (11:29 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 26 Jul 2023 17:47:53 +0000 (18:47 +0100)
elf2efi.py cannot handle DT_RELR relocations, so disable it
if we can

Fixes https://github.com/systemd/systemd/issues/28520

src/boot/efi/meson.build

index bbffdf76c921bf07595516848fadaa43a8866c1a..1c5262965177361149b99de18e78685ee6a0ec3d 100644 (file)
@@ -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(