diff options
author | gonzo <gonzo@FreeBSD.org> | 2017-01-17 19:19:29 +0000 |
---|---|---|
committer | gonzo <gonzo@FreeBSD.org> | 2017-01-17 19:19:29 +0000 |
commit | 3a01a81052c3305926bf8b49dc77c547c57454d5 (patch) | |
tree | 6733029403074ab5d783a583bd402e009b867e03 /sys/boot | |
parent | a83af9e97a395aa00a3bbda568014f9704de8d56 (diff) | |
download | FreeBSD-src-3a01a81052c3305926bf8b49dc77c547c57454d5.zip FreeBSD-src-3a01a81052c3305926bf8b49dc77c547c57454d5.tar.gz |
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
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/efi/Makefile.inc | 4 | ||||
-rw-r--r-- | sys/boot/efi/loader/arch/arm/ldscript.arm | 2 | ||||
-rw-r--r-- | sys/boot/efi/loader/arch/arm/start.S | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/sys/boot/efi/Makefile.inc b/sys/boot/efi/Makefile.inc index 9d457f4..15b1f3b 100644 --- a/sys/boot/efi/Makefile.inc +++ b/sys/boot/efi/Makefile.inc @@ -22,4 +22,8 @@ CFLAGS+= -mno-aes CFLAGS+= -fshort-wchar .endif +.if ${MACHINE_CPUARCH} == "arm" +CFLAGS+= -fPIC +.endif + .include "../Makefile.inc" diff --git a/sys/boot/efi/loader/arch/arm/ldscript.arm b/sys/boot/efi/loader/arch/arm/ldscript.arm index 8b4a6dc..1028a44 100644 --- a/sys/boot/efi/loader/arch/arm/ldscript.arm +++ b/sys/boot/efi/loader/arch/arm/ldscript.arm @@ -18,7 +18,7 @@ SECTIONS . = ALIGN(16); .data : { - *(.data *.data.*) + *(.data .data.*) *(.gnu.linkonce.d*) *(.rodata) *(.rodata.*) diff --git a/sys/boot/efi/loader/arch/arm/start.S b/sys/boot/efi/loader/arch/arm/start.S index 443de4a..9bc0c9f 100644 --- a/sys/boot/efi/loader/arch/arm/start.S +++ b/sys/boot/efi/loader/arch/arm/start.S @@ -161,7 +161,7 @@ _start: mov r2, #0 1: cmp r0, r1 - bgt 2f + bge 2f str r2, [r0], #4 b 1b 2: |