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