aboutsummaryrefslogtreecommitdiff
path: root/src/libmach/symmacho.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-19 19:29:25 +0000
committerrsc <devnull@localhost>2004-04-19 19:29:25 +0000
commita84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46 (patch)
tree59a0e921597e5aa53e83d487c16727a7bf01547a /src/libmach/symmacho.c
parent0e3cc9f456ea49919459bf1164d0c8309a6134fa (diff)
downloadplan9port-a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46.tar.gz
plan9port-a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46.tar.bz2
plan9port-a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46.zip
libmach
Diffstat (limited to 'src/libmach/symmacho.c')
-rw-r--r--src/libmach/symmacho.c50
1 files changed, 50 insertions, 0 deletions
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 <u.h>
+#include <libc.h>
+#include <mach.h>
+#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;
+}
+