a.out.h 1.9 KB

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