Commit b7493156 authored by Catalin Marinas's avatar Catalin Marinas Committed by Russell King

ARM: 6191/1: Do not compile the Thumb-2 module relocations on an ARM kernel

Kernels compiled to ARM do not need to handle Thumb-2 module relocations
as interworking is not allowed. This patch #ifdef's out the handling of
such relocations.
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 0567821c
...@@ -102,7 +102,9 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, ...@@ -102,7 +102,9 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
unsigned long loc; unsigned long loc;
Elf32_Sym *sym; Elf32_Sym *sym;
s32 offset; s32 offset;
#ifdef CONFIG_THUMB2_KERNEL
u32 upper, lower, sign, j1, j2; u32 upper, lower, sign, j1, j2;
#endif
offset = ELF32_R_SYM(rel->r_info); offset = ELF32_R_SYM(rel->r_info);
if (offset < 0 || offset > (symsec->sh_size / sizeof(Elf32_Sym))) { if (offset < 0 || offset > (symsec->sh_size / sizeof(Elf32_Sym))) {
...@@ -185,6 +187,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, ...@@ -185,6 +187,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
(offset & 0x0fff); (offset & 0x0fff);
break; break;
#ifdef CONFIG_THUMB2_KERNEL
case R_ARM_THM_CALL: case R_ARM_THM_CALL:
case R_ARM_THM_JUMP24: case R_ARM_THM_JUMP24:
upper = *(u16 *)loc; upper = *(u16 *)loc;
...@@ -266,6 +269,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex, ...@@ -266,6 +269,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
((offset & 0x0700) << 4) | ((offset & 0x0700) << 4) |
(offset & 0x00ff)); (offset & 0x00ff));
break; break;
#endif
default: default:
printk(KERN_ERR "%s: unknown relocation: %u\n", printk(KERN_ERR "%s: unknown relocation: %u\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment