xref: /netbsd-src/external/gpl3/gdb/dist/include/elf/bfin.h (revision 02f41505626a9ceb584d30d0789203495760ac88)
198b9484cSchristos /* Blackfin ELF support for BFD.
2*02f41505Schristos    Copyright (C) 2005-2024 Free Software Foundation, Inc.
398b9484cSchristos 
498b9484cSchristos    This file is part of BFD, the Binary File Descriptor library.
598b9484cSchristos 
698b9484cSchristos    This program is free software; you can redistribute it and/or modify
798b9484cSchristos    it under the terms of the GNU General Public License as published by
898b9484cSchristos    the Free Software Foundation; either version 3 of the License, or
998b9484cSchristos    (at your option) any later version.
1098b9484cSchristos 
1198b9484cSchristos    This program is distributed in the hope that it will be useful,
1298b9484cSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
1398b9484cSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1498b9484cSchristos    GNU General Public License for more details.
1598b9484cSchristos 
1698b9484cSchristos    You should have received a copy of the GNU General Public License
1798b9484cSchristos    along with this program; if not, write to the Free Software Foundation,
1898b9484cSchristos    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
1998b9484cSchristos 
2098b9484cSchristos #ifndef _ELF_BFIN_H
2198b9484cSchristos #define _ELF_BFIN_H
2298b9484cSchristos 
2398b9484cSchristos #include "elf/reloc-macros.h"
2498b9484cSchristos 
2598b9484cSchristos START_RELOC_NUMBERS (elf_bfin_reloc_type)
2698b9484cSchristos   RELOC_NUMBER (R_BFIN_UNUSED0, 0x00)          /* relocation type 0 is not defined */
2798b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL5M2, 0x01)         /* LSETUP part a */
2898b9484cSchristos   RELOC_NUMBER (R_BFIN_UNUSED1, 0x02)          /* relocation type 2 is not defined */
2998b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL10, 0x03)          /* type 3, 0x00) if cc jump <target> */
3098b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL12_JUMP, 0x04)     /* type 4, 0x00) jump <target> */
3198b9484cSchristos   RELOC_NUMBER (R_BFIN_RIMM16, 0x05)           /* type 0x5, 0x00) rN = <target> */
3298b9484cSchristos   RELOC_NUMBER (R_BFIN_LUIMM16, 0x06)          /* # 0x6, 0x00) preg.l=<target> Load imm 16 to lower half */
3398b9484cSchristos   RELOC_NUMBER (R_BFIN_HUIMM16, 0x07)          /* # 0x7, 0x00) preg.h=<target> Load imm 16 to upper half */
3498b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL12_JUMP_S, 0x08)   /* # 0x8 jump.s <target> */
3598b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL24_JUMP_X, 0x09)   /* # 0x9 jump.x <target> */
3698b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL24, 0x0a)          /* # 0xa call <target> , 0x00) not expandable */
3798b9484cSchristos   RELOC_NUMBER (R_BFIN_UNUSEDB, 0x0b)          /* # 0xb not generated */
3898b9484cSchristos   RELOC_NUMBER (R_BFIN_UNUSEDC, 0x0c)          /* # 0xc  not used */
3998b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL24_JUMP_L, 0x0d)   /* 0xd jump.l <target> */
4098b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL24_CALL_X, 0x0e)   /* 0xE, 0x00) call.x <target> if <target> is above 24 bit limit call through P1 */
4198b9484cSchristos   RELOC_NUMBER (R_BFIN_VAR_EQ_SYMB, 0x0f)      /* 0xf, 0x00) linker should treat it same as 0x12 */
4298b9484cSchristos   RELOC_NUMBER (R_BFIN_BYTE_DATA, 0x10)        /* 0x10, 0x00) .byte var = symbol */
4398b9484cSchristos   RELOC_NUMBER (R_BFIN_BYTE2_DATA, 0x11)       /* 0x11, 0x00) .byte2 var = symbol */
4498b9484cSchristos   RELOC_NUMBER (R_BFIN_BYTE4_DATA, 0x12)       /* 0x12, 0x00) .byte4 var = symbol and .var var=symbol */
4598b9484cSchristos   RELOC_NUMBER (R_BFIN_PCREL11, 0x13)          /* 0x13, 0x00) lsetup part b */
4698b9484cSchristos   RELOC_NUMBER (R_BFIN_GOT17M4, 0x14)
4798b9484cSchristos   RELOC_NUMBER (R_BFIN_GOTHI, 0x15)
4898b9484cSchristos   RELOC_NUMBER (R_BFIN_GOTLO, 0x16)
4998b9484cSchristos   RELOC_NUMBER (R_BFIN_FUNCDESC, 0x17)
5098b9484cSchristos   RELOC_NUMBER (R_BFIN_FUNCDESC_GOT17M4, 0x18)
5198b9484cSchristos   RELOC_NUMBER (R_BFIN_FUNCDESC_GOTHI, 0x19)
5298b9484cSchristos   RELOC_NUMBER (R_BFIN_FUNCDESC_GOTLO, 0x1a)
5398b9484cSchristos   RELOC_NUMBER (R_BFIN_FUNCDESC_VALUE, 0x1b)
5498b9484cSchristos   RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFF17M4, 0x1c)
5598b9484cSchristos   RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFHI, 0x1d)
5698b9484cSchristos   RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFLO, 0x1e)
5798b9484cSchristos   RELOC_NUMBER (R_BFIN_GOTOFF17M4, 0x1f)
5898b9484cSchristos   RELOC_NUMBER (R_BFIN_GOTOFFHI, 0x20)
5998b9484cSchristos   RELOC_NUMBER (R_BFIN_GOTOFFLO, 0x21)
6098b9484cSchristos 
6198b9484cSchristos   RELOC_NUMBER (R_BFIN_PUSH, 0xE0)
6298b9484cSchristos   RELOC_NUMBER (R_BFIN_CONST, 0xE1)
6398b9484cSchristos   RELOC_NUMBER (R_BFIN_ADD, 0xE2)
6498b9484cSchristos   RELOC_NUMBER (R_BFIN_SUB, 0xE3)
6598b9484cSchristos   RELOC_NUMBER (R_BFIN_MULT, 0xE4)
6698b9484cSchristos   RELOC_NUMBER (R_BFIN_DIV, 0xE5)
6798b9484cSchristos   RELOC_NUMBER (R_BFIN_MOD, 0xE6)
6898b9484cSchristos   RELOC_NUMBER (R_BFIN_LSHIFT, 0xE7)
6998b9484cSchristos   RELOC_NUMBER (R_BFIN_RSHIFT, 0xE8)
7098b9484cSchristos   RELOC_NUMBER (R_BFIN_AND, 0xE9)
7198b9484cSchristos   RELOC_NUMBER (R_BFIN_OR, 0xEA)
7298b9484cSchristos   RELOC_NUMBER (R_BFIN_XOR, 0xEB)
7398b9484cSchristos   RELOC_NUMBER (R_BFIN_LAND, 0xEC)
7498b9484cSchristos   RELOC_NUMBER (R_BFIN_LOR, 0xED)
7598b9484cSchristos   RELOC_NUMBER (R_BFIN_LEN, 0xEE)
7698b9484cSchristos   RELOC_NUMBER (R_BFIN_NEG, 0xEF)
7798b9484cSchristos   RELOC_NUMBER (R_BFIN_COMP, 0xF0)
7898b9484cSchristos   RELOC_NUMBER (R_BFIN_PAGE, 0xF1)
7998b9484cSchristos   RELOC_NUMBER (R_BFIN_HWPAGE, 0xF2)
8098b9484cSchristos   RELOC_NUMBER (R_BFIN_ADDR, 0xF3)
8198b9484cSchristos   RELOC_NUMBER (R_BFIN_PLTPC, 0x40)         /* PLT gnu only relocation */
8298b9484cSchristos   RELOC_NUMBER (R_BFIN_GOT, 0x41)           /* GOT gnu only relocation */
8398b9484cSchristos   RELOC_NUMBER (R_BFIN_GNU_VTINHERIT, 0x42) /* C++, gnu only */
8498b9484cSchristos   RELOC_NUMBER (R_BFIN_GNU_VTENTRY, 0x43) /* C++, gnu only */
8598b9484cSchristos END_RELOC_NUMBERS (R_BFIN_max)
8698b9484cSchristos 
8798b9484cSchristos /* Processor specific flags for the ELF header e_flags field.  */
8898b9484cSchristos #define EF_BFIN_PIC		0x00000001	/* -fpic */
8998b9484cSchristos #define EF_BFIN_FDPIC		0x00000002      /* -mfdpic */
9098b9484cSchristos 
9198b9484cSchristos #define EF_BFIN_CODE_IN_L1	0x00000010	/* --code-in-l1 */
9298b9484cSchristos #define EF_BFIN_DATA_IN_L1	0x00000020	/* --data-in-l1 */
9398b9484cSchristos 
9498b9484cSchristos #define	EF_BFIN_PIC_FLAGS	(EF_BFIN_PIC | EF_BFIN_FDPIC)
9598b9484cSchristos #endif /* _ELF_BFIN_H */
96