You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef COFF_H
  2. #define COFF_H
  3. /* Based on the elf.h file
  4. * Changed accordingly to support COFF file support
  5. */
  6. /* Values for f_flags. */
  7. #define F_RELFLG 0x0001 /* If set, not reloc. info. Clear for executables */
  8. #define F_EXEC 0x0002 /* No unresolved symbols. Executable file ! */
  9. #define F_LNNO 0x0004 /* If set, line information numbers removed */
  10. #define F_LSYMS 0x0008 /* If set, local symbols removed */
  11. #define F_AR32WR 0x0100 /* Indicates little endian file */
  12. /* Values for e_machine (architecute). */
  13. #define EM_E1 0x17a /* Magic number for Hyperstone. Big endian format */
  14. /* Values for f_flags. */
  15. #define O_MAGIC 0x017c /* Optional's header magic number for Hyperstone */
  16. /* Values for s_flags. */
  17. #define S_TYPE_TEXT 0x0020 /* If set, the section contains only executable */
  18. #define S_TYPE_DATA 0x0040 /* If set, the section contains only initialized data */
  19. #define S_TYPE_BSS 0x0080 /* If set, the section is BSS no data stored */
  20. typedef struct
  21. {
  22. unsigned short f_magic; /* magic number */
  23. unsigned short f_nscns; /* number of sections */
  24. unsigned long f_timdat; /* time & date stamp */
  25. unsigned long f_symptr; /* file pointer to symtab */
  26. unsigned long f_nsyms; /* number of symtab entries */
  27. unsigned short f_opthdr; /* sizeof(optional hdr) */
  28. unsigned short f_flags; /* flags */
  29. }
  30. COFF_filehdr;
  31. /*
  32. * Optional header.
  33. */
  34. typedef struct
  35. {
  36. unsigned short magic; /* type of file */
  37. unsigned short vstamp; /* version stamp */
  38. unsigned long tsize; /* text size in bytes, padded to FW bdry*/
  39. unsigned long dsize; /* initialized data " " */
  40. unsigned long bsize; /* uninitialized data " " */
  41. unsigned long entry; /* entry pt. */
  42. unsigned long text_start; /* base of text used for this file */
  43. unsigned long data_start; /* base of data used for this file */
  44. }
  45. COFF_opthdr;
  46. /*
  47. * Section header.
  48. */
  49. typedef struct
  50. {
  51. char s_name[8]; /* section name */
  52. unsigned long s_paddr; /* physical address, aliased s_nlib */
  53. unsigned long s_vaddr; /* virtual address */
  54. unsigned long s_size; /* section size */
  55. unsigned long s_scnptr; /* file ptr to raw data for section */
  56. unsigned long s_relptr; /* file ptr to relocation */
  57. unsigned long s_lnnoptr; /* file ptr to line numbers */
  58. unsigned short s_nreloc; /* number of relocation entries */
  59. unsigned short s_nlnno; /* number of line number entries*/
  60. unsigned long s_flags; /* flags */
  61. }
  62. COFF_scnhdr;
  63. #endif /* COFF_H */