diff options
author | Alistair Delva <adelva@google.com> | 2021-10-20 21:31:33 +0000 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-10-31 12:26:44 -0600 |
commit | 58772283210e15f8d803db4aa67c877d668db867 (patch) | |
tree | fc452680e653902fe6df37aee78d9efa04da4155 /drivers/ddr/marvell/a38x/ddr3_training.c | |
parent | 286a1595fbf5e3d984fc400a3995dd32bc7aa54f (diff) |
x86: Fix linking u-boot with ld.lld
When linking the final u-boot binary with LLD, the following link errors
are seen:
ld.lld: error: can't create dynamic relocation R_386_32 against local
symbol in readonly segment; recompile object files with
-fPIC or pass '-Wl,-z,notext' to allow text relocations
in the output
>>> defined in arch/x86/cpu/start.o
>>> referenced by arch/x86/cpu/start.o:(.text.start+0x32)
[...]
>>> defined in arch/x86/cpu/start16.o
>>> referenced by arch/x86/cpu/start16.o:(.start16+0x1C)
According to Nick Desaulniers:
"This is a known difference between GNU and LLVM linkers; the GNU
linkers permit relocations in readonly segments (making them not read
only), LLVM does not (by default)."
Since U-Boot apparently seems to use relocations in readonly segments,
change the global linker flags to permit them when linking with LLD by
specifying '-z notext'.
Signed-off-by: Alistair Delva <adelva@google.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/ddr/marvell/a38x/ddr3_training.c')
0 files changed, 0 insertions, 0 deletions