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)
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to