elf.h 2.6 KB

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