~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/flat.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright (C) 2002-2003  David McCullough <davidm@snapgear.com>
  4  * Copyright (C) 1998       Kenneth Albanowski <kjahds@kjahds.com>
  5  *                          The Silver Hammer Group, Ltd.
  6  *
  7  * This file provides the definitions and structures needed to
  8  * support uClinux flat-format executables.
  9  */
 10 #ifndef _LINUX_FLAT_H
 11 #define _LINUX_FLAT_H
 12 
 13 #define FLAT_VERSION                    0x00000004L
 14 
 15 /*
 16  * To make everything easier to port and manage cross platform
 17  * development,  all fields are in network byte order.
 18  */
 19 
 20 struct flat_hdr {
 21         char    magic[4];
 22         __be32  rev;          /* version (as above) */
 23         __be32  entry;        /* Offset of first executable instruction
 24                                  with text segment from beginning of file */
 25         __be32  data_start;   /* Offset of data segment from beginning of
 26                                  file */
 27         __be32  data_end;     /* Offset of end of data segment from beginning
 28                                  of file */
 29         __be32  bss_end;      /* Offset of end of bss segment from beginning
 30                                  of file */
 31 
 32         /* (It is assumed that data_end through bss_end forms the bss segment.) */
 33 
 34         __be32  stack_size;   /* Size of stack, in bytes */
 35         __be32  reloc_start;  /* Offset of relocation records from beginning of
 36                                  file */
 37         __be32  reloc_count;  /* Number of relocation records */
 38         __be32  flags;
 39         __be32  build_date;   /* When the program/library was built */
 40         __u32   filler[5];    /* Reservered, set to zero */
 41 };
 42 
 43 #define FLAT_FLAG_RAM    0x0001 /* load program entirely into RAM */
 44 #define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
 45 #define FLAT_FLAG_GZIP   0x0004 /* all but the header is compressed */
 46 #define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
 47 #define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
 48 
 49 /*
 50  * While it would be nice to keep this header clean,  users of older
 51  * tools still need this support in the kernel.  So this section is
 52  * purely for compatibility with old tool chains.
 53  *
 54  * DO NOT make changes or enhancements to the old format please,  just work
 55  *        with the format above,  except to fix bugs with old format support.
 56  */
 57 
 58 #define OLD_FLAT_VERSION                        0x00000002L
 59 #define OLD_FLAT_RELOC_TYPE_TEXT        0
 60 #define OLD_FLAT_RELOC_TYPE_DATA        1
 61 #define OLD_FLAT_RELOC_TYPE_BSS         2
 62 
 63 typedef union {
 64         u32             value;
 65         struct {
 66 #if defined(__LITTLE_ENDIAN_BITFIELD) || \
 67     (defined(mc68000) && !defined(CONFIG_COLDFIRE))
 68                 s32     offset : 30;
 69                 u32     type : 2;
 70 # elif defined(__BIG_ENDIAN_BITFIELD)
 71                 u32     type : 2;
 72                 s32     offset : 30;
 73 # else
 74 #       error "Unknown bitfield order for flat files."
 75 # endif
 76         } reloc;
 77 } flat_v2_reloc_t;
 78 
 79 #endif /* _LINUX_FLAT_H */
 80 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php