linux-uconsole/arch
Nathan Chancellor 37cb02da44 arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly
[ Upstream commit aa69fb62be ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-07-26 09:13:56 +02:00
..
alpha alpha: Fix Eiger NR_IRQS to 128 2019-02-20 10:25:47 +01:00
arc ARC: hide unused function unw_hdr_alloc 2019-07-21 09:03:14 +02:00
arm ARM: dts: imx6ul: fix PWM[1-4] interrupts 2019-07-21 09:03:08 +02:00
arm64 arm64/efi: Mark __efistub_stext_offset as an absolute symbol explicitly 2019-07-26 09:13:56 +02:00
c6x kbuild: rename LDFLAGS to KBUILD_LDFLAGS 2018-08-24 08:22:08 +09:00
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:32:55 +02:00
hexagon hexagon: modify ffs() and fls() to return int 2018-09-10 19:42:15 -05:00
ia64 ia64: fix build errors by exporting paddr_to_nid() 2019-06-22 08:15:19 +02:00
m68k m68k: Add -ffreestanding to CFLAGS 2019-03-23 20:10:00 +01:00
microblaze mm: make the __PAGETABLE_PxD_FOLDED defines non-empty 2018-12-29 13:37:57 +01:00
mips MIPS: fix build on non-linux hosts 2019-07-26 09:13:55 +02:00
nds32 nds32: Fix gcc 8.0 compiler option incompatible. 2019-02-12 19:46:57 +01:00
nios2 nios2: kconfig: remove duplicate DEBUG_STACK_USAGE symbol defintions 2018-08-27 09:47:20 +08:00
openrisc OpenRISC updates for 4.19 2018-08-23 14:09:37 -07:00
parisc parisc: Fix compiler warnings in float emulation code 2019-06-25 11:35:55 +08:00
powerpc powerpc/mm/64s/hash: Reallocate context ids on fork 2019-06-25 11:36:02 +08:00
riscv riscv: Fix udelay in RV32. 2019-07-14 08:11:09 +02:00
s390 s390: fix stfle zero padding 2019-07-21 09:03:14 +02:00
sh sh: sh7786: Add explicit I/O cast to sh7786_mm_sel() 2019-05-31 06:46:28 -07:00
sparc sparc: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD 2019-06-25 11:35:57 +08:00
um uml: fix a boot splat wrt use of cpu_all_mask 2019-06-15 11:54:05 +02:00
unicore32 mm: convert return type of handle_mm_fault() caller to vm_fault_t 2018-08-17 16:20:28 -07:00
x86 x86/entry/32: Fix ENDPROC of common_spurious 2019-07-21 09:03:18 +02:00
xtensa xtensa: Fix section mismatch between memblock_reserve and mem_reserve 2019-06-25 11:35:56 +08:00
.gitignore
Kconfig jump_label: move 'asm goto' support test to Kconfig 2019-06-04 08:02:34 +02:00