a.out.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _UAPI__ALPHA_A_OUT_H__
  3. #define _UAPI__ALPHA_A_OUT_H__
  4. #include <linux/types.h>
  5. /*
  6. * OSF/1 ECOFF header structs. ECOFF files consist of:
  7. * - a file header (struct filehdr),
  8. * - an a.out header (struct aouthdr),
  9. * - one or more section headers (struct scnhdr).
  10. * The filhdr's "f_nscns" field contains the
  11. * number of section headers.
  12. */
  13. struct filehdr
  14. {
  15. /* OSF/1 "file" header */
  16. __u16 f_magic, f_nscns;
  17. __u32 f_timdat;
  18. __u64 f_symptr;
  19. __u32 f_nsyms;
  20. __u16 f_opthdr, f_flags;
  21. };
  22. struct aouthdr
  23. {
  24. __u64 info; /* after that it looks quite normal.. */
  25. __u64 tsize;
  26. __u64 dsize;
  27. __u64 bsize;
  28. __u64 entry;
  29. __u64 text_start; /* with a few additions that actually make sense */
  30. __u64 data_start;
  31. __u64 bss_start;
  32. __u32 gprmask, fprmask; /* bitmask of general & floating point regs used in binary */
  33. __u64 gpvalue;
  34. };
  35. struct scnhdr
  36. {
  37. char s_name[8];
  38. __u64 s_paddr;
  39. __u64 s_vaddr;
  40. __u64 s_size;
  41. __u64 s_scnptr;
  42. __u64 s_relptr;
  43. __u64 s_lnnoptr;
  44. __u16 s_nreloc;
  45. __u16 s_nlnno;
  46. __u32 s_flags;
  47. };
  48. struct exec
  49. {
  50. /* OSF/1 "file" header */
  51. struct filehdr fh;
  52. struct aouthdr ah;
  53. };
  54. /*
  55. * Define's so that the kernel exec code can access the a.out header
  56. * fields...
  57. */
  58. #define a_info ah.info
  59. #define a_text ah.tsize
  60. #define a_data ah.dsize
  61. #define a_bss ah.bsize
  62. #define a_entry ah.entry
  63. #define a_textstart ah.text_start
  64. #define a_datastart ah.data_start
  65. #define a_bssstart ah.bss_start
  66. #define a_gprmask ah.gprmask
  67. #define a_fprmask ah.fprmask
  68. #define a_gpvalue ah.gpvalue
  69. #define N_TXTADDR(x) ((x).a_textstart)
  70. #define N_DATADDR(x) ((x).a_datastart)
  71. #define N_BSSADDR(x) ((x).a_bssstart)
  72. #define N_DRSIZE(x) 0
  73. #define N_TRSIZE(x) 0
  74. #define N_SYMSIZE(x) 0
  75. #define AOUTHSZ sizeof(struct aouthdr)
  76. #define SCNHSZ sizeof(struct scnhdr)
  77. #define SCNROUND 16
  78. #define N_TXTOFF(x) \
  79. ((long) N_MAGIC(x) == ZMAGIC ? 0 : \
  80. (sizeof(struct exec) + (x).fh.f_nscns*SCNHSZ + SCNROUND - 1) & ~(SCNROUND - 1))
  81. #endif /* _UAPI__ALPHA_A_OUT_H__ */