Copyright 2004, 2008 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _ELF_CR16C_H
#define _ELF_CR16C_H
#include "bfd.h"
#include "elf/reloc-macros.h"
START_RELOC_NUMBERS (elf_cr16c_reloc_type)
RELOC_NUMBER (RINDEX_16C_NUM08, 0)
RELOC_NUMBER (RINDEX_16C_NUM08_C, 1)
RELOC_NUMBER (RINDEX_16C_NUM16, 2)
RELOC_NUMBER (RINDEX_16C_NUM16_C, 3)
RELOC_NUMBER (RINDEX_16C_NUM32, 4)
RELOC_NUMBER (RINDEX_16C_NUM32_C, 5)
RELOC_NUMBER (RINDEX_16C_DISP04, 6)
RELOC_NUMBER (RINDEX_16C_DISP04_C, 7)
RELOC_NUMBER (RINDEX_16C_DISP08, 8)
RELOC_NUMBER (RINDEX_16C_DISP08_C, 9)
RELOC_NUMBER (RINDEX_16C_DISP16, 10)
RELOC_NUMBER (RINDEX_16C_DISP16_C, 11)
RELOC_NUMBER (RINDEX_16C_DISP24, 12)
RELOC_NUMBER (RINDEX_16C_DISP24_C, 13)
RELOC_NUMBER (RINDEX_16C_DISP24a, 14)
RELOC_NUMBER (RINDEX_16C_DISP24a_C, 15)
RELOC_NUMBER (RINDEX_16C_REG04, 16)
RELOC_NUMBER (RINDEX_16C_REG04_C, 17)
RELOC_NUMBER (RINDEX_16C_REG04a, 18)
RELOC_NUMBER (RINDEX_16C_REG04a_C, 19)
RELOC_NUMBER (RINDEX_16C_REG14, 20)
RELOC_NUMBER (RINDEX_16C_REG14_C, 21)
RELOC_NUMBER (RINDEX_16C_REG16, 22)
RELOC_NUMBER (RINDEX_16C_REG16_C, 23)
RELOC_NUMBER (RINDEX_16C_REG20, 24)
RELOC_NUMBER (RINDEX_16C_REG20_C, 25)
RELOC_NUMBER (RINDEX_16C_ABS20, 26)
RELOC_NUMBER (RINDEX_16C_ABS20_C, 27)
RELOC_NUMBER (RINDEX_16C_ABS24, 28)
RELOC_NUMBER (RINDEX_16C_ABS24_C, 29)
RELOC_NUMBER (RINDEX_16C_IMM04, 30)
RELOC_NUMBER (RINDEX_16C_IMM04_C, 31)
RELOC_NUMBER (RINDEX_16C_IMM16, 32)
RELOC_NUMBER (RINDEX_16C_IMM16_C, 33)
RELOC_NUMBER (RINDEX_16C_IMM20, 34)
RELOC_NUMBER (RINDEX_16C_IMM20_C, 35)
RELOC_NUMBER (RINDEX_16C_IMM24, 36)
RELOC_NUMBER (RINDEX_16C_IMM24_C, 37)
RELOC_NUMBER (RINDEX_16C_IMM32, 38)
RELOC_NUMBER (RINDEX_16C_IMM32_C, 39)
END_RELOC_NUMBERS (RINDEX_16C_MAX)
The relocation constant name is determined as follows :
R_16C_<format><size>[_C]
Where :
<format> is one of the following:
NUM - R_NUMBER mnemonic,
DISP - R_16C_DISPL mnemonic,
REG - R_16C_REGREL mnemonic,
ABS - R_16C_ABS mnemonic,
IMM - R_16C_IMMED mnemonic,
<size> stands for R_S_16C_<size>
_C means 'code label' and is only added when R_ADDRTYPE subfield
is of type R_CODE_ADDR. */
relocation type constants correspond to.
------------------------------------------------------------------
R_SIZESP R_FORMAT R_RELTO R_ADDRTYPE
------------------------------------------------------------------ */
#define R_16C_NUM08 0X0001
#define R_16C_NUM08_C 0X0006
#define R_16C_NUM16 0X1001
#define R_16C_NUM16_C 0X1006
#define R_16C_NUM32 0X2001
#define R_16C_NUM32_C 0X2006
#define R_16C_DISP04 0X5411
#define R_16C_DISP04_C 0X5416
#define R_16C_DISP08 0X0411
#define R_16C_DISP08_C 0X0416
#define R_16C_DISP16 0X1411
#define R_16C_DISP16_C 0X1416
#define R_16C_DISP24 0X7411
#define R_16C_DISP24_C 0X7416
#define R_16C_DISP24a 0X6411
#define R_16C_DISP24a_C 0X6416
#define R_16C_REG04 0X5201
#define R_16C_REG04_C 0X5206
#define R_16C_REG04a 0X4201
#define R_16C_REG04a_C 0X4206
#define R_16C_REG14 0X3201
#define R_16C_REG14_C 0X3206
#define R_16C_REG16 0X1201
#define R_16C_REG16_C 0X1206
#define R_16C_REG20 0X8201
#define R_16C_REG20_C 0X8206
#define R_16C_ABS20 0X8101
#define R_16C_ABS20_C 0X8106
#define R_16C_ABS24 0X7101
#define R_16C_ABS24_C 0X7106
#define R_16C_IMM04 0X5301
#define R_16C_IMM04_C 0X5306
#define R_16C_IMM16 0X1301
#define R_16C_IMM16_C 0X1306
#define R_16C_IMM20 0X8301
#define R_16C_IMM20_C 0X8306
#define R_16C_IMM24 0X7301
#define R_16C_IMM24_C 0X7306
#define R_16C_IMM32 0X2301
#define R_16C_IMM32_C 0X2306
#define R_ADDRTYPE 0x000f
#define R_ADDRESS 0x0001 /* Take address of symbol. */
#define R_CODE_ADDR 0x0006 /* Take address of symbol divided by 2. */
#define R_RELTO 0x00f0
#define R_ABS 0x0000 /* Keep symbol's address as such. */
#define R_PCREL 0x0010 /* Subtract the pc address of hole. */
#define R_FORMAT 0x0f00
#define R_NUMBER 0x0000 /* Retain as two's complement value. */
#define R_16C_DISPL 0x0400 /* CR16C displacement type. */
#define R_16C_ABS 0x0100 /* CR16C absolute type. */
#define R_16C_REGREL 0x0200 /* CR16C register-relative type. */
#define R_16C_IMMED 0x0300 /* CR16C immediate type. */
#define R_SIZESP 0xf000
#define R_S_16C_04 0x5000
#define R_S_16C_04_a 0x4000
#define R_S_16C_08 0x0000
#define R_S_16C_14 0x3000
#define R_S_16C_16 0x1000
#define R_S_16C_20 0x8000
#define R_S_16C_24_a 0x6000
#define R_S_16C_24 0x7000
#define R_S_16C_32 0x2000
exist. Symbols with a st_shndx field corresponding to one of these
values have a special meaning. */
#define SHN_CR16C_FCOMMON SHN_LORESERVE
#define SHN_CR16C_NCOMMON (SHN_LORESERVE + 1)
typedef struct reloc_map
{
unsigned short cr_reloc_type;
bfd_reloc_code_real_type bfd_reloc_enum;
} RELOC_MAP;
#endif