Author: kevans
Date: Thu Jan 18 22:46:47 2018
New Revision: 328156
URL: https://svnweb.freebsd.org/changeset/base/328156

Log:
  stand: Move sections around to fix stand/ build with ld.lld on armv7
  
  When building loader bits, lld fails with the following error:
  "ld: error: section: .dynamic is not contiguous with other relro sections"
  on both ubldr and EFI loader.
  
  Move .dynamic up to make ld.lld happy, adjust .got as necessary for ubldr.
  
  Tested on:    OrangePi One (ld.lld, ubldr)
  Tested on:    Banana Pi-M3 (ld.lld, ubldr)
  Tested on:    qemu-armv7 (ld.lld, EFI)
  Tested on:    qemu-armv7 (ld.bfd, EFI)
  Tested on:    Raspberry Pi 2 (ld.bfd, ubldr) [manu]
  Tested on:    Banana Pi-M2 (ld.bfd, ubldr) [manu]
  Reviewed by:  andrew, emaste, imp
  Differential Revision:        https://reviews.freebsd.org/D13942

Modified:
  head/stand/arm/uboot/ldscript.arm
  head/stand/efi/loader/arch/arm/ldscript.arm

Modified: head/stand/arm/uboot/ldscript.arm
==============================================================================
--- head/stand/arm/uboot/ldscript.arm   Thu Jan 18 22:23:16 2018        
(r328155)
+++ head/stand/arm/uboot/ldscript.arm   Thu Jan 18 22:46:47 2018        
(r328156)
@@ -32,6 +32,11 @@ SECTIONS
   .rela.got      : { *(.rela.got)              }
   .rela.got1     : { *(.rela.got1)             }
   .rela.got2     : { *(.rela.got2)             }
+  .dynamic        : { *(.dynamic) }
+                PROVIDE (_GOT_START_ = .);
+  .got            : { *(.got) }
+  .got.plt        : { *(.got.plt) }
+                PROVIDE (_GOT_END_ = .);
   .rela.ctors    : { *(.rela.ctors)    }
   .rela.dtors    : { *(.rela.dtors)    }
   .rela.init     : { *(.rela.init)     }
@@ -58,7 +63,6 @@ SECTIONS
   }
   .data1   : { *(.data1) }
   .got1           : { *(.got1) }
-  .dynamic        : { *(.dynamic) }
   /* Put .ctors and .dtors next to the .got2 section, so that the pointers
      get relocated with -mrelocatable. Also put in the .fixup pointers.
      The current compiler no longer needs this, but keep it around for 2.7.2  
*/
@@ -74,10 +78,6 @@ SECTIONS
   .fixup          : { *(.fixup) }
                 PROVIDE (_FIXUP_END_ = .);
                 PROVIDE (_GOT2_END_ = .);
-                PROVIDE (_GOT_START_ = .);
-  .got            : { *(.got) }
-  .got.plt        : { *(.got.plt) }
-                PROVIDE (_GOT_END_ = .);
   /* We want the small data sections together, so single-instruction offsets
      can access them all, and initialized data all before uninitialized, so
      we can shorten the on-disk segment size.  */

Modified: head/stand/efi/loader/arch/arm/ldscript.arm
==============================================================================
--- head/stand/efi/loader/arch/arm/ldscript.arm Thu Jan 18 22:23:16 2018        
(r328155)
+++ head/stand/efi/loader/arch/arm/ldscript.arm Thu Jan 18 22:46:47 2018        
(r328156)
@@ -35,6 +35,7 @@ SECTIONS
     . = ALIGN(4);
     PROVIDE (__bss_end = .);
   }
+  .dynamic     : { *(.dynamic) }
   /* We want the small data sections together, so single-instruction offsets
      can access them all, and initialized data all before uninitialized, so
      we can shorten the on-disk segment size.  */
@@ -54,7 +55,6 @@ SECTIONS
   }
   __gp = .;
   .plt   : { *(.plt) }
-  .dynamic     : { *(.dynamic) }
   .reloc       : { *(.reloc) }
   .dynsym      : { *(.dynsym) }
   .dynstr      : { *(.dynstr) }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to