xref: /netbsd/sys/arch/mips/include/elf_machdep.h (revision bf9ec67e)
1 /*	$NetBSD: elf_machdep.h,v 1.8 2001/12/09 23:05:58 thorpej Exp $	*/
2 
3 #define	ELF32_MACHDEP_ID_CASES						\
4 		case EM_MIPS:						\
5 			break;
6 
7 #define	ELF64_MACHDEP_ID_CASES						\
8 		/* no 64-bit ELF machine types supported */
9 
10 
11 #define	ELF32_MACHDEP_ID	EM_MIPS
12 #define	ELF64_MACHDEP_ID	EM_MIPS
13 
14 #define ARCH_ELFSIZE		32	/* MD native binary size */
15 
16 /* mips relocs.  */
17 
18 #define R_MIPS_NONE		0
19 #define R_MIPS_16		1
20 #define R_MIPS_32		2
21 #define R_MIPS_REL32		3
22 #define R_MIPS_REL		R_MIPS_REL32
23 #define R_MIPS_26		4
24 #define R_MIPS_HI16		5	/* high 16 bits of symbol value */
25 #define R_MIPS_LO16		6	/* low 16 bits of symbol value */
26 #define R_MIPS_GPREL16		7  	/* GP-relative reference  */
27 #define R_MIPS_LITERAL		8 	/* Reference to literal section  */
28 #define R_MIPS_GOT16		9	/* Reference to global offset table */
29 #define R_MIPS_GOT		R_MIPS_GOT16
30 #define R_MIPS_PC16		10  	/* 16 bit PC relative reference */
31 #define R_MIPS_CALL16 		11  	/* 16 bit call thru glbl offset tbl */
32 #define R_MIPS_CALL		R_MIPS_CALL16
33 #define R_MIPS_GPREL32		12
34 
35 /* 13, 14, 15 are not defined at this point. */
36 #define R_MIPS_UNUSED1		13
37 #define R_MIPS_UNUSED2		14
38 #define R_MIPS_UNUSED3		15
39 
40 /*
41  * The remaining relocs are apparently part of the 64-bit Irix ELF ABI.
42  */
43 #define R_MIPS_SHIFT5		16
44 #define R_MIPS_SHIFT6		17
45 
46 #define R_MIPS_64		18
47 #define R_MIPS_GOT_DISP		19
48 #define R_MIPS_GOT_PAGE		20
49 #define R_MIPS_GOT_OFST		21
50 #define R_MIPS_GOT_HI16		22
51 #define R_MIPS_GOT_LO16		23
52 #define R_MIPS_SUB 		24
53 #define R_MIPS_INSERT_A		25
54 #define R_MIPS_INSERT_B		26
55 #define R_MIPS_DELETE		27
56 #define R_MIPS_HIGHER		28
57 #define R_MIPS_HIGHEST		29
58 #define R_MIPS_CALL_HI16	30
59 #define R_MIPS_CALL_LO16	31
60 #define R_MIPS_SCN_DISP		32
61 #define R_MIPS_REL16		33
62 #define R_MIPS_ADD_IMMEDIATE	34
63 #define R_MIPS_PJUMP		35
64 #define R_MIPS_RELGOT		36
65 
66 #define R_MIPS_max		37
67 #define R_TYPE(name)		__CONCAT(R_MIPS_,name)
68 
69 
70 /* mips dynamic tags */
71 
72 #define DT_MIPS_RLD_VERSION	0x70000001
73 #define DT_MIPS_TIME_STAMP	0x70000002
74 #define DT_MIPS_ICHECKSUM	0x70000003
75 #define DT_MIPS_IVERSION	0x70000004
76 #define DT_MIPS_FLAGS		0x70000005
77 #define DT_MIPS_BASE_ADDRESS	0x70000006
78 #define DT_MIPS_CONFLICT	0x70000008
79 #define DT_MIPS_LIBLIST		0x70000009
80 #define DT_MIPS_CONFLICTNO	0x7000000b
81 #define	DT_MIPS_LOCAL_GOTNO	0x7000000a	/* number of local got ents */
82 #define DT_MIPS_LIBLISTNO	0x70000010
83 #define	DT_MIPS_SYMTABNO	0x70000011	/* number of .dynsym entries */
84 #define DT_MIPS_UNREFEXTNO	0x70000012
85 #define	DT_MIPS_GOTSYM		0x70000013	/* first dynamic sym in got */
86 #define DT_MIPS_HIPAGENO	0x70000014
87 #define	DT_MIPS_RLD_MAP		0x70000016	/* address of loader map */
88 
89 /*
90  * Tell the kernel ELF exec code not to try relocating the interpreter
91  * (ld.so) for dynamically-linked ELF binaries.
92  */
93 #ifdef _KERNEL
94 #define ELF_INTERP_NON_RELOCATABLE
95 #endif
96