2 * Copyright (c) 1994 Sean Eric Fagan
3 * Copyright (c) 1994 Søren Schmidt
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer
11 * in this position and unchanged.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 * $FreeBSD: src/sys/i386/ibcs2/coff.h,v 1.5 1999/08/28 00:43:57 peter Exp $
30 * $DragonFly: src/sys/emulation/ibcs2/i386/Attic/coff.h,v 1.2 2003/06/17 04:28:35 dillon Exp $
37 unsigned short f_magic; /* magic number */
38 unsigned short f_nscns; /* # of sections */
39 long f_timdat; /* time stamp */
40 long f_symptr; /* symbol table offset */
41 long f_nsyms; /* # of symbols */
42 unsigned short f_opthdr; /* size of system header */
43 unsigned short f_flags; /* flags, see below */
47 F_RELFLG = 0x01, /* relocs have been stripped */
48 F_EXEC = 0x02, /* executable file (or shlib) */
49 F_LNNO = 0x04, /* line numbers have been stripped */
50 F_LSYMS = 0x08, /* symbols have been stripped */
51 F_SWABD = 0x40, /* swabbed byte names */
52 F_AR16WR = 0x80, /* 16-bit, byte reversed words */
53 F_AR32WR = 0x100 /* 32-bit, byte reversed words */
57 short magic; /* magic number -- see below */
58 short vstamp; /* artifacts from a by-gone day */
62 long entry; /* Entry point -- offset into file */
63 long tstart; /* artifacts from a by-gone day */
67 #define I386_COFF 0x14c
69 #define COFF_OMAGIC 0407 /* impure format */
70 #define COFF_NMAGIC 0410 /* read-only text */
71 #define COFF_ZMAGIC 0413 /* pagable from disk */
72 #define COFF_SHLIB 0443 /* a shared library */
75 char s_name[8]; /* name of section (e.g., ".text") */
76 long s_paddr; /* physical addr, used for standalone */
77 long s_vaddr; /* virtual address */
78 long s_size; /* size of section */
79 long s_scnptr; /* file offset of section */
80 long s_relptr; /* points to relocs for section */
81 long s_lnnoptr; /* points to line numbers for section */
82 unsigned short s_nreloc; /* # of relocs */
83 unsigned short s_nlnno; /* # of line no's */
84 long s_flags; /* section flags -- see below */
88 STYP_REG = 0x00, /* regular (alloc'ed, reloc'ed, loaded) */
89 STYP_DSECT = 0x01, /* dummy (reloc'd) */
90 STYP_NOLOAD = 0x02, /* no-load (reloc'd) */
91 STYP_GROUP = 0x04, /* grouped */
92 STYP_PAD = 0x08, /* padding (loaded) */
93 STYP_COPY = 0x10, /* ??? */
94 STYP_TEXT = 0x20, /* text */
95 STYP_DATA = 0x40, /* data */
96 STYP_BSS = 0x80, /* bss */
97 STYP_INFO = 0x200, /* comment (!loaded, !alloc'ed, !reloc'd) */
98 STYP_OVER = 0x400, /* overlay (!allocated, reloc'd, !loaded) */
99 STYP_LIB = 0x800 /* lists shared library files */