Rev 5191 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5191 | Rev 6324 | ||
---|---|---|---|
1 | /* Altera Nios II ELF support for BFD. |
1 | /* Altera Nios II ELF support for BFD. |
2 | Copyright (C) 2012, 2013 Free Software Foundation, Inc. |
2 | Copyright (C) 2012-2015 Free Software Foundation, Inc. |
3 | Contributed by Nigel Gray (ngray@altera.com). |
3 | Contributed by Nigel Gray (ngray@altera.com). |
4 | Contributed by Mentor Graphics, Inc. |
4 | Contributed by Mentor Graphics, Inc. |
5 | 5 | ||
6 | This file is part of BFD, the Binary File Descriptor library. |
6 | This file is part of BFD, the Binary File Descriptor library. |
7 | 7 | ||
8 | This program is free software; you can redistribute it and/or modify |
8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 3 of the License, or |
10 | the Free Software Foundation; either version 3 of the License, or |
11 | (at your option) any later version. |
11 | (at your option) any later version. |
12 | 12 | ||
13 | This program is distributed in the hope that it will be useful, |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
16 | GNU General Public License for more details. |
17 | 17 | ||
18 | You should have received a copy of the GNU General Public License |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
20 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
21 | MA 02110-1301, USA. */ |
21 | MA 02110-1301, USA. */ |
22 | 22 | ||
23 | 23 | ||
24 | /* This file holds definitions specific to the Altera Nios II ELF ABI. Note |
24 | /* This file holds definitions specific to the Altera Nios II ELF ABI. Note |
25 | that most of this is not actually implemented by BFD. */ |
25 | that most of this is not actually implemented by BFD. */ |
26 | 26 | ||
27 | #ifndef _ELF_NIOS2_H |
27 | #ifndef _ELF_NIOS2_H |
28 | #define _ELF_NIOS2_H |
28 | #define _ELF_NIOS2_H |
29 | 29 | ||
30 | #include "elf/reloc-macros.h" |
30 | #include "elf/reloc-macros.h" |
31 | 31 | ||
32 | /* The order of these numbers must match the order in |
32 | /* The order of these numbers must match the order in |
33 | the elf_nios2_howto_table_rel table for the lookup |
33 | the elf_nios2_howto_table_rel table for the lookup |
34 | function to work properly. */ |
34 | function to work properly. */ |
35 | 35 | ||
36 | START_RELOC_NUMBERS (elf_nios2_reloc_type) |
36 | START_RELOC_NUMBERS (elf_nios2_reloc_type) |
- | 37 | /* Relocs used by both R1 and R2, with different howtos to match |
|
- | 38 | the respective encodings. */ |
|
37 | RELOC_NUMBER (R_NIOS2_NONE, 0) |
39 | RELOC_NUMBER (R_NIOS2_NONE, 0) |
38 | RELOC_NUMBER (R_NIOS2_S16, 1) |
40 | RELOC_NUMBER (R_NIOS2_S16, 1) |
39 | RELOC_NUMBER (R_NIOS2_U16, 2) |
41 | RELOC_NUMBER (R_NIOS2_U16, 2) |
40 | RELOC_NUMBER (R_NIOS2_PCREL16, 3) |
42 | RELOC_NUMBER (R_NIOS2_PCREL16, 3) |
41 | RELOC_NUMBER (R_NIOS2_CALL26, 4) |
43 | RELOC_NUMBER (R_NIOS2_CALL26, 4) |
42 | RELOC_NUMBER (R_NIOS2_IMM5, 5) |
44 | RELOC_NUMBER (R_NIOS2_IMM5, 5) |
43 | RELOC_NUMBER (R_NIOS2_CACHE_OPX, 6) |
45 | RELOC_NUMBER (R_NIOS2_CACHE_OPX, 6) |
44 | RELOC_NUMBER (R_NIOS2_IMM6, 7) |
46 | RELOC_NUMBER (R_NIOS2_IMM6, 7) |
45 | RELOC_NUMBER (R_NIOS2_IMM8, 8) |
47 | RELOC_NUMBER (R_NIOS2_IMM8, 8) |
46 | RELOC_NUMBER (R_NIOS2_HI16, 9) |
48 | RELOC_NUMBER (R_NIOS2_HI16, 9) |
47 | RELOC_NUMBER (R_NIOS2_LO16, 10) |
49 | RELOC_NUMBER (R_NIOS2_LO16, 10) |
48 | RELOC_NUMBER (R_NIOS2_HIADJ16, 11) |
50 | RELOC_NUMBER (R_NIOS2_HIADJ16, 11) |
49 | RELOC_NUMBER (R_NIOS2_BFD_RELOC_32, 12) |
51 | RELOC_NUMBER (R_NIOS2_BFD_RELOC_32, 12) |
50 | RELOC_NUMBER (R_NIOS2_BFD_RELOC_16, 13) |
52 | RELOC_NUMBER (R_NIOS2_BFD_RELOC_16, 13) |
51 | RELOC_NUMBER (R_NIOS2_BFD_RELOC_8, 14) |
53 | RELOC_NUMBER (R_NIOS2_BFD_RELOC_8, 14) |
52 | RELOC_NUMBER (R_NIOS2_GPREL, 15) |
54 | RELOC_NUMBER (R_NIOS2_GPREL, 15) |
53 | RELOC_NUMBER (R_NIOS2_GNU_VTINHERIT, 16) |
55 | RELOC_NUMBER (R_NIOS2_GNU_VTINHERIT, 16) |
54 | RELOC_NUMBER (R_NIOS2_GNU_VTENTRY, 17) |
56 | RELOC_NUMBER (R_NIOS2_GNU_VTENTRY, 17) |
55 | RELOC_NUMBER (R_NIOS2_UJMP, 18) |
57 | RELOC_NUMBER (R_NIOS2_UJMP, 18) |
56 | RELOC_NUMBER (R_NIOS2_CJMP, 19) |
58 | RELOC_NUMBER (R_NIOS2_CJMP, 19) |
57 | RELOC_NUMBER (R_NIOS2_CALLR, 20) |
59 | RELOC_NUMBER (R_NIOS2_CALLR, 20) |
58 | RELOC_NUMBER (R_NIOS2_ALIGN, 21) |
60 | RELOC_NUMBER (R_NIOS2_ALIGN, 21) |
59 | RELOC_NUMBER (R_NIOS2_GOT16, 22) |
61 | RELOC_NUMBER (R_NIOS2_GOT16, 22) |
60 | RELOC_NUMBER (R_NIOS2_CALL16, 23) |
62 | RELOC_NUMBER (R_NIOS2_CALL16, 23) |
61 | RELOC_NUMBER (R_NIOS2_GOTOFF_LO, 24) |
63 | RELOC_NUMBER (R_NIOS2_GOTOFF_LO, 24) |
62 | RELOC_NUMBER (R_NIOS2_GOTOFF_HA, 25) |
64 | RELOC_NUMBER (R_NIOS2_GOTOFF_HA, 25) |
63 | RELOC_NUMBER (R_NIOS2_PCREL_LO, 26) |
65 | RELOC_NUMBER (R_NIOS2_PCREL_LO, 26) |
64 | RELOC_NUMBER (R_NIOS2_PCREL_HA, 27) |
66 | RELOC_NUMBER (R_NIOS2_PCREL_HA, 27) |
65 | RELOC_NUMBER (R_NIOS2_TLS_GD16, 28) |
67 | RELOC_NUMBER (R_NIOS2_TLS_GD16, 28) |
66 | RELOC_NUMBER (R_NIOS2_TLS_LDM16, 29) |
68 | RELOC_NUMBER (R_NIOS2_TLS_LDM16, 29) |
67 | RELOC_NUMBER (R_NIOS2_TLS_LDO16, 30) |
69 | RELOC_NUMBER (R_NIOS2_TLS_LDO16, 30) |
68 | RELOC_NUMBER (R_NIOS2_TLS_IE16, 31) |
70 | RELOC_NUMBER (R_NIOS2_TLS_IE16, 31) |
69 | RELOC_NUMBER (R_NIOS2_TLS_LE16, 32) |
71 | RELOC_NUMBER (R_NIOS2_TLS_LE16, 32) |
70 | RELOC_NUMBER (R_NIOS2_TLS_DTPMOD, 33) |
72 | RELOC_NUMBER (R_NIOS2_TLS_DTPMOD, 33) |
71 | RELOC_NUMBER (R_NIOS2_TLS_DTPREL, 34) |
73 | RELOC_NUMBER (R_NIOS2_TLS_DTPREL, 34) |
72 | RELOC_NUMBER (R_NIOS2_TLS_TPREL, 35) |
74 | RELOC_NUMBER (R_NIOS2_TLS_TPREL, 35) |
73 | RELOC_NUMBER (R_NIOS2_COPY, 36) |
75 | RELOC_NUMBER (R_NIOS2_COPY, 36) |
74 | RELOC_NUMBER (R_NIOS2_GLOB_DAT, 37) |
76 | RELOC_NUMBER (R_NIOS2_GLOB_DAT, 37) |
75 | RELOC_NUMBER (R_NIOS2_JUMP_SLOT, 38) |
77 | RELOC_NUMBER (R_NIOS2_JUMP_SLOT, 38) |
76 | RELOC_NUMBER (R_NIOS2_RELATIVE, 39) |
78 | RELOC_NUMBER (R_NIOS2_RELATIVE, 39) |
77 | RELOC_NUMBER (R_NIOS2_GOTOFF, 40) |
79 | RELOC_NUMBER (R_NIOS2_GOTOFF, 40) |
- | 80 | RELOC_NUMBER (R_NIOS2_CALL26_NOAT, 41) |
|
- | 81 | RELOC_NUMBER (R_NIOS2_GOT_LO, 42) |
|
- | 82 | RELOC_NUMBER (R_NIOS2_GOT_HA, 43) |
|
- | 83 | RELOC_NUMBER (R_NIOS2_CALL_LO, 44) |
|
- | 84 | RELOC_NUMBER (R_NIOS2_CALL_HA, 45) |
|
- | 85 | ||
- | 86 | /* Relocs specific to R2. */ |
|
- | 87 | RELOC_NUMBER (R_NIOS2_R2_S12, 64) |
|
- | 88 | RELOC_NUMBER (R_NIOS2_R2_I10_1_PCREL, 65) |
|
- | 89 | RELOC_NUMBER (R_NIOS2_R2_T1I7_1_PCREL, 66) |
|
- | 90 | RELOC_NUMBER (R_NIOS2_R2_T1I7_2, 67) |
|
- | 91 | RELOC_NUMBER (R_NIOS2_R2_T2I4, 68) |
|
- | 92 | RELOC_NUMBER (R_NIOS2_R2_T2I4_1, 69) |
|
- | 93 | RELOC_NUMBER (R_NIOS2_R2_T2I4_2, 70) |
|
- | 94 | RELOC_NUMBER (R_NIOS2_R2_X1I7_2, 71) |
|
- | 95 | RELOC_NUMBER (R_NIOS2_R2_X2L5, 72) |
|
- | 96 | RELOC_NUMBER (R_NIOS2_R2_F1I5_2, 73) |
|
- | 97 | RELOC_NUMBER (R_NIOS2_R2_L5I4X1, 74) |
|
- | 98 | RELOC_NUMBER (R_NIOS2_R2_T1X1I6, 75) |
|
- | 99 | RELOC_NUMBER (R_NIOS2_R2_T1X1I6_2, 76) |
|
- | 100 | ||
- | 101 | /* Last reloc. */ |
|
78 | RELOC_NUMBER (R_NIOS2_ILLEGAL, 41) |
102 | RELOC_NUMBER (R_NIOS2_ILLEGAL, 77) |
79 | END_RELOC_NUMBERS (R_NIOS2_maxext) |
103 | END_RELOC_NUMBERS (R_NIOS2_maxext) |
80 | 104 | ||
81 | /* Processor-specific section flags. */ |
105 | /* Processor-specific section flags. */ |
82 | 106 | ||
83 | /* This is used to mark gp-relative sections. */ |
107 | /* This is used to mark gp-relative sections. */ |
84 | #define SHF_NIOS2_GPREL 0x10000000 |
108 | #define SHF_NIOS2_GPREL 0x10000000 |
85 | 109 | ||
86 | /* Processor-specific dynamic array tags. */ |
110 | /* Processor-specific dynamic array tags. */ |
87 | 111 | ||
88 | /* Address of _gp. */ |
112 | /* Address of _gp. */ |
89 | #define DT_NIOS2_GP 0x70000002 |
113 | #define DT_NIOS2_GP 0x70000002 |
- | 114 | ||
- | 115 | /* Processor specific flags for the Elf header e_flags field. */ |
|
- | 116 | ||
- | 117 | #define EF_NIOS2_ARCH_R1 0x00000000 |
|
- | 118 | #define EF_NIOS2_ARCH_R2 0x00000001 |
|
90 | 119 | ||
91 | #endif /* _ELF_NIOS2_H */ |
120 | #endif /* _ELF_NIOS2_H */ |