public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sam Edwards <cfsworks@gmail.com>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>, Sam Edwards <CFSworks@gmail.com>
Subject: [PATCH 3/3] clang: Link with --no-pie instead of --apply-dynamic-relocs
Date: Fri, 12 May 2023 17:01:35 -0600	[thread overview]
Message-ID: <20230512230135.133162-3-CFSworks@gmail.com> (raw)
In-Reply-To: <20230512230135.133162-1-CFSworks@gmail.com>

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
 
-- 
2.39.2


  parent reply	other threads:[~2023-05-13  9:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-12 23:01 [PATCH 1/3] makefile: Fix symbol typo in binary_size_check Sam Edwards
2023-05-12 23:01 ` [PATCH 2/3] makefile: Consider "no relocs" to be "no unexpected relocs" Sam Edwards
2023-05-12 23:01 ` Sam Edwards [this message]
2023-05-14 15:28   ` [PATCH 3/3] clang: Link with --no-pie instead of --apply-dynamic-relocs Tom Rini
2023-05-16  2:08     ` Sam Edwards
2023-05-14 15:28 ` [PATCH 1/3] makefile: Fix symbol typo in binary_size_check Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230512230135.133162-3-CFSworks@gmail.com \
    --to=cfsworks@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox