36,13 → 36,13 |
|
#include <elf_dyn.h> |
#include <rtld.h> |
#include <pcb.h> |
#include <loader/pcb.h> |
|
// for testing printf |
#include <stdio.h> |
|
void __main(void); |
void __io_init(void); |
void __main(pcb_t *pcb); |
//void __io_init(void); |
void __exit(void); |
|
static void kputint(unsigned i) |
100,9 → 100,9 |
|
int test_var = 0x818283; |
|
void __bootstrap(void); |
void __bootstrap(pcb_t *pcb); |
|
void __bootstrap(void) |
void __bootstrap(pcb_t *pcb) |
{ |
unsigned bias; |
uint32_t *plt; |
122,13 → 122,11 |
elf_rela_t *rel_table; |
elf_rela_t *jmp_rel_table; |
size_t jmp_rel_entries; |
pcb_t *pcb; |
uint32_t a, res; |
uint32_t *r_ptr; |
uint32_t *_plt_ent; |
|
kputint(42); |
pcb = __pcb_get(); |
|
/* The program loader (iloader) kindly provided us with these */ |
dynamic = pcb->rtld_dynamic; |
312,10 → 310,10 |
// while(1); |
/* Init libc and run rtld main */ |
kputint(0x22); |
__main(); |
__main(pcb); |
|
kputint(33); |
__io_init(); |
// kputint(33); |
// __io_init(); |
kputint(-1); |
kputint(0x52); |
// printf("Hello, world! (from ppc rtld)\n"); |