Commit | Line | Data |
---|---|---|
1136f72d PR |
1 | /* |
2 | * rtld entry pseudo code - turn into assembler and tweak it | |
3 | */ | |
4 | ||
5 | #include <sys/types.h> | |
6 | #include <sys/types.h> | |
7 | #include <a.out.h> | |
8 | #include "link.h" | |
9 | #include "md.h" | |
10 | ||
11 | extern long _GOT_[]; | |
12 | extern void (*rtld)(); | |
13 | extern void (*binder())(); | |
14 | ||
15 | void | |
16 | rtld_entry(version, crtp) | |
17 | int version; | |
18 | struct crt *crtp; | |
19 | { | |
20 | register struct link_dynamic *dp; | |
21 | register void (*f)(); | |
22 | ||
23 | /* __DYNAMIC is first entry in GOT */ | |
24 | dp = (struct link_dynamic *) (_GOT_[0]+crtp->crt_ba); | |
25 | ||
26 | f = (void (*)())((long)rtld + crtp->crt_ba); | |
27 | (*f)(version, crtp, dp); | |
28 | } | |
29 | ||
30 | void | |
31 | binder_entry() | |
32 | { | |
33 | extern int PC; | |
34 | struct jmpslot *sp; | |
35 | void (*func)(); | |
36 | ||
37 | func = binder(PC, sp->reloc_index & 0x003fffff); | |
38 | (*func)(); | |
39 | } |