1
0
Fork 0
alistair23-linux/drivers/firmware/efi/libstub
Ard Biesheuvel c573a13f72 efi/libstub/x86: Work around LLVM ELF quirk build regression
[ Upstream commit f77767ed5f ]

When building the x86 EFI stub with Clang, the libstub Makefile rules
that manipulate the ELF object files may throw an error like:

    STUBCPY drivers/firmware/efi/libstub/efi-stub-helper.stub.o
  strip: drivers/firmware/efi/libstub/efi-stub-helper.stub.o: Failed to find link section for section 10
  objcopy: drivers/firmware/efi/libstub/efi-stub-helper.stub.o: Failed to find link section for section 10

This is the result of a LLVM feature [0] where symbol references are
stored in a LLVM specific .llvm_addrsig section in a non-transparent way,
causing generic ELF tools such as strip or objcopy to choke on them.

So force the compiler not to emit these sections, by passing the
appropriate command line option.

[0] https://sourceware.org/bugzilla/show_bug.cgi?id=23817

Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Peter Collingbourne <pcc@google.com>
Cc: Sami Tolvanen <samitolvanen@google.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Fangrui Song <maskray@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-06-22 09:30:52 +02:00
..
Makefile efi/libstub/x86: Work around LLVM ELF quirk build regression 2020-06-22 09:30:52 +02:00
arm-stub.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 497 2019-06-19 17:09:53 +02:00
arm32-stub.c x86, efi: Never relocate kernel below lowest acceptable address 2019-10-31 09:40:19 +01:00
arm64-stub.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
efi-stub-helper.c x86, efi: Never relocate kernel below lowest acceptable address 2019-10-31 09:40:19 +01:00
efistub.h Abstract out support for locating an EFI config table 2019-06-24 23:57:49 +03:00
fdt.c Abstract out support for locating an EFI config table 2019-06-24 23:57:49 +03:00
gop.c efi/gop: Fix memory leak in __gop_query32/64() 2020-01-12 12:21:16 +01:00
random.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
secureboot.c efi: Replace GPL license boilerplate with SPDX headers 2019-02-04 08:27:25 +01:00
string.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tpm.c tpm: check event log version before reading final events 2020-05-27 17:46:52 +02:00