From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Thu, 20 May 2021 13:24:04 +0200 Subject: [PATCH u-boot v4 15/36] build: link with --build-id=none In-Reply-To: <20210520112425.25166-1-marek.behun@nic.cz> References: <20210520112425.25166-1-marek.behun@nic.cz> Message-ID: <20210520112425.25166-16-marek.behun@nic.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Some toolchains are compiled so that they pass a --build-id=something parameter to the linker implicitly. This causes U-Boot LTO linking to fail with something like: ld: section .note.gnu.build-id LMA ... overlaps section .text LMA ... because U-Boot's link scripts do not currently handle .note.gnu.build-id section. Fix this by explicitly disabling build-id. Signed-off-by: Marek Beh?n --- Makefile | 2 ++ scripts/Makefile.spl | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 2329edc159..a62f7e3f7c 100644 --- a/Makefile +++ b/Makefile @@ -996,6 +996,8 @@ LDFLAGS_u-boot += $(LDFLAGS_FINAL) # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards. LDFLAGS_u-boot += $(call ld-option, --no-dynamic-linker) +LDFLAGS_u-boot += --build-id=none + ifeq ($(CONFIG_ARC)$(CONFIG_NIOS2)$(CONFIG_X86)$(CONFIG_XTENSA),) LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE) endif diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl index 7872cbaabe..5be1a9ba1b 100644 --- a/scripts/Makefile.spl +++ b/scripts/Makefile.spl @@ -399,6 +399,8 @@ LDFLAGS_$(SPL_BIN) += -T u-boot-spl.lds $(LDFLAGS_FINAL) # Avoid 'Not enough room for program headers' error on binutils 2.28 onwards. LDFLAGS_$(SPL_BIN) += $(call ld-option, --no-dynamic-linker) +LDFLAGS_$(SPL_BIN) += --build-id=none + # Pick the best-match (i.e. SPL_TEXT_BASE for SPL, TPL_TEXT_BASE for TPL) ifneq ($(CONFIG_$(SPL_TPL_)TEXT_BASE),) LDFLAGS_$(SPL_BIN) += -Ttext $(CONFIG_$(SPL_TPL_)TEXT_BASE) -- 2.26.3