
On Fri, May 12, 2023 at 05:01:35PM -0600, Sam Edwards wrote:
The goal of using --apply-dynamic-relocs seems to be to have all relocations applied "statically" to the output binary, so that the dynamic segment can be dropped safely. However, LLD still creates sections to support the dynamic section, and platform linker scripts may not know to discard these.
Since the build process does not appear to make use of the dynamic segment at all, it would be more sensible to suppress it entirely.
Signed-off-by: Sam Edwards CFSworks@gmail.com
Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index 20785860f7..d71127e412 100644 --- a/Makefile +++ b/Makefile @@ -1024,7 +1024,7 @@ LDFLAGS_u-boot += $(LDFLAGS_FINAL) LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker)
# ld.lld support -LDFLAGS_u-boot += -z notext $(call ld-option,--apply-dynamic-relocs) +LDFLAGS_u-boot += -z notext $(call ld-option,--no-pie)
LDFLAGS_u-boot += --build-id=none
How extensively have you tested this change? We don't install ld.lld in our container environment right now (but should..) and from some local testing I forget if we need to pass further make logic in to have ld.lld be used instead.