35,6 → 35,7 |
*/ |
|
#include <stdio.h> |
#include <stdlib.h> |
|
#include <arch.h> |
#include <elf_dyn.h> |
226,10 → 227,8 |
pidx = (r_ptr - _plt_ent) / 2; |
if (pidx >= plt_n) { |
DPRINTF("error: proc index out of range\n"); |
//kputint(0xee00ee0ee00); |
while(1); |
exit(1); |
} |
//_plt_table[pidx] = sym_addr; |
plt[18+2*pidx] = _b((void *)sym_addr, &plt[18+2*pidx]); |
break; |
|
258,14 → 257,24 |
DPRINTF("fixup R_PPC_RELATIVE (b+a)\n"); |
*r_ptr = r_addend + m->bias; |
break; |
|
case R_PPC_REL24: |
// printf("ignore R_PPC_REL24 at 0x%04x\n", (uintptr_t) r_ptr); |
DPRINTF("fixup R_PPC_REL24 (s+a-p)>>2\n"); |
*r_ptr = (sym_addr + r_addend - (uint32_t)r_ptr) >> 2; |
DPRINTF("fixup R_PPC_REL24 (s+a-p)>>2\n"); |
/*TODO*/ |
break; |
|
case R_PPC_DTPMOD32: |
/* |
* We can ignore this as long as the only module |
* with TLS variables is libc.so. |
*/ |
DPRINTF("Ignoring R_PPC_DTPMOD32\n"); |
break; |
|
default: |
printf("unknown relocation type %d\n", rel_type); |
printf("Error: Unknown relocation type %d.\n", |
rel_type); |
exit(1); |
break; |
} |
} |