From 6eef8586945dfaac8a3c049ff8ad9a63439931cc Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Thu, 15 Dec 2016 17:36:54 +0000 Subject: [PATCH] Add -fPIC to the ubldr build. Without this the self relocation code will try to use an absolute address in a switch statement, jumping to an invalid memory location. Sponsored by: ABT Systems Ltd --- sys/boot/arm/uboot/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile index 8b4b8caea59..94955d84e82 100644 --- a/sys/boot/arm/uboot/Makefile +++ b/sys/boot/arm/uboot/Makefile @@ -109,6 +109,8 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -fPIC + # clang doesn't understand %D as a specifier to printf NO_WERROR.clang=