1#ifndef _COFF_FILEHDR_H
2#define _COFF_FILEHDR_H
3/*
4 * These data structures are discribed in the pecoff_v8.doc in section
5 * "3.3. COFF File Header (Object and Image)"
6 */
7#include <stdint.h>
8
9/*
10 * At the beginning of an object file, or immediately after the signature of an
11 * image file, is a standard COFF file header in the following format. Note
12 *
13 * Since definitions for this header were based from the GNU binutils
14 * coff/pe.h header file that copyright info is below.
15 */
16
17/* pe.h  -  PE COFF header information
18
19   Copyright 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
20
21   This file is part of BFD, the Binary File Descriptor library.
22
23   This program is free software; you can redistribute it and/or modify
24   it under the terms of the GNU General Public License as published by
25   the Free Software Foundation; either version 2 of the License, or
26   (at your option) any later version.
27
28   This program is distributed in the hope that it will be useful,
29   but WITHOUT ANY WARRANTY; without even the implied warranty of
30   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31   GNU General Public License for more details.
32
33   You should have received a copy of the GNU General Public License
34   along with this program; if not, write to the Free Software Foundation,
35   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
36
37struct filehdr
38{
39	uint16_t f_magic;		/* Magic number.		*/
40	uint16_t f_nscns;		/* Number of sections.		*/
41	uint32_t f_timdat;		/* Time & date stamp.		*/
42	uint32_t f_symptr;		/* File pointer to symtab.	*/
43	uint32_t f_nsyms;		/* Number of symtab entries.	*/
44	uint16_t f_opthdr;		/* Sizeof(optional hdr).	*/
45	uint16_t f_flags;		/* Flags.			*/
46};
47
48/* Machine numbers (for the f_magic field).  */
49#define IMAGE_FILE_MACHINE_ARM               0x01c0
50#define IMAGE_FILE_MACHINE_I386              0x014c
51#define IMAGE_FILE_MACHINE_AMD64             0x8664
52
53/* NT specific file attributes (for the f_flags field).  */
54#define IMAGE_FILE_EXECUTABLE_IMAGE          0x0002
55#define IMAGE_FILE_LINE_NUMS_STRIPPED        0x0004
56#define IMAGE_FILE_LOCAL_SYMS_STRIPPED       0x0008
57#define IMAGE_FILE_32BIT_MACHINE             0x0100
58#define IMAGE_FILE_DEBUG_STRIPPED            0x0200
59
60#endif /* _COFF_FILEHDR_H */
61