xref: /netbsd-src/sys/arch/arm/include/elf_machdep.h (revision aaf4ece63a859a04e37cf3a7229b5fab0157cc06)
1 /*	$NetBSD: elf_machdep.h,v 1.6 2005/12/11 12:16:47 christos Exp $	*/
2 
3 #if defined(__ARMEB__)
4 #define ELF32_MACHDEP_ENDIANNESS	ELFDATA2MSB
5 #else
6 #define ELF32_MACHDEP_ENDIANNESS	ELFDATA2LSB
7 #endif
8 
9 /* Processor specific flags for the ELF header e_flags field.  */
10 #define EF_ARM_RELEXEC		0x00000001
11 #define EF_ARM_HASENTRY		0x00000002
12 #define EF_ARM_INTERWORK	0x00000004 /* GNU binutils 000413 */
13 #define EF_ARM_SYMSARESORTED	0x00000004 /* ARM ELF A08 */
14 #define EF_ARM_APCS_26		0x00000008 /* GNU binutils 000413 */
15 #define EF_ARM_DYNSYMSUSESEGIDX	0x00000008 /* ARM ELF B01 */
16 #define EF_ARM_APCS_FLOAT	0x00000010 /* GNU binutils 000413 */
17 #define EF_ARM_MAPSYMSFIRST	0x00000010 /* ARM ELF B01 */
18 #define EF_ARM_PIC		0x00000020
19 #define EF_ARM_ALIGN8		0x00000040 /* 8-bit structure alignment.  */
20 #define EF_ARM_NEW_ABI		0x00000080
21 #define EF_ARM_OLD_ABI		0x00000100
22 #define EF_ARM_SOFT_FLOAT	0x00000200
23 #define EF_ARM_EABIMASK		0xff000000
24 
25 #define	ELF32_MACHDEP_ID_CASES						\
26 		case EM_ARM:						\
27 			break;
28 
29 #define	ELF32_MACHDEP_ID	EM_ARM
30 
31 #define ARCH_ELFSIZE		32	/* MD native binary size */
32 
33 /* Processor specific relocation types */
34 
35 #define R_ARM_NONE		0
36 #define R_ARM_PC24		1
37 #define R_ARM_ABS32		2
38 #define R_ARM_REL32		3
39 #define R_ARM_PC13		4
40 #define R_ARM_ABS16		5
41 #define R_ARM_ABS12		6
42 #define R_ARM_THM_ABS5		7
43 #define R_ARM_ABS8		8
44 #define R_ARM_SBREL32		9
45 #define R_ARM_THM_PC22		10
46 #define R_ARM_THM_PC8		11
47 #define R_ARM_AMP_VCALL9	12
48 #define R_ARM_SWI24		13
49 #define R_ARM_THM_SWI8		14
50 #define R_ARM_XPC25		15
51 #define R_ARM_THM_XPC22		16
52 
53 /* 17-31 are reserved for ARM Linux. */
54 #define R_ARM_COPY		20
55 #define R_ARM_GLOB_DAT		21
56 #define	R_ARM_JUMP_SLOT		22
57 #define R_ARM_RELATIVE		23
58 #define	R_ARM_GOTOFF		24
59 #define R_ARM_GOTPC		25
60 #define R_ARM_GOT32		26
61 #define R_ARM_PLT32		27
62 
63 #define R_ARM_ALU_PCREL_7_0	32
64 #define R_ARM_ALU_PCREL_15_8	33
65 #define R_ARM_ALU_PCREL_23_15	34
66 #define R_ARM_ALU_SBREL_11_0	35
67 #define R_ARM_ALU_SBREL_19_12	36
68 #define R_ARM_ALU_SBREL_27_20	37
69 
70 /* 96-111 are reserved to G++. */
71 #define R_ARM_GNU_VTENTRY	100
72 #define R_ARM_GNU_VTINHERIT	101
73 #define R_ARM_THM_PC11		102
74 #define R_ARM_THM_PC9		103
75 
76 /* 112-127 are reserved for private experiments. */
77 
78 #define R_ARM_RXPC25		249
79 #define R_ARM_RSBREL32		250
80 #define R_ARM_THM_RPC22		251
81 #define R_ARM_RREL32		252
82 #define R_ARM_RABS32		253
83 #define R_ARM_RPC24		254
84 #define R_ARM_RBASE		255
85 
86 #define R_TYPE(name)		__CONCAT(R_ARM_,name)
87 
88 /* Processor specific program header flags */
89 #define PF_ARM_SB		0x10000000
90 #define PF_ARM_PI		0x20000000
91 #define PF_ARM_ENTRY		0x80000000
92 
93 /* Processor specific section header flags */
94 #define SHF_ENTRYSECT		0x10000000
95 #define SHF_COMDEF		0x80000000
96 
97 /* Processor specific symbol types */
98 #define STT_ARM_TFUNC		STT_LOPROC
99