elf.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #ifndef _ASM_SCORE_ELF_H
  2. #define _ASM_SCORE_ELF_H
  3. /* ELF register definitions */
  4. #define ELF_NGREG 45
  5. #define ELF_NFPREG 33
  6. #define EM_SCORE7 135
  7. /* Relocation types. */
  8. #define R_SCORE_NONE 0
  9. #define R_SCORE_HI16 1
  10. #define R_SCORE_LO16 2
  11. #define R_SCORE_BCMP 3
  12. #define R_SCORE_24 4
  13. #define R_SCORE_PC19 5
  14. #define R_SCORE16_11 6
  15. #define R_SCORE16_PC8 7
  16. #define R_SCORE_ABS32 8
  17. #define R_SCORE_ABS16 9
  18. #define R_SCORE_DUMMY2 10
  19. #define R_SCORE_GP15 11
  20. #define R_SCORE_GNU_VTINHERIT 12
  21. #define R_SCORE_GNU_VTENTRY 13
  22. #define R_SCORE_GOT15 14
  23. #define R_SCORE_GOT_LO16 15
  24. #define R_SCORE_CALL15 16
  25. #define R_SCORE_GPREL32 17
  26. #define R_SCORE_REL32 18
  27. #define R_SCORE_DUMMY_HI16 19
  28. #define R_SCORE_IMM30 20
  29. #define R_SCORE_IMM32 21
  30. typedef unsigned long elf_greg_t;
  31. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  32. typedef double elf_fpreg_t;
  33. typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
  34. #define elf_check_arch(x) ((x)->e_machine == EM_SCORE7)
  35. /*
  36. * These are used to set parameters in the core dumps.
  37. */
  38. #define ELF_CLASS ELFCLASS32
  39. /*
  40. * These are used to set parameters in the core dumps.
  41. */
  42. #define ELF_DATA ELFDATA2LSB
  43. #define ELF_ARCH EM_SCORE7
  44. #define SET_PERSONALITY(ex) \
  45. do { \
  46. set_personality(PER_LINUX); \
  47. } while (0)
  48. struct task_struct;
  49. struct pt_regs;
  50. #define USE_ELF_CORE_DUMP
  51. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  52. /* This yields a mask that user programs can use to figure out what
  53. instruction set this cpu supports. This could be done in userspace,
  54. but it's not easy, and we've already done it here. */
  55. #define ELF_HWCAP (0)
  56. /* This yields a string that ld.so will use to load implementation
  57. specific libraries for optimization. This is more specific in
  58. intent than poking at uname or /proc/cpuinfo.
  59. For the moment, we have only optimizations for the Intel generations,
  60. but that could change... */
  61. #define ELF_PLATFORM (NULL)
  62. #define ELF_PLAT_INIT(_r, load_addr) \
  63. do { \
  64. _r->regs[1] = _r->regs[2] = _r->regs[3] = _r->regs[4] = 0; \
  65. _r->regs[5] = _r->regs[6] = _r->regs[7] = _r->regs[8] = 0; \
  66. _r->regs[9] = _r->regs[10] = _r->regs[11] = _r->regs[12] = 0; \
  67. _r->regs[13] = _r->regs[14] = _r->regs[15] = _r->regs[16] = 0; \
  68. _r->regs[17] = _r->regs[18] = _r->regs[19] = _r->regs[20] = 0; \
  69. _r->regs[21] = _r->regs[22] = _r->regs[23] = _r->regs[24] = 0; \
  70. _r->regs[25] = _r->regs[26] = _r->regs[27] = _r->regs[28] = 0; \
  71. _r->regs[30] = _r->regs[31] = 0; \
  72. } while (0)
  73. /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
  74. use of this is to invoke "./ld.so someprog" to test out a new version of
  75. the loader. We need to make sure that it is out of the way of the program
  76. that it will "exec", and that there is sufficient room for the brk. */
  77. #ifndef ELF_ET_DYN_BASE
  78. #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
  79. #endif
  80. #endif /* _ASM_SCORE_ELF_H */