mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-15 11:20:03 +00:00
51 lines
646 B
C
51 lines
646 B
C
|
#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;
|
||
|
}
|
||
|
|