diff options
-rw-r--r-- | arch/blackfin/kernel/module.c | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c index d5aee3626688..bb940784cf2e 100644 --- a/arch/blackfin/kernel/module.c +++ b/arch/blackfin/kernel/module.c | |||
@@ -243,40 +243,6 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, | |||
243 | #endif | 243 | #endif |
244 | switch (ELF32_R_TYPE(rel[i].r_info)) { | 244 | switch (ELF32_R_TYPE(rel[i].r_info)) { |
245 | 245 | ||
246 | case R_BFIN_PCREL24: | ||
247 | case R_BFIN_PCREL24_JUMP_L: | ||
248 | /* Add the value, subtract its postition */ | ||
249 | location16 = | ||
250 | (uint16_t *) (sechdrs[sechdrs[relsec].sh_info]. | ||
251 | sh_addr + rel[i].r_offset - 2); | ||
252 | location32 = (uint32_t *) location16; | ||
253 | value -= (uint32_t) location32; | ||
254 | value >>= 1; | ||
255 | if ((value & 0xFF000000) != 0 && | ||
256 | (value & 0xFF000000) != 0xFF000000) { | ||
257 | printk(KERN_ERR "module %s: relocation overflow\n", | ||
258 | mod->name); | ||
259 | return -ENOEXEC; | ||
260 | } | ||
261 | pr_debug("value is %x, before %x-%x after %x-%x\n", value, | ||
262 | *location16, *(location16 + 1), | ||
263 | (*location16 & 0xff00) | (value >> 16 & 0x00ff), | ||
264 | value & 0xffff); | ||
265 | *location16 = | ||
266 | (*location16 & 0xff00) | (value >> 16 & 0x00ff); | ||
267 | *(location16 + 1) = value & 0xffff; | ||
268 | break; | ||
269 | case R_BFIN_PCREL12_JUMP: | ||
270 | case R_BFIN_PCREL12_JUMP_S: | ||
271 | value -= (uint32_t) location32; | ||
272 | value >>= 1; | ||
273 | *location16 = (value & 0xfff); | ||
274 | break; | ||
275 | case R_BFIN_PCREL10: | ||
276 | value -= (uint32_t) location32; | ||
277 | value >>= 1; | ||
278 | *location16 = (value & 0x3ff); | ||
279 | break; | ||
280 | case R_BFIN_LUIMM16: | 246 | case R_BFIN_LUIMM16: |
281 | pr_debug("before %x after %x\n", *location16, | 247 | pr_debug("before %x after %x\n", *location16, |
282 | (value & 0xffff)); | 248 | (value & 0xffff)); |
@@ -302,6 +268,14 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab, | |||
302 | pr_debug("before %x after %x\n", *location32, value); | 268 | pr_debug("before %x after %x\n", *location32, value); |
303 | *location32 = value; | 269 | *location32 = value; |
304 | break; | 270 | break; |
271 | case R_BFIN_PCREL24: | ||
272 | case R_BFIN_PCREL24_JUMP_L: | ||
273 | case R_BFIN_PCREL12_JUMP: | ||
274 | case R_BFIN_PCREL12_JUMP_S: | ||
275 | case R_BFIN_PCREL10: | ||
276 | printk(KERN_ERR "module %s: Unsupported relocation: %u (no -mlong-calls?)\n" | ||
277 | mod->name, ELF32_R_TYPE(rel[i].r_info)); | ||
278 | return -ENOEXEC; | ||
305 | default: | 279 | default: |
306 | printk(KERN_ERR "module %s: Unknown relocation: %u\n", | 280 | printk(KERN_ERR "module %s: Unknown relocation: %u\n", |
307 | mod->name, ELF32_R_TYPE(rel[i].r_info)); | 281 | mod->name, ELF32_R_TYPE(rel[i].r_info)); |