[SLOF] [PATCH] Align stage2 TOC to 256 bytes for binutils 2.25.1.

William Grant wgrant at ubuntu.com
Fri Oct 9 15:22:09 AEDT 2015


2.25.1 changed BFD to align the TOC to 256 rather than 8 bytes, so
__toc_start pointed to the wrong place and stage2's TOC references were
wrong. This caused an inevitable crash just after entering C.
---
 board-js2x/llfw/stage2.lds | 3 ++-
 board-qemu/llfw/stage2.lds | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/board-js2x/llfw/stage2.lds b/board-js2x/llfw/stage2.lds
index f91f065..f60cf5a 100644
--- a/board-js2x/llfw/stage2.lds
+++ b/board-js2x/llfw/stage2.lds
@@ -41,7 +41,8 @@ SECTIONS {
 		*(.bss)
 	}

-	. = ALIGN(8);
+	/* binutils >= 2.25.1 require the TOC to be 256-byte aligned. */
+	. = ALIGN(256);
 	__bss_end = .;
 	__bss_size = (__bss_end - __bss_start);

diff --git a/board-qemu/llfw/stage2.lds b/board-qemu/llfw/stage2.lds
index e060dd1..002b871 100644
--- a/board-qemu/llfw/stage2.lds
+++ b/board-qemu/llfw/stage2.lds
@@ -45,7 +45,8 @@ SECTIONS {
 		*(.bss)
 	}

-	. = ALIGN(8);
+	/* binutils >= 2.25.1 require the TOC to be 256-byte aligned. */
+	. = ALIGN(256);
 	__bss_end = .;
 	__bss_size = (__bss_end - __bss_start);

-- 
2.5.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20151009/567704ba/attachment.sig>


More information about the SLOF mailing list