1214082Sdim/* Blackfin ELF support for BFD.
2214082Sdim   Copyright (C) 2005 Free Software Foundation, Inc.
3214082Sdim
4214082SdimThis file is part of BFD, the Binary File Descriptor library.
5214082Sdim
6214082SdimThis program is free software; you can redistribute it and/or modify
7214082Sdimit under the terms of the GNU General Public License as published by
8214082Sdimthe Free Software Foundation; either version 2 of the License, or
9214082Sdim(at your option) any later version.
10214082Sdim
11214082SdimThis program is distributed in the hope that it will be useful,
12214082Sdimbut WITHOUT ANY WARRANTY; without even the implied warranty of
13214082SdimMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14214082SdimGNU General Public License for more details.
15214082Sdim
16214082SdimYou should have received a copy of the GNU General Public License
17214082Sdimalong with this program; if not, write to the Free Software Foundation, Inc.,
18214082Sdim51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
19214082Sdim
20214082Sdim#ifndef _ELF_BFIN_H
21214082Sdim#define _ELF_BFIN_H
22214082Sdim
23214082Sdim#include "elf/reloc-macros.h"
24214082Sdim
25214082SdimSTART_RELOC_NUMBERS (elf_bfin_reloc_type)
26214082Sdim  RELOC_NUMBER (R_unused0, 0x00) /* relocation type 0 is not defined*/
27214082Sdim  RELOC_NUMBER (R_pcrel5m2, 0x01) /*LSETUP part a*/
28214082Sdim  RELOC_NUMBER (R_unused1, 0x02) /* relocation type 2 is not defined*/
29214082Sdim  RELOC_NUMBER (R_pcrel10, 0x03) /* type 3, 0x00) if cc jump <target>  */
30214082Sdim  RELOC_NUMBER (R_pcrel12_jump, 0x04) /* type 4, 0x00) jump <target> */
31214082Sdim  RELOC_NUMBER (R_rimm16, 0x05)    /* type 0x5, 0x00) rN = <target> */
32214082Sdim  RELOC_NUMBER (R_luimm16, 0x06)  /* # 0x6, 0x00) preg.l=<target> Load imm 16 to lower half */
33214082Sdim  RELOC_NUMBER (R_huimm16, 0x07)  /* # 0x7, 0x00) preg.h=<target> Load imm 16 to upper half*/
34214082Sdim  RELOC_NUMBER (R_pcrel12_jump_s, 0x08) /* # 0x8 jump.s <target> */
35214082Sdim  RELOC_NUMBER (R_pcrel24_jump_x, 0x09) /* # 0x9 jump.x <target> */
36214082Sdim  RELOC_NUMBER (R_pcrel24, 0x0a)        /* # 0xa call <target> , 0x00) not expandable*/
37214082Sdim  RELOC_NUMBER (R_unusedb, 0x0b)         /* # 0xb not generated */
38214082Sdim  RELOC_NUMBER (R_unusedc, 0x0c)       /* # 0xc  not used */
39214082Sdim  RELOC_NUMBER (R_pcrel24_jump_l, 0x0d) /*0xd jump.l <target>*/
40214082Sdim  RELOC_NUMBER (R_pcrel24_call_x, 0x0e) /* 0xE, 0x00) call.x <target> if <target> is above 24 bit limit call through P1 */
41214082Sdim  RELOC_NUMBER (R_var_eq_symb, 0x0f)    /* 0xf, 0x00) linker should treat it same as 0x12 */
42214082Sdim  RELOC_NUMBER (R_byte_data, 0x10)      /* 0x10, 0x00) .byte var = symbol */
43214082Sdim  RELOC_NUMBER (R_byte2_data, 0x11)     /* 0x11, 0x00) .byte2 var = symbol */
44214082Sdim  RELOC_NUMBER (R_byte4_data, 0x12)     /* 0x12, 0x00) .byte4 var = symbol and .var var=symbol */
45214082Sdim  RELOC_NUMBER (R_pcrel11, 0x13)        /* 0x13, 0x00) lsetup part b */
46214082Sdim  RELOC_NUMBER (R_BFIN_GOT17M4, 0x14)
47214082Sdim  RELOC_NUMBER (R_BFIN_GOTHI, 0x15)
48214082Sdim  RELOC_NUMBER (R_BFIN_GOTLO, 0x16)
49214082Sdim  RELOC_NUMBER (R_BFIN_FUNCDESC, 0x17)
50214082Sdim  RELOC_NUMBER (R_BFIN_FUNCDESC_GOT17M4, 0x18)
51214082Sdim  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTHI, 0x19)
52214082Sdim  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTLO, 0x1a)
53214082Sdim  RELOC_NUMBER (R_BFIN_FUNCDESC_VALUE, 0x1b)
54214082Sdim  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFF17M4, 0x1c)
55214082Sdim  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFHI, 0x1d)
56214082Sdim  RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFLO, 0x1e)
57214082Sdim  RELOC_NUMBER (R_BFIN_GOTOFF17M4, 0x1f)
58214082Sdim  RELOC_NUMBER (R_BFIN_GOTOFFHI, 0x20)
59214082Sdim  RELOC_NUMBER (R_BFIN_GOTOFFLO, 0x21)
60214082Sdim
61214082Sdim  RELOC_NUMBER (R_push, 0xE0)
62214082Sdim  RELOC_NUMBER (R_const, 0xE1)
63214082Sdim  RELOC_NUMBER (R_add, 0xE2)
64214082Sdim  RELOC_NUMBER (R_sub, 0xE3)
65214082Sdim  RELOC_NUMBER (R_mult, 0xE4)
66214082Sdim  RELOC_NUMBER (R_div, 0xE5)
67214082Sdim  RELOC_NUMBER (R_mod, 0xE6)
68214082Sdim  RELOC_NUMBER (R_lshift, 0xE7)
69214082Sdim  RELOC_NUMBER (R_rshift, 0xE8)
70214082Sdim  RELOC_NUMBER (R_and, 0xE9)
71214082Sdim  RELOC_NUMBER (R_or, 0xEA)
72214082Sdim  RELOC_NUMBER (R_xor, 0xEB)
73214082Sdim  RELOC_NUMBER (R_land, 0xEC)
74214082Sdim  RELOC_NUMBER (R_lor, 0xED)
75214082Sdim  RELOC_NUMBER (R_len, 0xEE)
76214082Sdim  RELOC_NUMBER (R_neg, 0xEF)
77214082Sdim  RELOC_NUMBER (R_comp, 0xF0)
78214082Sdim  RELOC_NUMBER (R_page, 0xF1)
79214082Sdim  RELOC_NUMBER (R_hwpage, 0xF2)
80214082Sdim  RELOC_NUMBER (R_addr, 0xF3)
81214082Sdim  RELOC_NUMBER (R_pltpc, 0x40)          /* PLT gnu only relocation */
82214082Sdim  RELOC_NUMBER (R_got, 0x41)            /* GOT gnu only relocation */
83214082Sdim  RELOC_NUMBER (R_BFIN_GNU_VTINHERIT, 0x42) /* C++, gnu only */
84214082Sdim  RELOC_NUMBER (R_BFIN_GNU_VTENTRY, 0x43) /* C++, gnu only */
85214082SdimEND_RELOC_NUMBERS (R_max)
86214082Sdim
87214082Sdim/* Processor specific flags for the ELF header e_flags field.  */
88214082Sdim#define EF_BFIN_PIC		0x00000001	/* -fpic */
89214082Sdim#define EF_BFIN_FDPIC		0x00000002      /* -mfdpic */
90214082Sdim
91214082Sdim#define	EF_BFIN_PIC_FLAGS	(EF_BFIN_PIC | EF_BFIN_FDPIC)
92214082Sdim#endif /* _ELF_BFIN_H */
93