xref: /netbsd-src/external/gpl3/binutils/dist/include/elf/tic6x.h (revision cb63e24e8d6aae7ddac1859a9015f48b1d8bd90e)
145548106Schristos /* TI C6X ELF support for BFD.
2*cb63e24eSchristos    Copyright (C) 2010-2024 Free Software Foundation, Inc.
345548106Schristos 
445548106Schristos    This file is part of BFD, the Binary File Descriptor library.
545548106Schristos 
645548106Schristos    This program is free software; you can redistribute it and/or modify
745548106Schristos    it under the terms of the GNU General Public License as published by
845548106Schristos    the Free Software Foundation; either version 3 of the License, or
945548106Schristos    (at your option) any later version.
1045548106Schristos 
1145548106Schristos    This program is distributed in the hope that it will be useful,
1245548106Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1345548106Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1445548106Schristos    GNU General Public License for more details.
1545548106Schristos 
1645548106Schristos    You should have received a copy of the GNU General Public License
1745548106Schristos    along with this program; if not, write to the Free Software
1845548106Schristos    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
1945548106Schristos    MA 02110-1301, USA.  */
2045548106Schristos 
2145548106Schristos #ifndef _ELF_TIC6X_H
2245548106Schristos #define _ELF_TIC6X_H
2345548106Schristos 
2445548106Schristos #include "elf/reloc-macros.h"
2545548106Schristos 
2645548106Schristos /* Relocation types.  */
2745548106Schristos START_RELOC_NUMBERS (elf_tic6x_reloc_type)
2845548106Schristos   RELOC_NUMBER (R_C6000_NONE, 0)
2945548106Schristos   RELOC_NUMBER (R_C6000_ABS32, 1)
3045548106Schristos   RELOC_NUMBER (R_C6000_ABS16, 2)
3145548106Schristos   RELOC_NUMBER (R_C6000_ABS8, 3)
3245548106Schristos   RELOC_NUMBER (R_C6000_PCR_S21, 4)
3345548106Schristos   RELOC_NUMBER (R_C6000_PCR_S12, 5)
3445548106Schristos   RELOC_NUMBER (R_C6000_PCR_S10, 6)
3545548106Schristos   RELOC_NUMBER (R_C6000_PCR_S7, 7)
3645548106Schristos   RELOC_NUMBER (R_C6000_ABS_S16, 8)
3745548106Schristos   RELOC_NUMBER (R_C6000_ABS_L16, 9)
3845548106Schristos   RELOC_NUMBER (R_C6000_ABS_H16, 10)
3945548106Schristos   RELOC_NUMBER (R_C6000_SBR_U15_B, 11)
4045548106Schristos   RELOC_NUMBER (R_C6000_SBR_U15_H, 12)
4145548106Schristos   RELOC_NUMBER (R_C6000_SBR_U15_W, 13)
4245548106Schristos   RELOC_NUMBER (R_C6000_SBR_S16, 14)
4345548106Schristos   RELOC_NUMBER (R_C6000_SBR_L16_B, 15)
4445548106Schristos   RELOC_NUMBER (R_C6000_SBR_L16_H, 16)
4545548106Schristos   RELOC_NUMBER (R_C6000_SBR_L16_W, 17)
4645548106Schristos   RELOC_NUMBER (R_C6000_SBR_H16_B, 18)
4745548106Schristos   RELOC_NUMBER (R_C6000_SBR_H16_H, 19)
4845548106Schristos   RELOC_NUMBER (R_C6000_SBR_H16_W, 20)
4945548106Schristos   RELOC_NUMBER (R_C6000_SBR_GOT_U15_W, 21)
5045548106Schristos   RELOC_NUMBER (R_C6000_SBR_GOT_L16_W, 22)
5145548106Schristos   RELOC_NUMBER (R_C6000_SBR_GOT_H16_W, 23)
5245548106Schristos   RELOC_NUMBER (R_C6000_DSBT_INDEX, 24)
5345548106Schristos   RELOC_NUMBER (R_C6000_PREL31, 25)
5445548106Schristos   RELOC_NUMBER (R_C6000_COPY, 26)
55883529b6Schristos   RELOC_NUMBER (R_C6000_JUMP_SLOT, 27)
56883529b6Schristos   RELOC_NUMBER (R_C6000_EHTYPE, 28)
57883529b6Schristos   RELOC_NUMBER (R_C6000_PCR_H16, 29)
58883529b6Schristos   RELOC_NUMBER (R_C6000_PCR_L16, 30)
5945548106Schristos   RELOC_NUMBER (R_C6000_ALIGN, 253)
6045548106Schristos   RELOC_NUMBER (R_C6000_FPHEAD, 254)
6145548106Schristos   RELOC_NUMBER (R_C6000_NOCMP, 255)
6245548106Schristos END_RELOC_NUMBERS (R_TIC6X_max)
6345548106Schristos 
6445548106Schristos /* Processor-specific flags.  */
6545548106Schristos 
6645548106Schristos /* File contains static relocation information.  */
6745548106Schristos #define EF_C6000_REL		0x1
6845548106Schristos 
6945548106Schristos /* Processor-specific section types.  */
7045548106Schristos 
7145548106Schristos /* Unwind function table for stack unwinding.  */
7245548106Schristos #define SHT_C6000_UNWIND	0x70000001
7345548106Schristos 
7445548106Schristos /* DLL dynamic linking pre-emption map.  */
7545548106Schristos #define SHT_C6000_PREEMPTMAP	0x70000002
7645548106Schristos 
7745548106Schristos /* Object file compatibility attributes.  */
7845548106Schristos #define SHT_C6000_ATTRIBUTES	0x70000003
7945548106Schristos 
8045548106Schristos /* Intermediate code for link-time optimization.  */
8145548106Schristos #define SHT_TI_ICODE		0x7F000000
8245548106Schristos 
8345548106Schristos /* Symbolic cross reference information.  */
8445548106Schristos #define SHT_TI_XREF		0x7F000001
8545548106Schristos 
8645548106Schristos /* Reserved.  */
8745548106Schristos #define SHT_TI_HANDLER		0x7F000002
8845548106Schristos 
8945548106Schristos /* Compressed data for initializing C variables.  */
9045548106Schristos #define SHT_TI_INITINFO		0x7F000003
9145548106Schristos 
9245548106Schristos /* Extended program header attributes.  */
9345548106Schristos #define SHT_TI_PHATTRS		0x7F000004
9445548106Schristos 
95883529b6Schristos /* Processor specific section indices.  These sections do not actually
96883529b6Schristos    exist.  Symbols with a st_shndx field corresponding to one of these
97883529b6Schristos    values have a special meaning.  */
98883529b6Schristos 
99883529b6Schristos /* Small data area common symbol.  */
100883529b6Schristos #define SHN_TIC6X_SCOMMON	SHN_LORESERVE
101883529b6Schristos 
10245548106Schristos /* Processor-specific segment types.  */
10345548106Schristos 
10445548106Schristos /* Extended Segment Attributes.  */
10545548106Schristos #define PT_C6000_PHATTR		0x70000000
10645548106Schristos 
10745548106Schristos /* Processor-specific dynamic tags.  */
10845548106Schristos 
10945548106Schristos /* Undocumented.  */
11045548106Schristos #define DT_C6000_GSYM_OFFSET	0x6000000D
11145548106Schristos 
11245548106Schristos /* Undocumented.  */
11345548106Schristos #define DT_C6000_GSTR_OFFSET	0x6000000F
11445548106Schristos 
11545548106Schristos /* Statically linked base address of data segment.  */
11645548106Schristos #define DT_C6000_DSBT_BASE	0x70000000
11745548106Schristos 
11845548106Schristos /* Number of entries in this module's DSBT.  */
11945548106Schristos #define DT_C6000_DSBT_SIZE	0x70000001
12045548106Schristos 
12145548106Schristos /* Undocumented.  */
12245548106Schristos #define DT_C6000_PREEMPTMAP	0x70000002
12345548106Schristos 
12445548106Schristos /* The hard-coded DSBT index for this module, if any.  */
12545548106Schristos #define DT_C6000_DSBT_INDEX	0x70000003
12645548106Schristos 
12745548106Schristos /* Extended program header attributes.  */
12845548106Schristos 
12945548106Schristos /* Terminate a segment.  */
13045548106Schristos #define PHA_NULL		0x0
13145548106Schristos 
13245548106Schristos /* Segment's address bound to the final address.  */
13345548106Schristos #define PHA_BOUND		0x1
13445548106Schristos 
13545548106Schristos /* Segment cannot be further relocated.  */
13645548106Schristos #define PHA_READONLY		0x2
13745548106Schristos 
13845548106Schristos /* Build attributes.  */
13945548106Schristos enum
14045548106Schristos   {
14145548106Schristos #define TAG(tag, value) tag = value,
14245548106Schristos #include "elf/tic6x-attrs.h"
14345548106Schristos #undef TAG
14445548106Schristos     Tag_C6XABI_last
14545548106Schristos   };
14645548106Schristos 
14745548106Schristos /* Values for Tag_ISA.  GNU-specific names; the ABI does not specify
14845548106Schristos    names for these values.  */
14945548106Schristos enum
15045548106Schristos   {
15145548106Schristos     C6XABI_Tag_ISA_none = 0,
15245548106Schristos     C6XABI_Tag_ISA_C62X = 1,
15345548106Schristos     C6XABI_Tag_ISA_C67X = 3,
15445548106Schristos     C6XABI_Tag_ISA_C67XP = 4,
15545548106Schristos     C6XABI_Tag_ISA_C64X = 6,
15645548106Schristos     C6XABI_Tag_ISA_C64XP = 7,
15745548106Schristos     C6XABI_Tag_ISA_C674X = 8
15845548106Schristos   };
15945548106Schristos 
160883529b6Schristos /* Special section names.  */
161883529b6Schristos #define ELF_STRING_C6000_unwind           ".c6xabi.exidx"
162883529b6Schristos #define ELF_STRING_C6000_unwind_info      ".c6xabi.extab"
163883529b6Schristos #define ELF_STRING_C6000_unwind_once      ".gnu.linkonce.c6xabi.exidx."
164883529b6Schristos #define ELF_STRING_C6000_unwind_info_once ".gnu.linkonce.c6xabi.extab."
165883529b6Schristos 
16645548106Schristos #endif /* _ELF_TIC6X_H */
167