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