version 1.1.1.1, 2008/06/03 10:38:41 |
version 1.1.1.1.2.1, 2008/08/13 17:12:20 |
|
|
#include <prex/bootinfo.h> |
#include <prex/bootinfo.h> |
#include <platform.h> |
#include <platform.h> |
|
|
|
#ifdef DEBUG_ELF |
|
#define DPRINTF(a) printf a |
|
#else |
|
#define DPRINTF(a) |
|
#endif |
|
|
int |
int |
relocate_rel(Elf32_Rel *rel, Elf32_Addr sym_val, char *target_sect) |
relocate_rel(Elf32_Rel *rel, Elf32_Addr sym_val, char *target_sect) |
{ |
{ |
|
|
break; |
break; |
case R_386_32: |
case R_386_32: |
*where += (Elf32_Addr)phys_to_virt(sym_val); |
*where += (Elf32_Addr)phys_to_virt(sym_val); |
elf_print("R_386_32: %x -> %x\n", where, *where); |
DPRINTF(("R_386_32: %x -> %x\n", where, *where)); |
break; |
break; |
case R_386_PC32: |
case R_386_PC32: |
*where += sym_val - (Elf32_Addr)where; |
*where += sym_val - (Elf32_Addr)where; |
elf_print("R_386_PC32: %x -> %x\n", where, *where); |
DPRINTF(("R_386_PC32: %x -> %x\n", where, *where)); |
break; |
break; |
default: |
default: |
panic("relocation fail\n"); |
panic("relocation fail"); |
return -1; |
return -1; |
} |
} |
return 0; |
return 0; |
|
|
relocate_rela(Elf32_Rela *rela, Elf32_Addr sym_val, char *target_sec) |
relocate_rela(Elf32_Rela *rela, Elf32_Addr sym_val, char *target_sec) |
{ |
{ |
|
|
panic("Invalid relocation type\n"); |
panic("invalid relocation type"); |
return -1; |
return -1; |
} |
} |