198b9484cSchristos /* ARC ELF support for BFD. 2*02f41505Schristos Copyright (C) 1995-2024 Free Software Foundation, Inc. 398b9484cSchristos Contributed by Doug Evans, (dje@cygnus.com) 498b9484cSchristos 598b9484cSchristos This file is part of BFD, the Binary File Descriptor library. 698b9484cSchristos 798b9484cSchristos This program is free software; you can redistribute it and/or modify 898b9484cSchristos it under the terms of the GNU General Public License as published by 998b9484cSchristos the Free Software Foundation; either version 3 of the License, or 1098b9484cSchristos (at your option) any later version. 1198b9484cSchristos 1298b9484cSchristos This program is distributed in the hope that it will be useful, 1398b9484cSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 1498b9484cSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1598b9484cSchristos GNU General Public License for more details. 1698b9484cSchristos 1798b9484cSchristos You should have received a copy of the GNU General Public License 1898b9484cSchristos along with this program; if not, write to the Free Software 1998b9484cSchristos Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 2098b9484cSchristos MA 02110-1301, USA. */ 2198b9484cSchristos 2298b9484cSchristos /* This file holds definitions specific to the ARC ELF ABI. */ 2398b9484cSchristos 2498b9484cSchristos #ifndef _ELF_ARC_H 2598b9484cSchristos #define _ELF_ARC_H 2698b9484cSchristos 2798b9484cSchristos #include "elf/reloc-macros.h" 2898b9484cSchristos 2998b9484cSchristos /* Relocations. */ 3098b9484cSchristos 31ba340e45Schristos #define ARC_RELOC_HOWTO(TYPE, VALUE, SIZE, BITSIZE, RELOC_FUNCTION, OVERFLOW, FORMULA) \ 32ba340e45Schristos RELOC_NUMBER(R_##TYPE, VALUE) 33ba340e45Schristos 3498b9484cSchristos START_RELOC_NUMBERS (elf_arc_reloc_type) 35ba340e45Schristos #include "arc-reloc.def" 3698b9484cSchristos END_RELOC_NUMBERS (R_ARC_max) 3798b9484cSchristos 38ba340e45Schristos #undef ARC_RELOC_HOWTO 39ba340e45Schristos 4098b9484cSchristos /* Processor specific flags for the ELF header e_flags field. */ 4198b9484cSchristos 42ba340e45Schristos #define EF_ARC_MACH_MSK 0x000000ff 43ba340e45Schristos #define EF_ARC_OSABI_MSK 0x00000f00 44ba340e45Schristos #define EF_ARC_ALL_MSK (EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK) 4598b9484cSchristos 46ba340e45Schristos /* Various CPU types. These numbers are exposed in the ELF header flags 47ba340e45Schristos (e_flags field), and so must never change. */ 48ba340e45Schristos #define E_ARC_MACH_ARC600 0x00000002 49ba340e45Schristos #define E_ARC_MACH_ARC601 0x00000004 50ba340e45Schristos #define E_ARC_MACH_ARC700 0x00000003 51ba340e45Schristos #define EF_ARC_CPU_ARCV2EM 0x00000005 52ba340e45Schristos #define EF_ARC_CPU_ARCV2HS 0x00000006 5398b9484cSchristos 54ba340e45Schristos /* ARC Linux specific ABIs. */ 55ba340e45Schristos #define E_ARC_OSABI_ORIG 0x00000000 /* MUST be 0 for back-compat. */ 56ba340e45Schristos #define E_ARC_OSABI_V2 0x00000200 57ba340e45Schristos #define E_ARC_OSABI_V3 0x00000300 584559860eSchristos #define E_ARC_OSABI_V4 0x00000400 594559860eSchristos #define E_ARC_OSABI_CURRENT E_ARC_OSABI_V4 6098b9484cSchristos /* Leave bits 0xf0 alone in case we ever have more than 16 cpu types. */ 6198b9484cSchristos 6298b9484cSchristos /* File contains position independent code. */ 6398b9484cSchristos 6498b9484cSchristos #define EF_ARC_PIC 0x00000100 6598b9484cSchristos 664559860eSchristos /* Additional section types. */ 674559860eSchristos #define SHT_ARC_ATTRIBUTES 0x70000001 /* Section holds attributes. */ 684559860eSchristos 694559860eSchristos /* ARC ABI object attributes. */ 704559860eSchristos enum { 714559860eSchristos /* 0-3 are generic. */ 724559860eSchristos Tag_ARC_PCS_config = 4, 734559860eSchristos Tag_ARC_CPU_base, 744559860eSchristos Tag_ARC_CPU_variation, 754559860eSchristos Tag_ARC_CPU_name, 764559860eSchristos Tag_ARC_ABI_rf16, 774559860eSchristos Tag_ARC_ABI_osver, 784559860eSchristos Tag_ARC_ABI_sda, 794559860eSchristos Tag_ARC_ABI_pic, 804559860eSchristos Tag_ARC_ABI_tls, 814559860eSchristos Tag_ARC_ABI_enumsize, 824559860eSchristos Tag_ARC_ABI_exceptions, 834559860eSchristos Tag_ARC_ABI_double_size, 844559860eSchristos Tag_ARC_ISA_config, 854559860eSchristos Tag_ARC_ISA_apex, 864559860eSchristos Tag_ARC_ISA_mpy_option, 874559860eSchristos Tag_ARC_ATR_version = 20 884559860eSchristos }; 894559860eSchristos 904559860eSchristos /* Values for the Tag_ARC_cpu_base attribute. */ 914559860eSchristos #define TAG_CPU_NONE 0 924559860eSchristos #define TAG_CPU_ARC6xx 1 934559860eSchristos #define TAG_CPU_ARC7xx 2 944559860eSchristos #define TAG_CPU_ARCEM 3 954559860eSchristos #define TAG_CPU_ARCHS 4 964559860eSchristos 9798b9484cSchristos #endif /* _ELF_ARC_H */ 98