]> git.proxmox.com Git - qemu.git/blame - linux-user/flat.h
find -type f | xargs sed -i 's/[\t ]$//g' # on most files
[qemu.git] / linux-user / flat.h
CommitLineData
e5fe0c52
PB
1/*
2 * Copyright (C) 2002-2003 David McCullough <davidm@snapgear.com>
3 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
4 * The Silver Hammer Group, Ltd.
5 *
6 * This file provides the definitions and structures needed to
7 * support uClinux flat-format executables.
8 */
9
10#define FLAT_VERSION 0x00000004L
11
12#ifdef CONFIG_BINFMT_SHARED_FLAT
13#define MAX_SHARED_LIBS (4)
14#else
15#define MAX_SHARED_LIBS (1)
16#endif
17
18/*
19 * To make everything easier to port and manage cross platform
20 * development, all fields are in network byte order.
21 */
22
23struct flat_hdr {
24 char magic[4];
223b8a40
PB
25 target_ulong rev; /* version (as above) */
26 target_ulong entry; /* Offset of first executable instruction
e5fe0c52 27 with text segment from beginning of file */
223b8a40 28 target_ulong data_start; /* Offset of data segment from beginning of
e5fe0c52 29 file */
223b8a40 30 target_ulong data_end; /* Offset of end of data segment
e5fe0c52 31 from beginning of file */
223b8a40 32 target_ulong bss_end; /* Offset of end of bss segment from beginning
e5fe0c52
PB
33 of file */
34
35 /* (It is assumed that data_end through bss_end forms the bss segment.) */
36
223b8a40
PB
37 target_ulong stack_size; /* Size of stack, in bytes */
38 target_ulong reloc_start; /* Offset of relocation records from
e5fe0c52 39 beginning of file */
223b8a40 40 target_ulong reloc_count; /* Number of relocation records */
5fafdf24 41 target_ulong flags;
223b8a40
PB
42 target_ulong build_date; /* When the program/library was built */
43 target_ulong filler[5]; /* Reservered, set to zero */
e5fe0c52
PB
44};
45
46#define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
47#define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
48#define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
49#define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
50#define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
51
52
53/*
54 * While it would be nice to keep this header clean, users of older
55 * tools still need this support in the kernel. So this section is
56 * purely for compatibility with old tool chains.
57 *
58 * DO NOT make changes or enhancements to the old format please, just work
59 * with the format above, except to fix bugs with old format support.
60 */
61
62#define OLD_FLAT_VERSION 0x00000002L
63#define OLD_FLAT_RELOC_TYPE_TEXT 0
64#define OLD_FLAT_RELOC_TYPE_DATA 1
65#define OLD_FLAT_RELOC_TYPE_BSS 2
66
67# define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */