1214571Sdim/* Score ELF support for BFD.
2214571Sdim   Copyright 2006 Free Software Foundation, Inc.
3214571Sdim   Contributed by
4214571Sdim   Mei Ligang (ligang@sunnorth.com.cn)
5214571Sdim   Pei-Lin Tsai (pltsai@sunplus.com)
6214571Sdim
7214571Sdim   This file is part of BFD, the Binary File Descriptor library.
8214571Sdim
9214571Sdim   This program is free software; you can redistribute it and/or modify
10214571Sdim   it under the terms of the GNU General Public License as published by
11214571Sdim   the Free Software Foundation; either version 2 of the License, or
12214571Sdim   (at your option) any later version.
13214571Sdim
14214571Sdim   This program is distributed in the hope that it will be useful,
15214571Sdim   but WITHOUT ANY WARRANTY; without even the implied warranty of
16214571Sdim   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17214571Sdim   GNU General Public License for more details.
18214571Sdim
19214571Sdim   You should have received a copy of the GNU General Public License
20214571Sdim   along with this program; if not, write to the Free Software Foundation,
21214571Sdim   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
22214571Sdim
23214571Sdim#ifndef _ELF_SCORE_H
24214571Sdim#define _ELF_SCORE_H
25214571Sdim
26214571Sdim#include "elf/reloc-macros.h"
27214571Sdim
28214571Sdim#define SCORE_SIMULATOR_ACTIVE  1
29214571Sdim#define OPC_PTMASK              0xc0000000      /* Parity-bit Mask.  */
30214571Sdim#define OPC16_PTMASK		0x00008000
31214571Sdim/* The parity-bit denotes.  */
32214571Sdim#define OPC_32                  0xc0000000      /* Denotes 32b instruction, (default).  */
33214571Sdim#define OPC_16                  0x00000000      /* Denotes 16b instruction.  */
34214571Sdim#define OPC_PE                  0x8000          /* Denotes parallel-execution instructions.  */
35214571Sdim#define GP_DISP_LABEL           "_gp_disp"
36214571Sdim
37214571Sdim/* Processor specific flags for the ELF header e_flags field:  */
38214571Sdim
39214571Sdim/* File contains position independent code.  */
40214571Sdim#define EF_SCORE_PIC            0x80000000
41214571Sdim
42214571Sdim/* Fix data dependency.  */
43214571Sdim#define EF_SCORE_FIXDEP         0x40000000
44214571Sdim
45214571Sdim/* Defined and allocated common symbol.  Value is virtual address.  If
46214571Sdim   relocated, alignment must be preserved.  */
47214571Sdim#define SHN_SCORE_TEXT		0xff01
48214571Sdim#define SHN_SCORE_DATA		0xff02
49214571Sdim/* Small common symbol.  */
50214571Sdim#define SHN_SCORE_SCOMMON	0xff03
51214571Sdim
52214571Sdim/* Processor specific section flags.  */
53214571Sdim
54214571Sdim/* This section must be in the global data area.  */
55214571Sdim#define SHF_SCORE_GPREL		0x10000000
56214571Sdim
57214571Sdim/* This section should be merged.  */
58214571Sdim#define SHF_SCORE_MERGE		0x20000000
59214571Sdim
60214571Sdim/* This section contains address data of size implied by section
61214571Sdim   element size.  */
62214571Sdim#define SHF_SCORE_ADDR		0x40000000
63214571Sdim
64214571Sdim/* This section contains string data.  */
65214571Sdim#define SHF_SCORE_STRING		0x80000000
66214571Sdim
67214571Sdim/* This section may not be stripped.  */
68214571Sdim#define SHF_SCORE_NOSTRIP	0x08000000
69214571Sdim
70214571Sdim/* This section is local to threads.  */
71214571Sdim#define SHF_SCORE_LOCAL		0x04000000
72214571Sdim
73214571Sdim/* Linker should generate implicit weak names for this section.  */
74214571Sdim#define SHF_SCORE_NAMES		0x02000000
75214571Sdim
76214571Sdim/* Section contais text/data which may be replicated in other sections.
77214571Sdim   Linker should retain only one copy.  */
78214571Sdim#define SHF_SCORE_NODUPES	0x01000000
79214571Sdim
80214571Sdim/* Processor specific dynamic array tags.  */
81214571Sdim
82214571Sdim/* Base address of the segment.  */
83214571Sdim#define DT_SCORE_BASE_ADDRESS	0x70000001
84214571Sdim/* Number of local global offset table entries.  */
85214571Sdim#define DT_SCORE_LOCAL_GOTNO	0x70000002
86214571Sdim/* Number of entries in the .dynsym section.  */
87214571Sdim#define DT_SCORE_SYMTABNO	0x70000003
88214571Sdim/* Index of first dynamic symbol in global offset table.  */
89214571Sdim#define DT_SCORE_GOTSYM		0x70000004
90214571Sdim/* Index of first external dynamic symbol not referenced locally.  */
91214571Sdim#define DT_SCORE_UNREFEXTNO	0x70000005
92214571Sdim/* Number of page table entries in global offset table.  */
93214571Sdim#define DT_SCORE_HIPAGENO	0x70000006
94214571Sdim
95214571Sdim
96214571Sdim/* Processor specific section types.  */
97214571Sdim
98214571Sdim
99214571Sdim/* Relocation types.  */
100214571SdimSTART_RELOC_NUMBERS (elf_score_reloc_type)
101214571Sdim  RELOC_NUMBER (R_SCORE_NONE,           0)
102214571Sdim  RELOC_NUMBER (R_SCORE_HI16,           1)
103214571Sdim  RELOC_NUMBER (R_SCORE_LO16,           2)
104214571Sdim  RELOC_NUMBER (R_SCORE_DUMMY1,         3)
105214571Sdim  RELOC_NUMBER (R_SCORE_24,             4)
106214571Sdim  RELOC_NUMBER (R_SCORE_PC19,           5)
107214571Sdim  RELOC_NUMBER (R_SCORE16_11,           6)
108214571Sdim  RELOC_NUMBER (R_SCORE16_PC8,          7)
109214571Sdim  RELOC_NUMBER (R_SCORE_ABS32,          8)
110214571Sdim  RELOC_NUMBER (R_SCORE_ABS16,          9)
111214571Sdim  RELOC_NUMBER (R_SCORE_DUMMY2,         10)
112214571Sdim  RELOC_NUMBER (R_SCORE_GP15,           11)
113214571Sdim  RELOC_NUMBER (R_SCORE_GNU_VTINHERIT,  12)
114214571Sdim  RELOC_NUMBER (R_SCORE_GNU_VTENTRY,    13)
115214571Sdim  RELOC_NUMBER (R_SCORE_GOT15,          14)
116214571Sdim  RELOC_NUMBER (R_SCORE_GOT_LO16,       15)
117214571Sdim  RELOC_NUMBER (R_SCORE_CALL15,         16)
118214571Sdim  RELOC_NUMBER (R_SCORE_GPREL32,        17)
119214571Sdim  RELOC_NUMBER (R_SCORE_REL32,          18)
120214571Sdim  RELOC_NUMBER (R_SCORE_DUMMY_HI16,     19)
121214571SdimEND_RELOC_NUMBERS (R_SCORE_max)
122214571Sdim
123214571Sdim#endif /* _ELF_SCORE_H */
124