linux-stable/arch/arm64
Nathan Chancellor aa69fb62be arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly
After r363059 and r363928 in LLVM, a build using ld.lld as the linker
with CONFIG_RANDOMIZE_BASE enabled fails like so:

ld.lld: error: relocation R_AARCH64_ABS32 cannot be used against symbol
__efistub_stext_offset; recompile with -fPIC

Fangrui and Peter figured out that ld.lld is incorrectly considering
__efistub_stext_offset as a relative symbol because of the order in
which symbols are evaluated. _text is treated as an absolute symbol
and stext is a relative symbol, making __efistub_stext_offset a
relative symbol.

Adding ABSOLUTE will force ld.lld to evalute this expression in the
right context and does not change ld.bfd's behavior. ld.lld will
need to be fixed but the developers do not see a quick or simple fix
without some research (see the linked issue for further explanation).
Add this simple workaround so that ld.lld can continue to link kernels.

Link: https://github.com/ClangBuiltLinux/linux/issues/561
Link: 025a815d75
Link: 249fde8583
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Debugged-by: Fangrui Song <maskray@google.com>
Debugged-by: Peter Smith <peter.smith@linaro.org>
Suggested-by: Fangrui Song <maskray@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
[will: add comment]
Signed-off-by: Will Deacon <will@kernel.org>
2019-06-26 11:40:20 +01:00
..
boot arm64: dts: sprd: Add clock properties for serial devices 2019-05-16 14:43:33 -07:00
configs ARM: SoC defconfig updates 2019-05-16 09:35:26 -07:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-05-06 20:15:06 -07:00
include arm64/mm: don't initialize pgd_cache twice 2019-06-18 14:37:28 +01:00
kernel arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly 2019-06-26 11:40:20 +01:00
kvm * ARM: support for SVE and Pointer Authentication in guests, PMU improvements 2019-05-17 10:33:30 -07:00
lib arm64: Makefile: Replace -pg with CC_FLAGS_FTRACE 2019-04-09 10:34:59 +01:00
mm arm64: errata: Add workaround for Cortex-A76 erratum #1463225 2019-05-23 11:38:10 +01:00
net bpf, arm64: use more scalable stadd over ldxr / stxr loop in xadd 2019-04-26 18:53:40 -07:00
xen
Kconfig arm64: Kconfig: Make ARM64_PSEUDO_NMI depend on BROKEN for now 2019-05-24 14:58:19 +01:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Kconfig.platforms Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-05-19 10:58:45 -07:00
Makefile arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGS 2019-06-12 10:54:47 +01:00