1130561Sobrien/* IP2xxx ELF support for BFD.
2130561Sobrien   Copyright (C) 2000, 2002 Free Software Foundation, Inc.
3130561Sobrien
4130561Sobrien   This file is part of BFD, the Binary File Descriptor library.
5130561Sobrien
6130561Sobrien   This program is free software; you can redistribute it and/or modify
7130561Sobrien   it under the terms of the GNU General Public License as published by
8130561Sobrien   the Free Software Foundation; either version 2 of the License, or
9130561Sobrien   (at your option) any later version.
10130561Sobrien
11130561Sobrien   This program is distributed in the hope that it will be useful,
12130561Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
13130561Sobrien   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14130561Sobrien   GNU General Public License for more details.
15130561Sobrien
16130561Sobrien   You should have received a copy of the GNU General Public License
17130561Sobrien   along with this program; if not, write to the Free Software Foundation, Inc.,
18218822Sdim   51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
19130561Sobrien
20130561Sobrien#ifndef _ELF_IP2K_H
21130561Sobrien#define _ELF_IP2K_H
22130561Sobrien
23130561Sobrien#include "elf/reloc-macros.h"
24130561Sobrien
25130561Sobrien/* Relocations.  */
26130561SobrienSTART_RELOC_NUMBERS (elf_ip2k_reloc_type)
27130561Sobrien  RELOC_NUMBER (R_IP2K_NONE, 0)
28130561Sobrien  RELOC_NUMBER (R_IP2K_16, 1)
29130561Sobrien  RELOC_NUMBER (R_IP2K_32, 2)
30130561Sobrien  RELOC_NUMBER (R_IP2K_FR9, 3)
31130561Sobrien  RELOC_NUMBER (R_IP2K_BANK, 4)
32130561Sobrien  RELOC_NUMBER (R_IP2K_ADDR16CJP, 5)
33130561Sobrien  RELOC_NUMBER (R_IP2K_PAGE3, 6)
34130561Sobrien  RELOC_NUMBER (R_IP2K_LO8DATA, 7)
35130561Sobrien  RELOC_NUMBER (R_IP2K_HI8DATA, 8)
36130561Sobrien  RELOC_NUMBER (R_IP2K_LO8INSN, 9)
37130561Sobrien  RELOC_NUMBER (R_IP2K_HI8INSN, 10)
38130561Sobrien  RELOC_NUMBER (R_IP2K_PC_SKIP, 11)
39130561Sobrien  RELOC_NUMBER (R_IP2K_TEXT, 12)
40130561Sobrien  RELOC_NUMBER (R_IP2K_FR_OFFSET, 13)
41130561Sobrien  RELOC_NUMBER (R_IP2K_EX8DATA, 14)
42130561SobrienEND_RELOC_NUMBERS(R_IP2K_max)
43130561Sobrien
44130561Sobrien
45130561Sobrien/* Define the data & instruction memory discriminator.  In a linked
46130561Sobrien   executable, an symbol should be deemed to point to an instruction
47130561Sobrien   if ((address & IP2K_INSN_MASK) == IP2K_INSN_VALUE), and similarly
48130561Sobrien   for the data space.  See also `ld/emulparams/elf32ip2k.sh'.  */
49130561Sobrien/* ??? Consider extending the _MASK values to include all the
50130561Sobrien   intermediate bits that must be zero due to the limited physical
51130561Sobrien   memory size on the IP2K.  */
52130561Sobrien
53130561Sobrien#define IP2K_DATA_MASK   0xff000000
54130561Sobrien#define IP2K_DATA_VALUE  0x01000000
55130561Sobrien#define IP2K_INSN_MASK   0xff000000
56130561Sobrien#define IP2K_INSN_VALUE  0x02000000
57130561Sobrien
58130561Sobrien/* The location of the memory mapped hardware stack.  */
59130561Sobrien#define IP2K_STACK_VALUE 0x0f000000
60130561Sobrien#define IP2K_STACK_SIZE  0x20
61130561Sobrien
62130561Sobrien#endif /* _ELF_IP2K_H */
63