From af484011f12e2aa37bcf4f9cbb4258dea4ef14ac Mon Sep 17 00:00:00 2001 From: Alistair Delva Date: Wed, 20 Oct 2021 21:31:31 +0000 Subject: [PATCH] efi_loader: Fix link of EFI apps with ld.lld 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 Cc: Heinrich Schuchardt Cc: Nick Desaulniers Reviewed-by: Heinrich Schuchardt --- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 07696e8..39f0339 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.7.4