svn commit: r312349 - in stable/11/sys/boot/efi: . loader/arch/arm

Oleksandr Tymoshenko gonzo at FreeBSD.org
Tue Jan 17 19:19:31 UTC 2017


Author: gonzo
Date: Tue Jan 17 19:19:29 2017
New Revision: 312349
URL: https://svnweb.freebsd.org/changeset/base/312349

Log:
  MFC r311888, r311890-r311891
  
  r311888:
  [efi] Fix off-by-one error in ARM .bss zeroing code in loader's _start
  
  __bss_end should not be included in .bss zeroing code. Otherwise first 4
  bytes of the section that follows .bss (in loader's case it's .sdata) are
  overwritten by zero.
  
  Reviewed by:	andrew
  Differential Revision:	https://reviews.freebsd.org/D9108
  
  r311890:
  [efi] Fix .rel.data.* being erroneously merged into .data on ARM
  
  Fix section pattern code to exclude .rel.data.* sections from being
  merged into .data. Otherwise relocations in those sections are lost
  in final binary
  
  Reviewed by:	andrew
  Differential Revision:	https://reviews.freebsd.org/D9108
  
  r311891:
  [efi] Build EFI bits with -fPIC on ARM
  
  clang 3.9.0 without -fPIC generates absolute jump table for
  switch/case statement which trips boot1.efi and loader.efi
  on ARM platform.
  
  Reviewed by:	andrew
  Differential Revision:	https://reviews.freebsd.org/D9108

Modified:
  stable/11/sys/boot/efi/Makefile.inc
  stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm
  stable/11/sys/boot/efi/loader/arch/arm/start.S
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/boot/efi/Makefile.inc
==============================================================================
--- stable/11/sys/boot/efi/Makefile.inc	Tue Jan 17 18:32:47 2017	(r312348)
+++ stable/11/sys/boot/efi/Makefile.inc	Tue Jan 17 19:19:29 2017	(r312349)
@@ -22,4 +22,8 @@ CFLAGS+=	-mno-aes
 CFLAGS+=	-fshort-wchar
 .endif
 
+.if ${MACHINE_CPUARCH} == "arm"
+CFLAGS+=	-fPIC
+.endif
+
 .include "../Makefile.inc"

Modified: stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm
==============================================================================
--- stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm	Tue Jan 17 18:32:47 2017	(r312348)
+++ stable/11/sys/boot/efi/loader/arch/arm/ldscript.arm	Tue Jan 17 19:19:29 2017	(r312349)
@@ -18,7 +18,7 @@ SECTIONS
   . = ALIGN(16);
   .data    :
   {
-    *(.data *.data.*)
+    *(.data .data.*)
     *(.gnu.linkonce.d*)
     *(.rodata)
     *(.rodata.*)

Modified: stable/11/sys/boot/efi/loader/arch/arm/start.S
==============================================================================
--- stable/11/sys/boot/efi/loader/arch/arm/start.S	Tue Jan 17 18:32:47 2017	(r312348)
+++ stable/11/sys/boot/efi/loader/arch/arm/start.S	Tue Jan 17 19:19:29 2017	(r312349)
@@ -161,7 +161,7 @@ _start:
 	mov	r2, #0
 
 1:	cmp	r0, r1
-	bgt	2f
+	bge	2f
 	str	r2, [r0], #4
 	b	1b
 2:


More information about the svn-src-all mailing list