2 * Copyright (C) 2002-2005 David McCullough <davidm@snapgear.com>
3 * Copyright (C) 1998 Kenneth Albanowski <kjahds@kjahds.com>
4 * The Silver Hammer Group, Ltd.
6 * This file provides the definitions and structures needed to
7 * support uClinux flat-format executables.
9 * This is Free Software, under the GNU Public Licence v2 or greater.
17 #include <linux/types.h>
21 #define FLAT_VERSION 0x00000004L
23 #ifdef CONFIG_BINFMT_SHARED_FLAT
24 #define MAX_SHARED_LIBS (4)
26 #define MAX_SHARED_LIBS (1)
30 * To make everything easier to port and manage cross platform
31 * development, all fields are in network byte order.
36 uint32_t rev; /* version (as above) */
37 uint32_t entry; /* Offset of first executable instruction
38 with text segment from beginning of file */
39 uint32_t data_start; /* Offset of data segment from beginning of
41 uint32_t data_end; /* Offset of end of data segment from beginning
43 uint32_t bss_end; /* Offset of end of bss segment from beginning
46 /* (It is assumed that data_end through bss_end forms the bss segment.) */
48 uint32_t stack_size; /* Size of stack, in bytes */
49 uint32_t reloc_start; /* Offset of relocation records from beginning
51 uint32_t reloc_count; /* Number of relocation records */
53 uint32_t build_date; /* When the program/library was built */
54 uint32_t filler[5]; /* Reservered, set to zero */
57 #define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
58 #define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
59 #define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
60 #define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
61 #define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
62 #define FLAT_FLAG_L1STK 0x0020 /* use a 4k stack in L1 scratch memory. */
64 #ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
66 * While it would be nice to keep this header clean, users of older
67 * tools still need this support in the kernel. So this section is
68 * purely for compatibility with old tool chains.
70 * DO NOT make changes or enhancements to the old format please, just work
71 * with the format above, except to fix bugs with old format support.
74 #include <asm/byteorder.h>
76 #define OLD_FLAT_VERSION 0x00000002L
77 #define OLD_FLAT_RELOC_TYPE_TEXT 0
78 #define OLD_FLAT_RELOC_TYPE_DATA 1
79 #define OLD_FLAT_RELOC_TYPE_BSS 2
84 # if defined(mc68000) && !defined(CONFIG_COLDFIRE)
87 # define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
88 # elif defined(__BIG_ENDIAN_BITFIELD)
91 # define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
92 # elif defined(__LITTLE_ENDIAN_BITFIELD)
95 # define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
97 # error "Unknown bitfield order for flat files."
102 #endif /* __KERNEL__ */
104 #endif /* _LINUX_FLAT_H */
106 /* this __MUST__ be at the VERY end of the file - do NOT move!!
111 * vi: tabstop=8 shiftwidth=4 textwidth=79 noexpandtab