175fd0b74Schristos /* TI C6X ELF support for BFD. 2*e992f068Schristos Copyright (C) 2010-2022 Free Software Foundation, Inc. 375fd0b74Schristos 475fd0b74Schristos This file is part of BFD, the Binary File Descriptor library. 575fd0b74Schristos 675fd0b74Schristos This program is free software; you can redistribute it and/or modify 775fd0b74Schristos it under the terms of the GNU General Public License as published by 875fd0b74Schristos the Free Software Foundation; either version 3 of the License, or 975fd0b74Schristos (at your option) any later version. 1075fd0b74Schristos 1175fd0b74Schristos This program is distributed in the hope that it will be useful, 1275fd0b74Schristos but WITHOUT ANY WARRANTY; without even the implied warranty of 1375fd0b74Schristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1475fd0b74Schristos GNU General Public License for more details. 1575fd0b74Schristos 1675fd0b74Schristos You should have received a copy of the GNU General Public License 1775fd0b74Schristos along with this program; if not, write to the Free Software 1875fd0b74Schristos Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 1975fd0b74Schristos MA 02110-1301, USA. */ 2075fd0b74Schristos 2175fd0b74Schristos #ifndef _ELF_TIC6X_H 2275fd0b74Schristos #define _ELF_TIC6X_H 2375fd0b74Schristos 2475fd0b74Schristos #include "elf/reloc-macros.h" 2575fd0b74Schristos 2675fd0b74Schristos /* Relocation types. */ 2775fd0b74Schristos START_RELOC_NUMBERS (elf_tic6x_reloc_type) 2875fd0b74Schristos RELOC_NUMBER (R_C6000_NONE, 0) 2975fd0b74Schristos RELOC_NUMBER (R_C6000_ABS32, 1) 3075fd0b74Schristos RELOC_NUMBER (R_C6000_ABS16, 2) 3175fd0b74Schristos RELOC_NUMBER (R_C6000_ABS8, 3) 3275fd0b74Schristos RELOC_NUMBER (R_C6000_PCR_S21, 4) 3375fd0b74Schristos RELOC_NUMBER (R_C6000_PCR_S12, 5) 3475fd0b74Schristos RELOC_NUMBER (R_C6000_PCR_S10, 6) 3575fd0b74Schristos RELOC_NUMBER (R_C6000_PCR_S7, 7) 3675fd0b74Schristos RELOC_NUMBER (R_C6000_ABS_S16, 8) 3775fd0b74Schristos RELOC_NUMBER (R_C6000_ABS_L16, 9) 3875fd0b74Schristos RELOC_NUMBER (R_C6000_ABS_H16, 10) 3975fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_U15_B, 11) 4075fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_U15_H, 12) 4175fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_U15_W, 13) 4275fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_S16, 14) 4375fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_L16_B, 15) 4475fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_L16_H, 16) 4575fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_L16_W, 17) 4675fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_H16_B, 18) 4775fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_H16_H, 19) 4875fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_H16_W, 20) 4975fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_GOT_U15_W, 21) 5075fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_GOT_L16_W, 22) 5175fd0b74Schristos RELOC_NUMBER (R_C6000_SBR_GOT_H16_W, 23) 5275fd0b74Schristos RELOC_NUMBER (R_C6000_DSBT_INDEX, 24) 5375fd0b74Schristos RELOC_NUMBER (R_C6000_PREL31, 25) 5475fd0b74Schristos RELOC_NUMBER (R_C6000_COPY, 26) 5575fd0b74Schristos RELOC_NUMBER (R_C6000_JUMP_SLOT, 27) 5675fd0b74Schristos RELOC_NUMBER (R_C6000_EHTYPE, 28) 5775fd0b74Schristos RELOC_NUMBER (R_C6000_PCR_H16, 29) 5875fd0b74Schristos RELOC_NUMBER (R_C6000_PCR_L16, 30) 5975fd0b74Schristos RELOC_NUMBER (R_C6000_ALIGN, 253) 6075fd0b74Schristos RELOC_NUMBER (R_C6000_FPHEAD, 254) 6175fd0b74Schristos RELOC_NUMBER (R_C6000_NOCMP, 255) 6275fd0b74Schristos END_RELOC_NUMBERS (R_TIC6X_max) 6375fd0b74Schristos 6475fd0b74Schristos /* Processor-specific flags. */ 6575fd0b74Schristos 6675fd0b74Schristos /* File contains static relocation information. */ 6775fd0b74Schristos #define EF_C6000_REL 0x1 6875fd0b74Schristos 6975fd0b74Schristos /* Processor-specific section types. */ 7075fd0b74Schristos 7175fd0b74Schristos /* Unwind function table for stack unwinding. */ 7275fd0b74Schristos #define SHT_C6000_UNWIND 0x70000001 7375fd0b74Schristos 7475fd0b74Schristos /* DLL dynamic linking pre-emption map. */ 7575fd0b74Schristos #define SHT_C6000_PREEMPTMAP 0x70000002 7675fd0b74Schristos 7775fd0b74Schristos /* Object file compatibility attributes. */ 7875fd0b74Schristos #define SHT_C6000_ATTRIBUTES 0x70000003 7975fd0b74Schristos 8075fd0b74Schristos /* Intermediate code for link-time optimization. */ 8175fd0b74Schristos #define SHT_TI_ICODE 0x7F000000 8275fd0b74Schristos 8375fd0b74Schristos /* Symbolic cross reference information. */ 8475fd0b74Schristos #define SHT_TI_XREF 0x7F000001 8575fd0b74Schristos 8675fd0b74Schristos /* Reserved. */ 8775fd0b74Schristos #define SHT_TI_HANDLER 0x7F000002 8875fd0b74Schristos 8975fd0b74Schristos /* Compressed data for initializing C variables. */ 9075fd0b74Schristos #define SHT_TI_INITINFO 0x7F000003 9175fd0b74Schristos 9275fd0b74Schristos /* Extended program header attributes. */ 9375fd0b74Schristos #define SHT_TI_PHATTRS 0x7F000004 9475fd0b74Schristos 9575fd0b74Schristos /* Processor specific section indices. These sections do not actually 9675fd0b74Schristos exist. Symbols with a st_shndx field corresponding to one of these 9775fd0b74Schristos values have a special meaning. */ 9875fd0b74Schristos 9975fd0b74Schristos /* Small data area common symbol. */ 10075fd0b74Schristos #define SHN_TIC6X_SCOMMON SHN_LORESERVE 10175fd0b74Schristos 10275fd0b74Schristos /* Processor-specific segment types. */ 10375fd0b74Schristos 10475fd0b74Schristos /* Extended Segment Attributes. */ 10575fd0b74Schristos #define PT_C6000_PHATTR 0x70000000 10675fd0b74Schristos 10775fd0b74Schristos /* Processor-specific dynamic tags. */ 10875fd0b74Schristos 10975fd0b74Schristos /* Undocumented. */ 11075fd0b74Schristos #define DT_C6000_GSYM_OFFSET 0x6000000D 11175fd0b74Schristos 11275fd0b74Schristos /* Undocumented. */ 11375fd0b74Schristos #define DT_C6000_GSTR_OFFSET 0x6000000F 11475fd0b74Schristos 11575fd0b74Schristos /* Statically linked base address of data segment. */ 11675fd0b74Schristos #define DT_C6000_DSBT_BASE 0x70000000 11775fd0b74Schristos 11875fd0b74Schristos /* Number of entries in this module's DSBT. */ 11975fd0b74Schristos #define DT_C6000_DSBT_SIZE 0x70000001 12075fd0b74Schristos 12175fd0b74Schristos /* Undocumented. */ 12275fd0b74Schristos #define DT_C6000_PREEMPTMAP 0x70000002 12375fd0b74Schristos 12475fd0b74Schristos /* The hard-coded DSBT index for this module, if any. */ 12575fd0b74Schristos #define DT_C6000_DSBT_INDEX 0x70000003 12675fd0b74Schristos 12775fd0b74Schristos /* Extended program header attributes. */ 12875fd0b74Schristos 12975fd0b74Schristos /* Terminate a segment. */ 13075fd0b74Schristos #define PHA_NULL 0x0 13175fd0b74Schristos 13275fd0b74Schristos /* Segment's address bound to the final address. */ 13375fd0b74Schristos #define PHA_BOUND 0x1 13475fd0b74Schristos 13575fd0b74Schristos /* Segment cannot be further relocated. */ 13675fd0b74Schristos #define PHA_READONLY 0x2 13775fd0b74Schristos 13875fd0b74Schristos /* Build attributes. */ 13975fd0b74Schristos enum 14075fd0b74Schristos { 14175fd0b74Schristos #define TAG(tag, value) tag = value, 14275fd0b74Schristos #include "elf/tic6x-attrs.h" 14375fd0b74Schristos #undef TAG 14475fd0b74Schristos Tag_C6XABI_last 14575fd0b74Schristos }; 14675fd0b74Schristos 14775fd0b74Schristos /* Values for Tag_ISA. GNU-specific names; the ABI does not specify 14875fd0b74Schristos names for these values. */ 14975fd0b74Schristos enum 15075fd0b74Schristos { 15175fd0b74Schristos C6XABI_Tag_ISA_none = 0, 15275fd0b74Schristos C6XABI_Tag_ISA_C62X = 1, 15375fd0b74Schristos C6XABI_Tag_ISA_C67X = 3, 15475fd0b74Schristos C6XABI_Tag_ISA_C67XP = 4, 15575fd0b74Schristos C6XABI_Tag_ISA_C64X = 6, 15675fd0b74Schristos C6XABI_Tag_ISA_C64XP = 7, 15775fd0b74Schristos C6XABI_Tag_ISA_C674X = 8 15875fd0b74Schristos }; 15975fd0b74Schristos 16075fd0b74Schristos /* Special section names. */ 16175fd0b74Schristos #define ELF_STRING_C6000_unwind ".c6xabi.exidx" 16275fd0b74Schristos #define ELF_STRING_C6000_unwind_info ".c6xabi.extab" 16375fd0b74Schristos #define ELF_STRING_C6000_unwind_once ".gnu.linkonce.c6xabi.exidx." 16475fd0b74Schristos #define ELF_STRING_C6000_unwind_info_once ".gnu.linkonce.c6xabi.extab." 16575fd0b74Schristos 16675fd0b74Schristos #endif /* _ELF_TIC6X_H */ 167