* add p cc
[mascara-docs.git] / compilers / pcc / pcc-libs-1.0.0 / csu / darwin / macho.h
blobe47a554737426e5c2688bb2eea6ff77e129947db
1 /* $Id: macho.h,v 1.1 2008/06/01 01:28:34 gmcgarry Exp $ */
2 /*-
3 * Copyright (c) 2008 Gregory McGarry <g.mcgarry@ieee.org>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include <stdint.h>
20 struct mach_header {
21 uint32_t magic;
22 uint32_t cputype;
23 uint32_t cpusubtype;
24 uint32_t filetype;
25 uint32_t ncmds;
26 uint32_t sizeofcmds;
27 uint32_t flags;
30 #define LC_SEGMENT 0x01
32 struct segment_command {
33 uint32_t cmd;
34 uint32_t cmdsize;
35 char segname[16];
36 uint32_t vmaddr;
37 uint32_t vmsize;
38 uint32_t fileoff;
39 uint32_t filesize;
40 uint32_t maxprot;
41 uint32_t initprot;
42 uint32_t nsects;
43 uint32_t flags;
46 struct section {
47 char sectname[16];
48 char segname[16];
49 uint32_t addr;
50 uint32_t size;
51 uint32_t offset;
52 uint32_t align;
53 uint32_t reloff;
54 uint32_t nreloc;
55 uint32_t flags;
56 uint32_t reserved1;
57 uint32_t reserved2;