1 /* $NetBSD: elf_machdep.h,v 1.9 2006/03/14 21:37:48 cube Exp $ */
3 #define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
4 #define ELF32_MACHDEP_ID_CASES \
9 #define ELF64_MACHDEP_ENDIANNESS ELFDATA2MSB
10 #define ELF64_MACHDEP_ID_CASES \
11 case EM_SPARC32PLUS: \
15 #define ELF32_MACHDEP_ID EM_SPARC
16 #define ELF64_MACHDEP_ID EM_SPARCV9
19 #define ARCH_ELFSIZE 64 /* MD native binary size */
21 #define ARCH_ELFSIZE 32 /* MD native binary size */
24 /* The following are what is used for AT_SUN_HWCAP: */
25 #define AV_SPARC_HWMUL_32x32 1 /* 32x32-bit smul/umul is efficient */
26 #define AV_SPARC_HWDIV_32x32 2 /* 32x32-bit sdiv/udiv is efficient */
27 #define AV_SPARC_HWFSMULD 4 /* fsmuld is efficient */
30 * Here are some SPARC specific flags I can't
31 * find a better home for. They are used for AT_FLAGS
32 * and in the exec header.
34 #define EF_SPARCV9_MM 0x3
35 #define EF_SPARCV9_TSO 0x0
36 #define EF_SPARCV9_PSO 0x1
37 #define EF_SPARCV9_RMO 0x2
39 #define EF_SPARC_32PLUS_MASK 0xffff00 /* bits indicating V8+ type */
40 #define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */
41 #define EF_SPARC_EXT_MASK 0xffff00 /* bits for vendor extensions */
42 #define EF_SPARC_SUN_US1 0x000200 /* UltraSPARC 1 extensions */
43 #define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */
44 #define EF_SPARC_SUN_US3 0x000800 /* UltraSPARC 3 extensions */
46 /* Relocation types */
47 #define R_SPARC_NONE 0
51 #define R_SPARC_DISP8 4
52 #define R_SPARC_DISP16 5
53 #define R_SPARC_DISP32 6
54 #define R_SPARC_WDISP30 7
55 #define R_SPARC_WDISP22 8
56 #define R_SPARC_HI22 9
59 #define R_SPARC_LO10 12
60 #define R_SPARC_GOT10 13
61 #define R_SPARC_GOT13 14
62 #define R_SPARC_GOT22 15
63 #define R_SPARC_PC10 16
64 #define R_SPARC_PC22 17
65 #define R_SPARC_WPLT30 18
66 #define R_SPARC_COPY 19
67 #define R_SPARC_GLOB_DAT 20
68 #define R_SPARC_JMP_SLOT 21
69 #define R_SPARC_RELATIVE 22
70 #define R_SPARC_UA32 23
71 #define R_SPARC_PLT32 24
72 #define R_SPARC_HIPLT22 25
73 #define R_SPARC_LOPLT10 26
74 #define R_SPARC_PCPLT32 27
75 #define R_SPARC_PCPLT22 28
76 #define R_SPARC_PCPLT10 29
80 #define R_SPARC_OLO10 33
81 #define R_SPARC_HH22 34
82 #define R_SPARC_HM10 35
83 #define R_SPARC_LM22 36
84 #define R_SPARC_PC_HH22 37
85 #define R_SPARC_PC_HM10 38
86 #define R_SPARC_PC_LM22 39
87 #define R_SPARC_WDISP16 40
88 #define R_SPARC_WDISP19 41
89 #define R_SPARC_GLOB_JMP 42
93 #define R_SPARC_DISP64 46
94 #define R_SPARC_PLT64 47
95 #define R_SPARC_HIX22 48
96 #define R_SPARC_LOX10 49
97 #define R_SPARC_H44 50
98 #define R_SPARC_M44 51
99 #define R_SPARC_L44 52
100 #define R_SPARC_REGISTER 53
101 #define R_SPARC_UA64 54
102 #define R_SPARC_UA16 55
104 /* TLS relocations */
105 #define R_SPARC_TLS_GD_HI22 56
106 #define R_SPARC_TLS_GD_LO10 57
107 #define R_SPARC_TLS_GD_ADD 58
108 #define R_SPARC_TLS_GD_CALL 59
109 #define R_SPARC_TLS_LDM_HI22 60
110 #define R_SPARC_TLS_LDM_LO10 61
111 #define R_SPARC_TLS_LDM_ADD 62
112 #define R_SPARC_TLS_LDM_CALL 63
113 #define R_SPARC_TLS_LDO_HIX22 64
114 #define R_SPARC_TLS_LDO_LOX10 65
115 #define R_SPARC_TLS_LDO_ADD 66
116 #define R_SPARC_TLS_IE_HI22 67
117 #define R_SPARC_TLS_IE_LO10 68
118 #define R_SPARC_TLS_IE_LD 69
119 #define R_SPARC_TLS_IE_LDX 70
120 #define R_SPARC_TLS_IE_ADD 71
121 #define R_SPARC_TLS_LE_HIX22 72
122 #define R_SPARC_TLS_LE_LOX10 73
123 #define R_SPARC_TLS_DTPMOD32 74
124 #define R_SPARC_TLS_DTPMOD64 75
125 #define R_SPARC_TLS_DTPOFF32 76
126 #define R_SPARC_TLS_DTPOFF64 77
127 #define R_SPARC_TLS_TPOFF32 78
128 #define R_SPARC_TLS_TPOFF64 79
130 #define R_TYPE(name) __CONCAT(R_SPARC_,name)