diff mbox series

[boot-wrapper,02/12] Output text separately from data

Message ID 20210729152050.23635-3-mark.rutland@arm.com (mailing list archive)
State New, archived
Headers show
Series Preparatory fixes and cleanup | expand

Commit Message

Mark Rutland July 29, 2021, 3:20 p.m. UTC
Assembly files generally assume that .text is word-aligned, and don't
explciitly align the .text section. However, if we mix .text with data
sections at link time, we can output .text sections at less than word
alignment, resulting in boot-time hangs that are painful to debug.

Output all .text sections before .data sections to minimize this risk.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
---
 model.lds.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/model.lds.S b/model.lds.S
index 370ff56..d4e7e13 100644
--- a/model.lds.S
+++ b/model.lds.S
@@ -65,7 +65,8 @@  SECTIONS
 
 	.boot PHYS_OFFSET: {
 		*(.init)
-		*(.text* .data* .rodata* .bss* COMMON)
+		*(.text*)
+		*(.data* .rodata* .bss* COMMON)
 		*(.vectors)
 		*(.stack)
 		PROVIDE(etext = .);