Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Apr 2016 19:09:07 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r297758 - head/sys/boot/arm/uboot
Message-ID:  <201604091909.u39J97NG074738@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sat Apr  9 19:09:06 2016
New Revision: 297758
URL: https://svnweb.freebsd.org/changeset/base/297758

Log:
  Align the start of the text segment to an 8-byte boundary.  This fixes
  alignment aborts in ubldr.bin for RPi that started happening with clang 3.8
  (earlier clang apparently didn't generate strd instructions that trigger
  the alignment fault).  The abort happened in ubldr.bin and not ubldr (elf
  version) because the elf headers are 0xf4 bytes long, and stripping them
  off left everything 4-byte aligned.
  
  While here, also stop aligning the data segment to a page boundary, align
  it to 8 bytes instead (aligning to a page just needlessly makes the file
  bigger); pointed out by andrew@.

Modified:
  head/sys/boot/arm/uboot/ldscript.arm

Modified: head/sys/boot/arm/uboot/ldscript.arm
==============================================================================
--- head/sys/boot/arm/uboot/ldscript.arm	Sat Apr  9 18:52:09 2016	(r297757)
+++ head/sys/boot/arm/uboot/ldscript.arm	Sat Apr  9 19:09:06 2016	(r297758)
@@ -6,6 +6,7 @@ SECTIONS
 {
   /* Read-only sections, merged into text segment: */
   . = UBLDR_LOADADDR + SIZEOF_HEADERS;
+  . = ALIGN(8);
   .text      :
   {
     *(.text)
@@ -47,8 +48,8 @@ SECTIONS
   .rodata1   : { *(.rodata1) }
   .sdata2    : { *(.sdata2)  }
   .sbss2     : { *(.sbss2)   }
-  /* Adjust the address for the data segment to the next page up. */
-  . = ((. + 0x1000) & ~(0x1000 - 1));
+  /* Adjust the address for the data segment to the doubleword boundary. */
+  . = ALIGN(8);
   .data    :
   {
     *(.data)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604091909.u39J97NG074738>