mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-17 14:18:14 +01:00
Makefile: apply dynamic relocations for LLD
It seems that for aarch64, unless we apply dynamic relocations to the location being relocated, we fail to boot. As Fangrui notes: For dynamic relocations using the RELA format (readelf -Wr), GNU ld sets the initial content to r_addend; ld.lld doesn't do that by default (needs --apply-dynamic-relocs). Otherwise .rodata appears to be full of NUL-bytes before relocation, causing crashes when trying to invoke the function pointers in init_sequence_f from initcall_run_list(). Link: https://reviews.llvm.org/D42797 Suggested-by: Fangrui Song <maskray@google.com> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Alistair Delva <adelva@google.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Nick Desaulniers <ndesaulniers@google.com>
This commit is contained in:
parent
43b7dcdf34
commit
0b943587d2
2
Makefile
2
Makefile
@ -1023,7 +1023,7 @@ LDFLAGS_u-boot += $(LDFLAGS_FINAL)
|
|||||||
LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker)
|
LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker)
|
||||||
|
|
||||||
# ld.lld support
|
# ld.lld support
|
||||||
LDFLAGS_u-boot += -z notext
|
LDFLAGS_u-boot += -z notext $(call ld-option,--apply-dynamic-relocs)
|
||||||
|
|
||||||
LDFLAGS_u-boot += --build-id=none
|
LDFLAGS_u-boot += --build-id=none
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user