From a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46 Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 19 Apr 2004 19:29:25 +0000 Subject: libmach --- src/libmach/symmacho.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/libmach/symmacho.c (limited to 'src/libmach/symmacho.c') diff --git a/src/libmach/symmacho.c b/src/libmach/symmacho.c new file mode 100644 index 00000000..674190ff --- /dev/null +++ b/src/libmach/symmacho.c @@ -0,0 +1,50 @@ +#include +#include +#include +#include "macho.h" + +#if 0 +static int +machosyminit(Fhdr *fp) +{ + /* XXX should parse dynamic symbol table here */ + return 0; +} +#endif + +int +symmacho(Fhdr *fp) +{ + int ret; + Macho *m; + + m = fp->macho; + if(m == nil){ + werrstr("not a macho"); + return -1; + } + + ret = -1; + + if(machdebug) + fprint(2, "macho symbols...\n"); + +/* + if(machosyminit(fp) < 0) + fprint(2, "initializing macho symbols: %r\n"); + else + ret = 0; +*/ + + if(fp->stabs.stabbase){ + if(machdebug) + fprint(2, "stabs symbols...\n"); + + if(symstabs(fp) < 0) + fprint(2, "initializing stabs: %r"); + else + ret = 0; + } + return ret; +} + -- cgit v1.2.3