All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Delva <adelva@google.com>
To: u-boot@lists.denx.de
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: [PATCH] efi_loader: Fix link of EFI apps with ld.lld
Date: Wed, 20 Oct 2021 21:31:31 +0000	[thread overview]
Message-ID: <20211020213134.7534-3-adelva@google.com> (raw)
In-Reply-To: <20211020213134.7534-1-adelva@google.com>

When compiling U-Boot with ld.lld as the linker, the helloworld EFI app
example fails to link:

LD      lib/efi_loader/helloworld_efi.so
ld.lld: error: section: .dynamic is not contiguous with other relro
                        sections

LLD will always create RELRO program header regardless of target
emulation, whereas BFD may automatically disable it for unsupported
targets. Add -znorelro to disable it explicitly in all cases.

Signed-off-by: Alistair Delva <adelva@google.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Nick Desaulniers <ndesaulniers@google.com>
---
 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 07696e86bb..39f03398ed 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -403,7 +403,7 @@ $(obj)/%.efi: $(obj)/%_efi.so
 
 quiet_cmd_efi_ld = LD      $@
 cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \
-		-Bsymbolic -s $^ -o $@
+		-Bsymbolic -znorelro -s $^ -o $@
 
 EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS)
 
-- 
2.30.2


  parent reply	other threads:[~2021-10-20 21:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 21:31 [PATCH] x86: chromebook_coral: fix C block comment Alistair Delva
2021-10-20 21:31 ` [PATCH] x86: Fix i8254 ifdef include guard Alistair Delva
2021-10-21 20:18   ` Simon Glass
2021-10-27  3:08   ` Bin Meng
2021-10-27  3:28     ` Bin Meng
2021-10-20 21:31 ` Alistair Delva [this message]
2021-10-20 22:05   ` [PATCH] efi_loader: Fix link of EFI apps with ld.lld Heinrich Schuchardt
2021-10-20 21:31 ` [PATCH] arm64: relocate-rela: Add support for ld.lld Alistair Delva
2021-10-25 13:30   ` Tom Rini
2021-10-25 17:46     ` Alistair Delva
2021-10-25 18:17       ` Tom Rini
2021-11-16 19:25   ` Tom Rini
2021-10-20 21:31 ` [PATCH] x86: Fix linking u-boot with ld.lld Alistair Delva
2021-10-21 20:18   ` Simon Glass
2021-10-31 12:57   ` Simon Glass
2021-10-20 21:31 ` [PATCH] RFC: arm: pci: Add PCI cam support to PCI-E ecam driver Alistair Delva
2021-11-18 19:15   ` Tom Rini
2021-10-21 20:18 ` [PATCH] x86: chromebook_coral: fix C block comment Simon Glass
2021-10-27  3:07 ` Bin Meng
2021-10-27  3:27   ` Bin Meng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211020213134.7534-3-adelva@google.com \
    --to=adelva@google.com \
    --cc=ndesaulniers@google.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.