flat.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  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 _UAPI_LINUX_FLAT_H
  11. #define _UAPI_LINUX_FLAT_H
  12. #define FLAT_VERSION 0x00000004L
  13. #ifdef CONFIG_BINFMT_SHARED_FLAT
  14. #define MAX_SHARED_LIBS (4)
  15. #else
  16. #define MAX_SHARED_LIBS (1)
  17. #endif
  18. /*
  19. * To make everything easier to port and manage cross platform
  20. * development, all fields are in network byte order.
  21. */
  22. struct flat_hdr {
  23. char magic[4];
  24. unsigned long rev; /* version (as above) */
  25. unsigned long entry; /* Offset of first executable instruction
  26. with text segment from beginning of file */
  27. unsigned long data_start; /* Offset of data segment from beginning of
  28. file */
  29. unsigned long data_end; /* Offset of end of data segment
  30. from beginning of file */
  31. unsigned long bss_end; /* Offset of end of bss segment from beginning
  32. of file */
  33. /* (It is assumed that data_end through bss_end forms the bss segment.) */
  34. unsigned long stack_size; /* Size of stack, in bytes */
  35. unsigned long reloc_start; /* Offset of relocation records from
  36. beginning of file */
  37. unsigned long reloc_count; /* Number of relocation records */
  38. unsigned long flags;
  39. unsigned long build_date; /* When the program/library was built */
  40. unsigned long filler[5]; /* Reservered, set to zero */
  41. };
  42. #define FLAT_FLAG_RAM 0x0001 /* load program entirely into RAM */
  43. #define FLAT_FLAG_GOTPIC 0x0002 /* program is PIC with GOT */
  44. #define FLAT_FLAG_GZIP 0x0004 /* all but the header is compressed */
  45. #define FLAT_FLAG_GZDATA 0x0008 /* only data/relocs are compressed (for XIP) */
  46. #define FLAT_FLAG_KTRACE 0x0010 /* output useful kernel trace for debugging */
  47. #endif /* _UAPI_LINUX_FLAT_H */