diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 87123ae1fc..6666d95573 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -80,6 +80,7 @@ config ARCH_CHIP_IMX1 config ARCH_CHIP_IMX6 bool "NXP/Freescale iMX.6" select ARCH_CORTEXA9 + select ARM_THUMB select ARMV7A_HAVE_L2CC_PL310 select ARCH_HAVE_FPU select ARCH_HAVE_TRUSTZONE diff --git a/boards/arm/imx6/sabre-6quad/scripts/Make.defs b/boards/arm/imx6/sabre-6quad/scripts/Make.defs index 43cc934895..224eccce5e 100644 --- a/boards/arm/imx6/sabre-6quad/scripts/Make.defs +++ b/boards/arm/imx6/sabre-6quad/scripts/Make.defs @@ -34,7 +34,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y) ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing endif -ARCHCPUFLAGS = -mcpu=cortex-a9 -mfpu=vfpv4-d16 +ARCHCPUFLAGS = -mcpu=cortex-a9 -mfpu=vfpv4-d16 -mthumb ARCHCFLAGS = -fno-common -fno-builtin -ffunction-sections -fdata-sections ARCHCXXFLAGS = -fno-common -fno-builtin -fno-exceptions -fcheck-new -fno-rtti ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef diff --git a/libs/libc/machine/arm/armv7-a/arch_elf.c b/libs/libc/machine/arm/armv7-a/arch_elf.c index e9c719e7c4..3e724822a7 100644 --- a/libs/libc/machine/arm/armv7-a/arch_elf.c +++ b/libs/libc/machine/arm/armv7-a/arch_elf.c @@ -174,9 +174,9 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym, offset += sym->st_value - addr; #ifdef CONFIG_ARM_THUMB - if (offset & 2 || offset < (int32_t) 0xfe000000 || + if ((offset & 2) != 0 || offset < (int32_t) 0xfe000000 || #else - if (offset & 3 || offset < (int32_t) 0xfe000000 || + if ((offset & 3) != 0 || offset < (int32_t) 0xfe000000 || #endif offset >= (int32_t) 0x02000000) {