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>
22 #define FLAT_VERSION 0x00000004L
24 #ifdef CONFIG_BINFMT_SHARED_FLAT
25 #define MAX_SHARED_LIBS (4)
27 #define MAX_SHARED_LIBS (1)
31 * To make everything easier to port and manage cross platform
32 * development, all fields are in network byte order.
37 uint32_t rev; /* version (as above) */
38 uint32_t entry; /* Offset of first executable instruction
39 with text segment from beginning of file */
40 uint32_t data_start; /* Offset of data segment from beginning of
42 uint32_t data_end; /* Offset of end of data segment from beginning
44 uint32_t bss_end; /* Offset of end of bss segment from beginning
47 /* (It is assumed that data_end through bss_end forms the bss segment.) */
49 uint32_t stack_size; /* Size of stack, in bytes */
50 uint32_t reloc_start; /* Offset of relocation records from beginning
52 uint32_t reloc_count; /* Number of relocation records */
54 uint32_t build_date; /* When the program/library was built */
55 uint32_t filler[5]; /* Reservered, set to zero */
58 #define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
59 #define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
60 #define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
61 #define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
62 #define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
63 #define FLAT_FLAG_L1STK 0x0020 /* use a 4k stack in L1 scratch memory. */
65 #ifdef __KERNEL__ /* so systems without linux headers can compile the apps */
67 * While it would be nice to keep this header clean, users of older
68 * tools still need this support in the kernel. So this section is
69 * purely for compatibility with old tool chains.
71 * DO NOT make changes or enhancements to the old format please, just work
72 * with the format above, except to fix bugs with old format support.
75 #include <asm/byteorder.h>
77 #define OLD_FLAT_VERSION 0x00000002L
78 #define OLD_FLAT_RELOC_TYPE_TEXT 0
79 #define OLD_FLAT_RELOC_TYPE_DATA 1
80 #define OLD_FLAT_RELOC_TYPE_BSS 2
85 # if defined(mc68000) && !defined(CONFIG_COLDFIRE)
88 # define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
89 # elif defined(__BIG_ENDIAN_BITFIELD)
92 # define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
93 # elif defined(__LITTLE_ENDIAN_BITFIELD)
96 # define OLD_FLAT_FLAG_RAM 0x1 /* load program entirely into RAM */
98 # error "Unknown bitfield order for flat files."
103 #endif /* __KERNEL__ */
105 #endif /* _LINUX_FLAT_H */
107 /* this __MUST__ be at the VERY end of the file - do NOT move!!
112 * vi: tabstop=8 shiftwidth=4 textwidth=79 noexpandtab