[PATCH 03/18] tegra: disable more lowlevel unsafe switch optimizations
Lucas Stach
dev at lynxeye.de
Sun Apr 13 06:27:33 PDT 2014
fno-jump-tables isn't enough to guard against
gcc switch optimizations that are unsafe to use
in code that runs before relocation.
The switch-tree-conversion opt pass may generate
lookup tables that are placed in the data section
and accessed via absolute adressing, which fails
prior to relocation.
Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
arch/arm/boards/toradex-colibri-t20/Makefile | 4 +++-
arch/arm/boards/toshiba-ac100/Makefile | 4 +++-
arch/arm/mach-tegra/Makefile | 12 ++++++++++--
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/arch/arm/boards/toradex-colibri-t20/Makefile b/arch/arm/boards/toradex-colibri-t20/Makefile
index 5be3dd0e7c2e..d2d217319b34 100644
--- a/arch/arm/boards/toradex-colibri-t20/Makefile
+++ b/arch/arm/boards/toradex-colibri-t20/Makefile
@@ -1,2 +1,4 @@
-CFLAGS_pbl-entry.o := -mcpu=arm7tdmi -march=armv4t
+CFLAGS_pbl-entry.o := \
+ -mcpu=arm7tdmi -march=armv4t \
+ -fno-tree-switch-conversion -fno-jump-tables
lwl-y += entry.o
diff --git a/arch/arm/boards/toshiba-ac100/Makefile b/arch/arm/boards/toshiba-ac100/Makefile
index 4ef18c0ce919..2b6c09e2798e 100644
--- a/arch/arm/boards/toshiba-ac100/Makefile
+++ b/arch/arm/boards/toshiba-ac100/Makefile
@@ -1,3 +1,5 @@
-CFLAGS_pbl-entry.o := -mcpu=arm7tdmi -march=armv4t
+CFLAGS_pbl-entry.o := \
+ -mcpu=arm7tdmi -march=armv4t \
+ -fno-tree-switch-conversion -fno-jump-tables
lwl-y += entry.o
obj-y += board.o
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index 791d5d45a718..e68156a772ac 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -1,5 +1,13 @@
-CFLAGS_tegra_avp_init.o := -mcpu=arm7tdmi -march=armv4t -fno-jump-tables
-CFLAGS_pbl-tegra_avp_init.o := -mcpu=arm7tdmi -march=armv4t -fno-jump-tables
+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
lwl-y += tegra_avp_init.o
lwl-y += tegra_maincomplex_init.o
obj-y += tegra20.o
--
1.9.0
More information about the barebox
mailing list