diff options
| author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-08-18 20:49:37 +0100 |
|---|---|---|
| committer | Greg Hackmann <ghackmann@google.com> | 2017-10-09 14:00:14 -0700 |
| commit | 2f2860a504a30a7645c6a0ec06767c5c7677a4ea (patch) | |
| tree | 3118675c3269b0d25a4abf1161746ac203004334 /include/linux/compiler-clang.h | |
| parent | 00b6078ea64bfbbc539a8924a328053cc6d16114 (diff) | |
UPSTREAM: 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>
(cherry picked from commit 91ee5b21ee026c49e4e7483de69b55b8b47042be)
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Change-Id: I0a011945239d39a2d1eb04c20bf1b9ceb7d2b91d
Diffstat (limited to 'include/linux/compiler-clang.h')
0 files changed, 0 insertions, 0 deletions
