kernel-ark/drivers/firmware/efi/libstub
Ard Biesheuvel 91ee5b21ee efi/libstub/arm64: Set -fpie when building the EFI stub
Clang may emit absolute symbol references when building in non-PIC mode,
even when using the default 'small' code model, which is already mostly
position independent to begin with, due to its use of adrp/add pairs
that have a relative range of +/- 4 GB. The remedy is to pass the -fpie
flag, which can be done safely now that the code has been updated to avoid
GOT indirections (which may be emitted due to the compiler assuming that
the PIC/PIE code may end up in a shared library that is subject to ELF
symbol preemption)

Passing -fpie when building code that needs to execute at an a priori
unknown offset is arguably an improvement in any case, and given that
the recent visibility changes allow the PIC build to pass with GCC as
well, let's add -fpie for all arm64 builds rather than only for Clang.

Tested-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20170818194947.19347-5-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-08-21 09:43:49 +02:00
..
arm32-stub.c efi/libstub/arm/arm64: Disable debug prints on 'quiet' cmdline arg 2017-04-05 12:27:28 +02:00
arm64-stub.c efi/libstub/arm64: Force 'hidden' visibility for section markers 2017-08-21 09:43:49 +02:00
arm-stub.c efi/libstub/arm: Don't use TASK_SIZE when randomizing the RT space 2017-04-17 12:35:33 +02:00
efi-stub-helper.c efi/libstub/arm/arm64: Disable debug prints on 'quiet' cmdline arg 2017-04-05 12:27:28 +02:00
efistub.h efi/libstub/arm/arm64: Disable debug prints on 'quiet' cmdline arg 2017-04-05 12:27:28 +02:00
fdt.c arm64 updates for 4.12: 2017-05-05 12:11:37 -07:00
gop.c efi/libstub: Skip GOP with PIXEL_BLT_ONLY format 2017-04-05 09:20:18 +02:00
Makefile efi/libstub/arm64: Set -fpie when building the EFI stub 2017-08-21 09:43:49 +02:00
random.c efi/libstub: Make efi_random_alloc() allocate below 4 GB on 32-bit 2016-11-25 07:15:23 +01:00
secureboot.c efi: Remove duplicate 'const' specifiers 2017-05-28 11:06:16 +02:00
string.c arm64/efi: isolate EFI stub from the kernel proper 2015-10-12 16:20:12 +01:00