public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v2] arm: Add OVERLAY command to BSS section on ARM64
@ 2023-12-17  0:33 Marek Vasut
  2023-12-17 18:41 ` Tom Rini
  2024-02-06 14:44 ` Ilias Apalodimas
  0 siblings, 2 replies; 4+ messages in thread
From: Marek Vasut @ 2023-12-17  0:33 UTC (permalink / raw)
  To: u-boot; +Cc: Marek Vasut, Simon Glass, Tom Rini

Avoid allocating and loading the BSS section.

$ aarch64-linux-gnu-objdump -Sh u-boot

Before:
  10 .bss_start    00000000  00000000000f21d8  00000000000f21d8  001021d8  2**0
                   CONTENTS, ALLOC, LOAD, DATA
  11 .bss          000068f8  00000000000f2200  00000000000f2200  001021d8  2**6
                   ALLOC
  12 .bss_end      00000000  00000000000f8af8  00000000000f8af8  00108af8  2**0
                   CONTENTS, ALLOC, LOAD, DATA

After:
  10 .bss_start    00000000  00000000000bf990  00000000000bf990  001021e0  2**0
                   CONTENTS
  11 .bss          000068e8  00000000000bf990  00000000000bf990  001021e0  2**4
                   CONTENTS
  12 .bss_end      00000000  00000000000c6278  00000000000c6278  00108ac8  2**0
                   CONTENTS

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
---
V2: Replicate arch/arm/cpu/u-boot.lds BSS part verbatim
---
 arch/arm/cpu/armv8/u-boot.lds | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv8/u-boot.lds b/arch/arm/cpu/armv8/u-boot.lds
index fb6a30c922f..ebdc079552d 100644
--- a/arch/arm/cpu/armv8/u-boot.lds
+++ b/arch/arm/cpu/armv8/u-boot.lds
@@ -151,16 +151,18 @@ SECTIONS
 
 	. = ALIGN(8);
 
-	.bss_start : {
+	.bss_start __rel_dyn_start (OVERLAY) : {
 		KEEP(*(.__bss_start));
+		__bss_base = .;
 	}
 
-	.bss : {
+	.bss __bss_base (OVERLAY) : {
 		*(.bss*)
 		 . = ALIGN(8);
+		 __bss_limit = .;
 	}
 
-	.bss_end : {
+	.bss_end __bss_limit (OVERLAY) : {
 		KEEP(*(.__bss_end));
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-06 16:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-17  0:33 [PATCH v2] arm: Add OVERLAY command to BSS section on ARM64 Marek Vasut
2023-12-17 18:41 ` Tom Rini
2024-02-06 14:44 ` Ilias Apalodimas
2024-02-06 16:35   ` Ilias Apalodimas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox