OSDN Git Service

Add support for Score target.
[pf3gnuchains/pf3gnuchains4x.git] / include / elf / score.h
1 /* Score ELF support for BFD.
2    Copyright 2006 Free Software Foundation, Inc.
3    Contributed by 
4    Mei Ligang (ligang@sunnorth.com.cn)
5    Pei-Lin Tsai (pltsai@sunplus.com)
6
7    This file is part of BFD, the Binary File Descriptor library.
8
9    This program is free software; you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation; either version 2 of the License, or
12    (at your option) any later version.
13
14    This program is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19    You should have received a copy of the GNU General Public License
20    along with this program; if not, write to the Free Software Foundation,
21    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
22
23 #ifndef _ELF_SCORE_H
24 #define _ELF_SCORE_H
25
26 #include "elf/reloc-macros.h"
27
28 #define SCORE_SIMULATOR_ACTIVE  1
29 #define OPC_PTMASK              0xc0000000      /* Parity-bit Mask */
30 #define OPC16_PTMASK            0x00008000
31 /* The parity-bit denotes.  */
32 #define OPC_32                  0xc0000000      /* denotes 32b instruction, (default) */
33 #define OPC_16                  0x00000000      /* denotes 16b instruction  */
34 #define OPC_PE                  0x8000          /* denotes parallel-execution instructions  */
35 #define EF_SCORE_HASENTRY       0x02
36 #define GP_DISP_LABEL           "_gp_disp"
37
38 /* Processor specific flags for the ELF header e_flags field.  */
39
40 /* Fix data dependency.  */
41 #define EF_SCORE_FIXDEP         0x00000001
42
43 /* File contains position independent code.  */
44 #define EF_SCORE_PIC            0x00000002
45
46 /* Defined and allocated common symbol.  Value is virtual address.  If
47    relocated, alignment must be preserved.  */
48 #define SHN_SCORE_TEXT          0xff01
49 #define SHN_SCORE_DATA          0xff02
50 /* Small common symbol.  */
51 #define SHN_SCORE_SCOMMON       0xff03
52
53 /* Processor specific section flags.  */
54
55 /* This section must be in the global data area.  */
56 #define SHF_SCORE_GPREL         0x10000000
57
58 /* This section should be merged.  */
59 #define SHF_SCORE_MERGE         0x20000000
60
61 /* This section contains address data of size implied by section
62    element size.  */
63 #define SHF_SCORE_ADDR          0x40000000
64
65 /* This section contains string data.  */
66 #define SHF_SCORE_STRING                0x80000000
67
68 /* This section may not be stripped.  */
69 #define SHF_SCORE_NOSTRIP       0x08000000
70
71 /* This section is local to threads.  */
72 #define SHF_SCORE_LOCAL         0x04000000
73
74 /* Linker should generate implicit weak names for this section.  */
75 #define SHF_SCORE_NAMES         0x02000000
76
77 /* Section contais text/data which may be replicated in other sections.
78    Linker should retain only one copy.  */
79 #define SHF_SCORE_NODUPES       0x01000000
80
81 /* Processor specific dynamic array tags.  */
82
83 /* Base address of the segment.  */
84 #define DT_SCORE_BASE_ADDRESS   0x70000001
85 /* Number of local global offset table entries.  */
86 #define DT_SCORE_LOCAL_GOTNO    0x70000002
87 /* Number of entries in the .dynsym section.  */
88 #define DT_SCORE_SYMTABNO       0x70000003
89 /* Index of first dynamic symbol in global offset table.  */
90 #define DT_SCORE_GOTSYM         0x70000004
91 /* Index of first external dynamic symbol not referenced locally.  */
92 #define DT_SCORE_UNREFEXTNO     0x70000005
93 /* Number of page table entries in global offset table.  */
94 #define DT_SCORE_HIPAGENO       0x70000006
95
96
97 /* Processor specific section types.  */
98
99
100 /* Relocation types.  */
101 START_RELOC_NUMBERS (elf_score_reloc_type)
102   RELOC_NUMBER (R_SCORE_NONE,           0)
103   RELOC_NUMBER (R_SCORE_HI16,           1)   
104   RELOC_NUMBER (R_SCORE_LO16,           2)   
105   RELOC_NUMBER (R_SCORE_DUMMY1,         3)
106   RELOC_NUMBER (R_SCORE_24,             4)   
107   RELOC_NUMBER (R_SCORE_PC19,           5)  
108   RELOC_NUMBER (R_SCORE16_11,           6)   
109   RELOC_NUMBER (R_SCORE16_PC8,          7)  
110   RELOC_NUMBER (R_SCORE_ABS32,          8)
111   RELOC_NUMBER (R_SCORE_ABS16,          9)
112   RELOC_NUMBER (R_SCORE_DUMMY2,         10)
113   RELOC_NUMBER (R_SCORE_GP15,           11)
114   RELOC_NUMBER (R_SCORE_GNU_VTINHERIT,  12)
115   RELOC_NUMBER (R_SCORE_GNU_VTENTRY,    13)
116   RELOC_NUMBER (R_SCORE_GOT15,          14)
117   RELOC_NUMBER (R_SCORE_GOT_LO16,       15)
118   RELOC_NUMBER (R_SCORE_CALL15,         16)
119   RELOC_NUMBER (R_SCORE_GPREL32,        17)
120   RELOC_NUMBER (R_SCORE_REL32,          18)
121   RELOC_NUMBER (R_SCORE_DUMMY_HI16,     19)
122 END_RELOC_NUMBERS (R_SCORE_max)
123
124 #endif /* _ELF_SCORE_H */