Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162684
b: refs/heads/master
c: 2253257
h: refs/heads/master
v: v3
  • Loading branch information
Robin Getz authored and Mike Frysinger committed Sep 17, 2009
1 parent bf3a1cd commit fd3a6c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 35 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c014e15a2f667f91b5c2d08a90d77197a89d8065
refs/heads/master: 22532578ee0f8725e0155e528c29ff992c1950c7
42 changes: 8 additions & 34 deletions trunk/arch/blackfin/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,40 +243,6 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
#endif
switch (ELF32_R_TYPE(rel[i].r_info)) {

case R_BFIN_PCREL24:
case R_BFIN_PCREL24_JUMP_L:
/* Add the value, subtract its postition */
location16 =
(uint16_t *) (sechdrs[sechdrs[relsec].sh_info].
sh_addr + rel[i].r_offset - 2);
location32 = (uint32_t *) location16;
value -= (uint32_t) location32;
value >>= 1;
if ((value & 0xFF000000) != 0 &&
(value & 0xFF000000) != 0xFF000000) {
printk(KERN_ERR "module %s: relocation overflow\n",
mod->name);
return -ENOEXEC;
}
pr_debug("value is %x, before %x-%x after %x-%x\n", value,
*location16, *(location16 + 1),
(*location16 & 0xff00) | (value >> 16 & 0x00ff),
value & 0xffff);
*location16 =
(*location16 & 0xff00) | (value >> 16 & 0x00ff);
*(location16 + 1) = value & 0xffff;
break;
case R_BFIN_PCREL12_JUMP:
case R_BFIN_PCREL12_JUMP_S:
value -= (uint32_t) location32;
value >>= 1;
*location16 = (value & 0xfff);
break;
case R_BFIN_PCREL10:
value -= (uint32_t) location32;
value >>= 1;
*location16 = (value & 0x3ff);
break;
case R_BFIN_LUIMM16:
pr_debug("before %x after %x\n", *location16,
(value & 0xffff));
Expand All @@ -302,6 +268,14 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
pr_debug("before %x after %x\n", *location32, value);
*location32 = value;
break;
case R_BFIN_PCREL24:
case R_BFIN_PCREL24_JUMP_L:
case R_BFIN_PCREL12_JUMP:
case R_BFIN_PCREL12_JUMP_S:
case R_BFIN_PCREL10:
printk(KERN_ERR "module %s: Unsupported relocation: %u (no -mlong-calls?)\n"
mod->name, ELF32_R_TYPE(rel[i].r_info));
return -ENOEXEC;
default:
printk(KERN_ERR "module %s: Unknown relocation: %u\n",
mod->name, ELF32_R_TYPE(rel[i].r_info));
Expand Down

0 comments on commit fd3a6c8

Please sign in to comment.