summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2015-05-18 11:03:13 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-06-02 04:58:17 -0400
commit73c430bf9ac6cd3a41ccc3c9904e66cc0a5f9420 (patch)
treeb857fdbde90922fa08ab614f6f8f0914d8db30f8
parent29d2e5631ca25fc45d68373817cd3f2b5ee7d8d0 (diff)
ARM: 8364/1: fix BE32 module loading
The new veneer support for loadable modules on ARM uses the __opcode_to_mem_thumb32() function to count R_ARM_THM_CALL and R_ARM_THM_JUMP24 relocations. However, this function is not defined for big-endian kernels on ARMv5 or before, causing a compile-time error: arch/arm/kernel/module-plts.c: In function 'count_plts': arch/arm/kernel/module-plts.c:124:9: error: implicit declaration of function '__opcode_to_mem_thumb32' [-Werror=implicit-function-declaration] __opcode_to_mem_thumb32(0x07ff2fff))) ^ As we know that this part of the function is only needed for Thumb2 kernels, and that those can never happen with BE32, we can avoid the error by enclosing the code in an #ifdef. Fixes: 7d485f647c1 ("ARM: 8220/1: allow modules outside of bl range") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/kernel/module-plts.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/kernel/module-plts.c b/arch/arm/kernel/module-plts.c
index 71a65c49871d..097e2e201b9f 100644
--- a/arch/arm/kernel/module-plts.c
+++ b/arch/arm/kernel/module-plts.c
@@ -118,11 +118,13 @@ static unsigned int count_plts(Elf32_Addr base, const Elf32_Rel *rel, int num)
118 __opcode_to_mem_arm(0x00ffffff))) 118 __opcode_to_mem_arm(0x00ffffff)))
119 ret++; 119 ret++;
120 break; 120 break;
121#ifdef CONFIG_THUMB2_KERNEL
121 case R_ARM_THM_CALL: 122 case R_ARM_THM_CALL:
122 case R_ARM_THM_JUMP24: 123 case R_ARM_THM_JUMP24:
123 if (!duplicate_rel(base, rel, i, 124 if (!duplicate_rel(base, rel, i,
124 __opcode_to_mem_thumb32(0x07ff2fff))) 125 __opcode_to_mem_thumb32(0x07ff2fff)))
125 ret++; 126 ret++;
127#endif
126 } 128 }
127 return ret; 129 return ret;
128} 130}