xref: /linux/arch/nios2/include/uapi/asm/elf.h (revision a13d7201d7deedcbb6ac6efa94a1a7d34d3d79ec)
1 /*
2  * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  */
18 
19 
20 #ifndef _UAPI_ASM_NIOS2_ELF_H
21 #define _UAPI_ASM_NIOS2_ELF_H
22 
23 #include <linux/ptrace.h>
24 
25 /* Relocation types */
26 #define R_NIOS2_NONE		0
27 #define R_NIOS2_S16		1
28 #define R_NIOS2_U16		2
29 #define R_NIOS2_PCREL16		3
30 #define R_NIOS2_CALL26		4
31 #define R_NIOS2_IMM5		5
32 #define R_NIOS2_CACHE_OPX	6
33 #define R_NIOS2_IMM6		7
34 #define R_NIOS2_IMM8		8
35 #define R_NIOS2_HI16		9
36 #define R_NIOS2_LO16		10
37 #define R_NIOS2_HIADJ16		11
38 #define R_NIOS2_BFD_RELOC_32	12
39 #define R_NIOS2_BFD_RELOC_16	13
40 #define R_NIOS2_BFD_RELOC_8	14
41 #define R_NIOS2_GPREL		15
42 #define R_NIOS2_GNU_VTINHERIT	16
43 #define R_NIOS2_GNU_VTENTRY	17
44 #define R_NIOS2_UJMP		18
45 #define R_NIOS2_CJMP		19
46 #define R_NIOS2_CALLR		20
47 #define R_NIOS2_ALIGN		21
48 /* Keep this the last entry.  */
49 #define R_NIOS2_NUM		22
50 
51 typedef unsigned long elf_greg_t;
52 
53 #define ELF_NGREG		49
54 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
55 
56 typedef unsigned long elf_fpregset_t;
57 
58 /*
59  * These are used to set parameters in the core dumps.
60  */
61 #define ELF_CLASS	ELFCLASS32
62 #define ELF_DATA	ELFDATA2LSB
63 #define ELF_ARCH	EM_ALTERA_NIOS2
64 
65 #endif /* _UAPI_ASM_NIOS2_ELF_H */
66