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