elf.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #ifndef __ASMH8300_ELF_H
  2. #define __ASMH8300_ELF_H
  3. /*
  4. * ELF register definitions..
  5. */
  6. #include <linux/config.h>
  7. #include <asm/ptrace.h>
  8. #include <asm/user.h>
  9. typedef unsigned long elf_greg_t;
  10. #define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
  11. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  12. typedef unsigned long elf_fpregset_t;
  13. /*
  14. * This is used to ensure we don't load something for the wrong architecture.
  15. */
  16. #define elf_check_arch(x) ((x)->e_machine == EM_H8_300)
  17. /*
  18. * These are used to set parameters in the core dumps.
  19. */
  20. #define ELF_CLASS ELFCLASS32
  21. #define ELF_DATA ELFDATA2MSB
  22. #define ELF_ARCH EM_H8_300
  23. #if defined(__H8300H__)
  24. #define ELF_FLAGS 0x810000
  25. #endif
  26. #if defined(__H8300S__)
  27. #define ELF_FLAGS 0x820000
  28. #endif
  29. #define ELF_PLAT_INIT(_r) _r->er1 = 0
  30. #define USE_ELF_CORE_DUMP
  31. #define ELF_EXEC_PAGESIZE 4096
  32. /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
  33. use of this is to invoke "./ld.so someprog" to test out a new version of
  34. the loader. We need to make sure that it is out of the way of the program
  35. that it will "exec", and that there is sufficient room for the brk. */
  36. #define ELF_ET_DYN_BASE 0xD0000000UL
  37. /* This yields a mask that user programs can use to figure out what
  38. instruction set this cpu supports. */
  39. #define ELF_HWCAP (0)
  40. /* This yields a string that ld.so will use to load implementation
  41. specific libraries for optimization. This is more specific in
  42. intent than poking at uname or /proc/cpuinfo. */
  43. #define ELF_PLATFORM (NULL)
  44. #ifdef __KERNEL__
  45. #define SET_PERSONALITY(ex, ibcs2) set_personality(PER_LINUX)
  46. #endif
  47. #define R_H8_NONE 0
  48. #define R_H8_DIR32 1
  49. #define R_H8_DIR32_28 2
  50. #define R_H8_DIR32_24 3
  51. #define R_H8_DIR32_16 4
  52. #define R_H8_DIR32U 6
  53. #define R_H8_DIR32U_28 7
  54. #define R_H8_DIR32U_24 8
  55. #define R_H8_DIR32U_20 9
  56. #define R_H8_DIR32U_16 10
  57. #define R_H8_DIR24 11
  58. #define R_H8_DIR24_20 12
  59. #define R_H8_DIR24_16 13
  60. #define R_H8_DIR24U 14
  61. #define R_H8_DIR24U_20 15
  62. #define R_H8_DIR24U_16 16
  63. #define R_H8_DIR16 17
  64. #define R_H8_DIR16U 18
  65. #define R_H8_DIR16S_32 19
  66. #define R_H8_DIR16S_28 20
  67. #define R_H8_DIR16S_24 21
  68. #define R_H8_DIR16S_20 22
  69. #define R_H8_DIR16S 23
  70. #define R_H8_DIR8 24
  71. #define R_H8_DIR8U 25
  72. #define R_H8_DIR8Z_32 26
  73. #define R_H8_DIR8Z_28 27
  74. #define R_H8_DIR8Z_24 28
  75. #define R_H8_DIR8Z_20 29
  76. #define R_H8_DIR8Z_16 30
  77. #define R_H8_PCREL16 31
  78. #define R_H8_PCREL8 32
  79. #define R_H8_BPOS 33
  80. #define R_H8_PCREL32 34
  81. #define R_H8_GOT32O 35
  82. #define R_H8_GOT16O 36
  83. #define R_H8_DIR16A8 59
  84. #define R_H8_DIR16R8 60
  85. #define R_H8_DIR24A8 61
  86. #define R_H8_DIR24R8 62
  87. #define R_H8_DIR32A16 63
  88. #define R_H8_ABS32 65
  89. #define R_H8_ABS32A16 127
  90. #endif