summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-11-12 12:07:04 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2019-11-12 12:09:37 +0100
commitb0348d677bb47bdbd368983603b3e9604528d4ed (patch)
tree9464fbd57f6c64dc597889712e763a3b2e40a6a0 /arch/arm/mach-tegra
parent3b8b70bfd743c303349f67c892631cb04c2b3c68 (diff)
downloadbarebox-b0348d677bb47bdbd368983603b3e9604528d4ed.tar.gz
barebox-b0348d677bb47bdbd368983603b3e9604528d4ed.tar.xz
ARM: Compile with -fPIE
Early code in barebox often runs at an address the binary is not linked at. This causes problems for example when simple initializations in a switch are converted to an array lookup (-ftree-switch-conversion). These arrays are then addressed where they are linked at. Some code where this is known to cause problems is already compiled with -fno-tree-switch-conversion. This however is limited to single files. This patch compiles barebox with -fPIE enabled. This causes such tables to be looked up PC relative rather than with its absolute address. This makes the -fno-tree-switch-conversion and -fno-jump-table options unnecessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r--arch/arm/mach-tegra/Makefile12
1 files changed, 2 insertions, 10 deletions
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 7c4c1fd137..7547951752 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -1,13 +1,5 @@
-CFLAGS_tegra_avp_init.o := \
- -mcpu=arm7tdmi -march=armv4t \
- -fno-tree-switch-conversion -fno-jump-tables
-CFLAGS_pbl-tegra_avp_init.o := \
- -mcpu=arm7tdmi -march=armv4t \
- -fno-tree-switch-conversion -fno-jump-tables
-CFLAGS_tegra_maincomplex_init.o := \
- -fno-tree-switch-conversion -fno-jump-tables
-CFLAGS_pbl-tegra_maincomplex_init.o := \
- -fno-tree-switch-conversion -fno-jump-tables
+CFLAGS_tegra_avp_init.o := -mcpu=arm7tdmi -march=armv4t
+CFLAGS_pbl-tegra_avp_init.o := -mcpu=arm7tdmi -march=armv4t
lwl-y += tegra_avp_init.o
lwl-y += tegra_maincomplex_init.o
obj-y += tegra20.o