Expand PMF_FN_* macros.
[netbsd-mini2440.git] / libexec / ld.aout_so / md-prologue.c
blob57f73535b5f4556a525c0a89990ca074297bab6e
1 /* $NetBSD: md-prologue.c,v 1.2 1996/07/03 03:31:56 thorpej Exp $ */
3 /*
4 * rtld entry pseudo code - turn into assembler and tweak it
5 */
7 #include <sys/types.h>
8 #include <a.out.h>
9 #include "link.h"
10 #include "md.h"
12 extern long _GOT_[];
13 extern void (*rtld)();
14 extern void (*binder())();
16 void
17 rtld_entry(version, crtp)
18 int version;
19 struct crt *crtp;
21 register struct link_dynamic *dp;
22 register void (*f)();
24 /* __DYNAMIC is first entry in GOT */
25 dp = (struct link_dynamic *) (_GOT_[0]+crtp->crt_ba);
27 f = (void (*)())((long)rtld + crtp->crt_ba);
28 (*f)(version, crtp, dp);
31 void
32 binder_entry()
34 extern int PC;
35 struct jmpslot *sp;
36 void (*func)();
38 func = binder(PC, sp->reloc_index & 0x003fffff);
39 (*func)();