elf.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #ifndef _ASM_M32R__ELF_H
  2. #define _ASM_M32R__ELF_H
  3. /*
  4. * ELF-specific definitions.
  5. *
  6. * Copyright (C) 1999-2004, Renesas Technology Corp.
  7. * Hirokazu Takata <takata at linux-m32r.org>
  8. */
  9. #include <asm/ptrace.h>
  10. #include <asm/user.h>
  11. #include <asm/page.h>
  12. /* M32R relocation types */
  13. #define R_M32R_NONE 0
  14. #define R_M32R_16 1
  15. #define R_M32R_32 2
  16. #define R_M32R_24 3
  17. #define R_M32R_10_PCREL 4
  18. #define R_M32R_18_PCREL 5
  19. #define R_M32R_26_PCREL 6
  20. #define R_M32R_HI16_ULO 7
  21. #define R_M32R_HI16_SLO 8
  22. #define R_M32R_LO16 9
  23. #define R_M32R_SDA16 10
  24. #define R_M32R_GNU_VTINHERIT 11
  25. #define R_M32R_GNU_VTENTRY 12
  26. #define R_M32R_16_RELA 33
  27. #define R_M32R_32_RELA 34
  28. #define R_M32R_24_RELA 35
  29. #define R_M32R_10_PCREL_RELA 36
  30. #define R_M32R_18_PCREL_RELA 37
  31. #define R_M32R_26_PCREL_RELA 38
  32. #define R_M32R_HI16_ULO_RELA 39
  33. #define R_M32R_HI16_SLO_RELA 40
  34. #define R_M32R_LO16_RELA 41
  35. #define R_M32R_SDA16_RELA 42
  36. #define R_M32R_RELA_GNU_VTINHERIT 43
  37. #define R_M32R_RELA_GNU_VTENTRY 44
  38. #define R_M32R_GOT24 48
  39. #define R_M32R_26_PLTREL 49
  40. #define R_M32R_COPY 50
  41. #define R_M32R_GLOB_DAT 51
  42. #define R_M32R_JMP_SLOT 52
  43. #define R_M32R_RELATIVE 53
  44. #define R_M32R_GOTOFF 54
  45. #define R_M32R_GOTPC24 55
  46. #define R_M32R_GOT16_HI_ULO 56
  47. #define R_M32R_GOT16_HI_SLO 57
  48. #define R_M32R_GOT16_LO 58
  49. #define R_M32R_GOTPC_HI_ULO 59
  50. #define R_M32R_GOTPC_HI_SLO 60
  51. #define R_M32R_GOTPC_LO 61
  52. #define R_M32R_GOTOFF_HI_ULO 62
  53. #define R_M32R_GOTOFF_HI_SLO 63
  54. #define R_M32R_GOTOFF_LO 64
  55. #define R_M32R_NUM 256
  56. /*
  57. * ELF register definitions..
  58. */
  59. #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
  60. typedef unsigned long elf_greg_t;
  61. typedef elf_greg_t elf_gregset_t[ELF_NGREG];
  62. /* We have no FP mumumu. */
  63. typedef double elf_fpreg_t;
  64. typedef elf_fpreg_t elf_fpregset_t;
  65. /*
  66. * This is used to ensure we don't load something for the wrong architecture.
  67. */
  68. #define elf_check_arch(x) \
  69. (((x)->e_machine == EM_M32R) || ((x)->e_machine == EM_CYGNUS_M32R))
  70. /*
  71. * These are used to set parameters in the core dumps.
  72. */
  73. #define ELF_CLASS ELFCLASS32
  74. #if defined(__LITTLE_ENDIAN__)
  75. #define ELF_DATA ELFDATA2LSB
  76. #elif defined(__BIG_ENDIAN__)
  77. #define ELF_DATA ELFDATA2MSB
  78. #else
  79. #error no endian defined
  80. #endif
  81. #define ELF_ARCH EM_M32R
  82. /* r0 is set by ld.so to a pointer to a function which might be
  83. * registered using 'atexit'. This provides a mean for the dynamic
  84. * linker to call DT_FINI functions for shared libraries that have
  85. * been loaded before the code runs.
  86. *
  87. * So that we can use the same startup file with static executables,
  88. * we start programs with a value of 0 to indicate that there is no
  89. * such function.
  90. */
  91. #define ELF_PLAT_INIT(_r, load_addr) (_r)->r0 = 0
  92. #define ELF_EXEC_PAGESIZE PAGE_SIZE
  93. /*
  94. * This is the location that an ET_DYN program is loaded if exec'ed.
  95. * Typical use of this is to invoke "./ld.so someprog" to test out a
  96. * new version of the loader. We need to make sure that it is out of
  97. * the way of the program that it will "exec", and that there is
  98. * sufficient room for the brk.
  99. */
  100. #define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
  101. /* regs is struct pt_regs, pr_reg is elf_gregset_t (which is
  102. now struct_user_regs, they are different) */
  103. #define ELF_CORE_COPY_REGS(pr_reg, regs) \
  104. memcpy((char *)pr_reg, (char *)regs, sizeof (struct pt_regs));
  105. /* This yields a mask that user programs can use to figure out what
  106. instruction set this CPU supports. */
  107. #define ELF_HWCAP (0)
  108. /* This yields a string that ld.so will use to load implementation
  109. specific libraries for optimization. This is more specific in
  110. intent than poking at uname or /proc/cpuinfo. */
  111. #define ELF_PLATFORM (NULL)
  112. #endif /* _ASM_M32R__ELF_H */