diff options
author | rsc <devnull@localhost> | 2004-04-19 19:29:25 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-04-19 19:29:25 +0000 |
commit | a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46 (patch) | |
tree | 59a0e921597e5aa53e83d487c16727a7bf01547a /src/libmach/macho.h | |
parent | 0e3cc9f456ea49919459bf1164d0c8309a6134fa (diff) | |
download | plan9port-a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46.tar.gz plan9port-a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46.tar.bz2 plan9port-a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46.zip |
libmach
Diffstat (limited to 'src/libmach/macho.h')
-rw-r--r-- | src/libmach/macho.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/libmach/macho.h b/src/libmach/macho.h new file mode 100644 index 00000000..377e0d2b --- /dev/null +++ b/src/libmach/macho.h @@ -0,0 +1,71 @@ +typedef struct Macho Macho; +typedef struct MachoCmd MachoCmd; + +enum +{ + MachoCpuVax = 1, + MachoCpu68000 = 6, + MachoCpu386 = 7, + MachoCpuMips = 8, + MachoCpu98000 = 10, + MachoCpuHppa = 11, + MachoCpuArm = 12, + MachoCpu88000 = 13, + MachoCpuSparc = 14, + MachoCpu860 = 15, + MachoCpuAlpha = 16, + MachoCpuPower = 18, + + MachoCmdSegment = 1, + MachoCmdSymtab = 2, + MachoCmdSymseg = 3, + MachoCmdThread = 4, + + MachoFileObject = 1, + MachoFileExecutable = 2, + MachoFileFvmlib = 3, + MachoFileCore = 4, + MachoFilePreload = 5, +}; + +struct MachoCmd +{ + int type; + ulong off; + ulong size; + struct { + char name[16+1]; + ulong vmaddr; + ulong vmsize; + ulong fileoff; + ulong filesz; + ulong maxprot; + ulong initprot; + ulong nsect; + ulong flags; + } seg; + struct { + ulong symoff; + ulong nsyms; + ulong stroff; + ulong strsize; + } sym; +}; + +struct Macho +{ + int fd; + uint cputype; + uint subcputype; + ulong filetype; + ulong flags; + MachoCmd *cmd; + uint ncmd; + u32int (*e4)(uchar*); + int (*coreregs)(Macho*, uchar**); +}; + +Macho *machoopen(char*); +Macho *machoinit(int); +void machoclose(Macho*); +int coreregsmachopower(Macho*, uchar**); |