Skip to contentSkip to conversation

PARISC: fix boot failure on 32-bit systems caused by branch stubs placed before .text

PATCH New John David Anglin 1 participant 1 message May 17, 2012 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PARISC: fix boot failure on 32-bit systems caused by branch stubs placed before .text

In certain configurations, the resulting kernel becomes too large to boot because the linker places the long branch stubs for the merged .text section at the very start of the image. As a result, the initial transfer of control jumps to an unexpected location. Fix this by placing the head text in a separate section so the stubs for .text are not at the start of the image.

Signature · 1 line
John David Anglin    [email protected]
 arch/parisc/kernel/vmlinux.lds.S |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/parisc/kernel/vmlinux.lds.S +4 -2
index fa6f2b8..64a9998 100644
@@ -50,8 +50,10 @@ SECTIONS
 	. = KERNEL_BINARY_TEXT_START;
 
 	_text = .;		/* Text and read-only data */
-	.text ALIGN(16) : {
+	.head ALIGN(16) : {
 		HEAD_TEXT
+	} = 0
+	.text ALIGN(16) : {
 		TEXT_TEXT
 		SCHED_TEXT
 		LOCK_TEXT
@@ -65,7 +67,7 @@ SECTIONS
 		*(.fixup)
 		*(.lock.text)		/* out-of-line lock text */
 		*(.gnu.warning)
-	} = 0
+	}
 	/* End of text section */
 	_etext = .;