2005-09-30 23:12:52 +08:00
|
|
|
/* Blackfin ELF support for BFD.
|
2010-04-15 18:26:09 +08:00
|
|
|
Copyright (C) 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
|
2005-09-30 23:12:52 +08:00
|
|
|
|
2010-04-15 18:26:09 +08:00
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
2005-09-30 23:12:52 +08:00
|
|
|
|
2010-04-15 18:26:09 +08:00
|
|
|
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 3 of the License, or
|
|
|
|
(at your option) any later version.
|
2005-09-30 23:12:52 +08:00
|
|
|
|
2010-04-15 18:26:09 +08:00
|
|
|
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.
|
2005-09-30 23:12:52 +08:00
|
|
|
|
2010-04-15 18:26:09 +08:00
|
|
|
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. */
|
2005-09-30 23:12:52 +08:00
|
|
|
|
|
|
|
#ifndef _ELF_BFIN_H
|
|
|
|
#define _ELF_BFIN_H
|
bfd/
From Mike Frysinger <michael.frysinger@analog.com>
* elf32-bfin.c (bfin_howto_table, bfin_reloc_map, bfin_check_relocs,
bfin_final_link_relocate, bfin_relocate_section, bfin_gc_sweep_hook,
_bfinfdpic_emit_got_relocs_plt_entries, bfinfdpic_relocate_section,
bfinfdpic_gc_sweep_hook, bfinfdpic_check_relocs,
bfin_finish_dynamic_symbol, bfd_bfin_elf32_create_embedded_relocs):
Adjust to match the renamed reloc definitions.
gas/testsuite/
From Mike Frysinger <michael.frysinger@analog.com>
* gas/bfin/reloc.d: Adjust for the renamed relocations.
include/elf/
From Mike Frysinger <michael.frysinger@analog.com>
* bfin.h (R_BFIN_UNUSED, R_BFIN_PCREL5M2, R_BFIN_UNUSED1,
R_BFIN_PCREL10, R_BFIN_PCREL12_JUMP, R_BFIN_RIMM16,
R_BFIN_LUIMM16, R_BFIN_HUIMM16, R_BFIN_PCREL12_JUMP_S,
R_BFIN_PCREL24_JUMP_X, R_BFIN_PCREL24, R_BFIN_UNUSEDB,
R_BFIN_UNUSEDC, R_BFIN_PCREL24_JUMP_L, R_BFIN_PCREL24_CALL_X,
R_BFIN_VAR_EQ_SYMB, R_BFIN_BYTE_DATA, R_BFIN_BYTE2_DATA,
R_BFIN_BYTE4_DATA, R_BFIN_PCREL11, R_BFIN_PUSH, R_BFIN_CONST,
R_BFIN_ADD, R_BFIN_SUB, R_BFIN_MULT, R_BFIN_DIV, R_BFIN_MOD,
R_BFIN_LSHIFT, R_BFIN_RSHIFT, R_BFIN_AND, R_BFIN_OR, R_BFIN_XOR,
R_BFIN_LAND, R_BFIN_LOR, R_BFIN_LEN, R_BFIN_NEG, R_BFIN_COMP,
R_BFIN_PAGE, R_BFIN_HWPAGE, R_BFIN_ADDR, R_BFIN_PLTPLC,
R_BFIN_GOT, R_BFIN_MAX): Renamed from R_unused0, R_pcrel5ms,
R_unused1, R_pcrel10, R_pcrel12_jump, R_rimm16, R_luimm16,
R_huimm16, R_pcrel12_jump_s, R_pcrel24_jump_x, R_pcrel24,
R_unusedb, R_unusedc, R_pcrel24_jump_l, R_pcrel24_call_x,
R_var_eq_symb, R_byte_data, R_byte2_data, R_byte4_data, R_pcrel11,
R_push, R_const, R_add, R_sub, R_mult, R_div, R_mod, R_lshift,
R_rshift, R_and, R_or, R_xor, R_land, R_lor, R_len, R_neg, R_comp,
R_page, R_hwpage, R_addr, R_pltpc, R_got.
2009-08-10 00:45:05 +08:00
|
|
|
|
2005-09-30 23:12:52 +08:00
|
|
|
#include "elf/reloc-macros.h"
|
|
|
|
|
|
|
|
START_RELOC_NUMBERS (elf_bfin_reloc_type)
|
bfd/
From Mike Frysinger <michael.frysinger@analog.com>
* elf32-bfin.c (bfin_howto_table, bfin_reloc_map, bfin_check_relocs,
bfin_final_link_relocate, bfin_relocate_section, bfin_gc_sweep_hook,
_bfinfdpic_emit_got_relocs_plt_entries, bfinfdpic_relocate_section,
bfinfdpic_gc_sweep_hook, bfinfdpic_check_relocs,
bfin_finish_dynamic_symbol, bfd_bfin_elf32_create_embedded_relocs):
Adjust to match the renamed reloc definitions.
gas/testsuite/
From Mike Frysinger <michael.frysinger@analog.com>
* gas/bfin/reloc.d: Adjust for the renamed relocations.
include/elf/
From Mike Frysinger <michael.frysinger@analog.com>
* bfin.h (R_BFIN_UNUSED, R_BFIN_PCREL5M2, R_BFIN_UNUSED1,
R_BFIN_PCREL10, R_BFIN_PCREL12_JUMP, R_BFIN_RIMM16,
R_BFIN_LUIMM16, R_BFIN_HUIMM16, R_BFIN_PCREL12_JUMP_S,
R_BFIN_PCREL24_JUMP_X, R_BFIN_PCREL24, R_BFIN_UNUSEDB,
R_BFIN_UNUSEDC, R_BFIN_PCREL24_JUMP_L, R_BFIN_PCREL24_CALL_X,
R_BFIN_VAR_EQ_SYMB, R_BFIN_BYTE_DATA, R_BFIN_BYTE2_DATA,
R_BFIN_BYTE4_DATA, R_BFIN_PCREL11, R_BFIN_PUSH, R_BFIN_CONST,
R_BFIN_ADD, R_BFIN_SUB, R_BFIN_MULT, R_BFIN_DIV, R_BFIN_MOD,
R_BFIN_LSHIFT, R_BFIN_RSHIFT, R_BFIN_AND, R_BFIN_OR, R_BFIN_XOR,
R_BFIN_LAND, R_BFIN_LOR, R_BFIN_LEN, R_BFIN_NEG, R_BFIN_COMP,
R_BFIN_PAGE, R_BFIN_HWPAGE, R_BFIN_ADDR, R_BFIN_PLTPLC,
R_BFIN_GOT, R_BFIN_MAX): Renamed from R_unused0, R_pcrel5ms,
R_unused1, R_pcrel10, R_pcrel12_jump, R_rimm16, R_luimm16,
R_huimm16, R_pcrel12_jump_s, R_pcrel24_jump_x, R_pcrel24,
R_unusedb, R_unusedc, R_pcrel24_jump_l, R_pcrel24_call_x,
R_var_eq_symb, R_byte_data, R_byte2_data, R_byte4_data, R_pcrel11,
R_push, R_const, R_add, R_sub, R_mult, R_div, R_mod, R_lshift,
R_rshift, R_and, R_or, R_xor, R_land, R_lor, R_len, R_neg, R_comp,
R_page, R_hwpage, R_addr, R_pltpc, R_got.
2009-08-10 00:45:05 +08:00
|
|
|
RELOC_NUMBER (R_BFIN_UNUSED0, 0x00) /* relocation type 0 is not defined */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL5M2, 0x01) /* LSETUP part a */
|
|
|
|
RELOC_NUMBER (R_BFIN_UNUSED1, 0x02) /* relocation type 2 is not defined */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL10, 0x03) /* type 3, 0x00) if cc jump <target> */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL12_JUMP, 0x04) /* type 4, 0x00) jump <target> */
|
|
|
|
RELOC_NUMBER (R_BFIN_RIMM16, 0x05) /* type 0x5, 0x00) rN = <target> */
|
|
|
|
RELOC_NUMBER (R_BFIN_LUIMM16, 0x06) /* # 0x6, 0x00) preg.l=<target> Load imm 16 to lower half */
|
|
|
|
RELOC_NUMBER (R_BFIN_HUIMM16, 0x07) /* # 0x7, 0x00) preg.h=<target> Load imm 16 to upper half */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL12_JUMP_S, 0x08) /* # 0x8 jump.s <target> */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL24_JUMP_X, 0x09) /* # 0x9 jump.x <target> */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL24, 0x0a) /* # 0xa call <target> , 0x00) not expandable */
|
|
|
|
RELOC_NUMBER (R_BFIN_UNUSEDB, 0x0b) /* # 0xb not generated */
|
|
|
|
RELOC_NUMBER (R_BFIN_UNUSEDC, 0x0c) /* # 0xc not used */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL24_JUMP_L, 0x0d) /* 0xd jump.l <target> */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL24_CALL_X, 0x0e) /* 0xE, 0x00) call.x <target> if <target> is above 24 bit limit call through P1 */
|
|
|
|
RELOC_NUMBER (R_BFIN_VAR_EQ_SYMB, 0x0f) /* 0xf, 0x00) linker should treat it same as 0x12 */
|
|
|
|
RELOC_NUMBER (R_BFIN_BYTE_DATA, 0x10) /* 0x10, 0x00) .byte var = symbol */
|
|
|
|
RELOC_NUMBER (R_BFIN_BYTE2_DATA, 0x11) /* 0x11, 0x00) .byte2 var = symbol */
|
|
|
|
RELOC_NUMBER (R_BFIN_BYTE4_DATA, 0x12) /* 0x12, 0x00) .byte4 var = symbol and .var var=symbol */
|
|
|
|
RELOC_NUMBER (R_BFIN_PCREL11, 0x13) /* 0x13, 0x00) lsetup part b */
|
* elf/bfin.h (R_BFIN_GOT17M4, R_BFIN_GOTHI, R_BFIN_GOTLO,
R_BFIN_FUNCDESC, R_BFIN_FUNCDESC_GOT17M4, R_BFIN_FUNCDESC_GOTHI,
R_BFIN_FUNCDESC_GOTLO, R_BFIN_FUNCDESC_VALUE,
R_BFIN_FUNCDESC_GOTOFF17M4, R_BFIN_FUNCDESC_GOTOFFHI,
R_BFIN_FUNCDESC_GOTOFFLO, R_BFIN_GOTOFF17M4, R_BFIN_GOTOFFHI,
R_BFIN_GOTOFFLO): New relocs.
(EF_BFIN_PIC, EF_BFIN_FDPIC, EF_BFIN_PIC_FLAGS): New macros.
2006-03-26 02:21:47 +08:00
|
|
|
RELOC_NUMBER (R_BFIN_GOT17M4, 0x14)
|
|
|
|
RELOC_NUMBER (R_BFIN_GOTHI, 0x15)
|
|
|
|
RELOC_NUMBER (R_BFIN_GOTLO, 0x16)
|
|
|
|
RELOC_NUMBER (R_BFIN_FUNCDESC, 0x17)
|
|
|
|
RELOC_NUMBER (R_BFIN_FUNCDESC_GOT17M4, 0x18)
|
|
|
|
RELOC_NUMBER (R_BFIN_FUNCDESC_GOTHI, 0x19)
|
|
|
|
RELOC_NUMBER (R_BFIN_FUNCDESC_GOTLO, 0x1a)
|
|
|
|
RELOC_NUMBER (R_BFIN_FUNCDESC_VALUE, 0x1b)
|
|
|
|
RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFF17M4, 0x1c)
|
|
|
|
RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFHI, 0x1d)
|
|
|
|
RELOC_NUMBER (R_BFIN_FUNCDESC_GOTOFFLO, 0x1e)
|
|
|
|
RELOC_NUMBER (R_BFIN_GOTOFF17M4, 0x1f)
|
|
|
|
RELOC_NUMBER (R_BFIN_GOTOFFHI, 0x20)
|
|
|
|
RELOC_NUMBER (R_BFIN_GOTOFFLO, 0x21)
|
|
|
|
|
bfd/
From Mike Frysinger <michael.frysinger@analog.com>
* elf32-bfin.c (bfin_howto_table, bfin_reloc_map, bfin_check_relocs,
bfin_final_link_relocate, bfin_relocate_section, bfin_gc_sweep_hook,
_bfinfdpic_emit_got_relocs_plt_entries, bfinfdpic_relocate_section,
bfinfdpic_gc_sweep_hook, bfinfdpic_check_relocs,
bfin_finish_dynamic_symbol, bfd_bfin_elf32_create_embedded_relocs):
Adjust to match the renamed reloc definitions.
gas/testsuite/
From Mike Frysinger <michael.frysinger@analog.com>
* gas/bfin/reloc.d: Adjust for the renamed relocations.
include/elf/
From Mike Frysinger <michael.frysinger@analog.com>
* bfin.h (R_BFIN_UNUSED, R_BFIN_PCREL5M2, R_BFIN_UNUSED1,
R_BFIN_PCREL10, R_BFIN_PCREL12_JUMP, R_BFIN_RIMM16,
R_BFIN_LUIMM16, R_BFIN_HUIMM16, R_BFIN_PCREL12_JUMP_S,
R_BFIN_PCREL24_JUMP_X, R_BFIN_PCREL24, R_BFIN_UNUSEDB,
R_BFIN_UNUSEDC, R_BFIN_PCREL24_JUMP_L, R_BFIN_PCREL24_CALL_X,
R_BFIN_VAR_EQ_SYMB, R_BFIN_BYTE_DATA, R_BFIN_BYTE2_DATA,
R_BFIN_BYTE4_DATA, R_BFIN_PCREL11, R_BFIN_PUSH, R_BFIN_CONST,
R_BFIN_ADD, R_BFIN_SUB, R_BFIN_MULT, R_BFIN_DIV, R_BFIN_MOD,
R_BFIN_LSHIFT, R_BFIN_RSHIFT, R_BFIN_AND, R_BFIN_OR, R_BFIN_XOR,
R_BFIN_LAND, R_BFIN_LOR, R_BFIN_LEN, R_BFIN_NEG, R_BFIN_COMP,
R_BFIN_PAGE, R_BFIN_HWPAGE, R_BFIN_ADDR, R_BFIN_PLTPLC,
R_BFIN_GOT, R_BFIN_MAX): Renamed from R_unused0, R_pcrel5ms,
R_unused1, R_pcrel10, R_pcrel12_jump, R_rimm16, R_luimm16,
R_huimm16, R_pcrel12_jump_s, R_pcrel24_jump_x, R_pcrel24,
R_unusedb, R_unusedc, R_pcrel24_jump_l, R_pcrel24_call_x,
R_var_eq_symb, R_byte_data, R_byte2_data, R_byte4_data, R_pcrel11,
R_push, R_const, R_add, R_sub, R_mult, R_div, R_mod, R_lshift,
R_rshift, R_and, R_or, R_xor, R_land, R_lor, R_len, R_neg, R_comp,
R_page, R_hwpage, R_addr, R_pltpc, R_got.
2009-08-10 00:45:05 +08:00
|
|
|
RELOC_NUMBER (R_BFIN_PUSH, 0xE0)
|
|
|
|
RELOC_NUMBER (R_BFIN_CONST, 0xE1)
|
|
|
|
RELOC_NUMBER (R_BFIN_ADD, 0xE2)
|
|
|
|
RELOC_NUMBER (R_BFIN_SUB, 0xE3)
|
|
|
|
RELOC_NUMBER (R_BFIN_MULT, 0xE4)
|
|
|
|
RELOC_NUMBER (R_BFIN_DIV, 0xE5)
|
|
|
|
RELOC_NUMBER (R_BFIN_MOD, 0xE6)
|
|
|
|
RELOC_NUMBER (R_BFIN_LSHIFT, 0xE7)
|
|
|
|
RELOC_NUMBER (R_BFIN_RSHIFT, 0xE8)
|
|
|
|
RELOC_NUMBER (R_BFIN_AND, 0xE9)
|
|
|
|
RELOC_NUMBER (R_BFIN_OR, 0xEA)
|
|
|
|
RELOC_NUMBER (R_BFIN_XOR, 0xEB)
|
|
|
|
RELOC_NUMBER (R_BFIN_LAND, 0xEC)
|
|
|
|
RELOC_NUMBER (R_BFIN_LOR, 0xED)
|
|
|
|
RELOC_NUMBER (R_BFIN_LEN, 0xEE)
|
|
|
|
RELOC_NUMBER (R_BFIN_NEG, 0xEF)
|
|
|
|
RELOC_NUMBER (R_BFIN_COMP, 0xF0)
|
|
|
|
RELOC_NUMBER (R_BFIN_PAGE, 0xF1)
|
|
|
|
RELOC_NUMBER (R_BFIN_HWPAGE, 0xF2)
|
|
|
|
RELOC_NUMBER (R_BFIN_ADDR, 0xF3)
|
|
|
|
RELOC_NUMBER (R_BFIN_PLTPC, 0x40) /* PLT gnu only relocation */
|
|
|
|
RELOC_NUMBER (R_BFIN_GOT, 0x41) /* GOT gnu only relocation */
|
2005-09-30 23:12:52 +08:00
|
|
|
RELOC_NUMBER (R_BFIN_GNU_VTINHERIT, 0x42) /* C++, gnu only */
|
|
|
|
RELOC_NUMBER (R_BFIN_GNU_VTENTRY, 0x43) /* C++, gnu only */
|
bfd/
From Mike Frysinger <michael.frysinger@analog.com>
* elf32-bfin.c (bfin_howto_table, bfin_reloc_map, bfin_check_relocs,
bfin_final_link_relocate, bfin_relocate_section, bfin_gc_sweep_hook,
_bfinfdpic_emit_got_relocs_plt_entries, bfinfdpic_relocate_section,
bfinfdpic_gc_sweep_hook, bfinfdpic_check_relocs,
bfin_finish_dynamic_symbol, bfd_bfin_elf32_create_embedded_relocs):
Adjust to match the renamed reloc definitions.
gas/testsuite/
From Mike Frysinger <michael.frysinger@analog.com>
* gas/bfin/reloc.d: Adjust for the renamed relocations.
include/elf/
From Mike Frysinger <michael.frysinger@analog.com>
* bfin.h (R_BFIN_UNUSED, R_BFIN_PCREL5M2, R_BFIN_UNUSED1,
R_BFIN_PCREL10, R_BFIN_PCREL12_JUMP, R_BFIN_RIMM16,
R_BFIN_LUIMM16, R_BFIN_HUIMM16, R_BFIN_PCREL12_JUMP_S,
R_BFIN_PCREL24_JUMP_X, R_BFIN_PCREL24, R_BFIN_UNUSEDB,
R_BFIN_UNUSEDC, R_BFIN_PCREL24_JUMP_L, R_BFIN_PCREL24_CALL_X,
R_BFIN_VAR_EQ_SYMB, R_BFIN_BYTE_DATA, R_BFIN_BYTE2_DATA,
R_BFIN_BYTE4_DATA, R_BFIN_PCREL11, R_BFIN_PUSH, R_BFIN_CONST,
R_BFIN_ADD, R_BFIN_SUB, R_BFIN_MULT, R_BFIN_DIV, R_BFIN_MOD,
R_BFIN_LSHIFT, R_BFIN_RSHIFT, R_BFIN_AND, R_BFIN_OR, R_BFIN_XOR,
R_BFIN_LAND, R_BFIN_LOR, R_BFIN_LEN, R_BFIN_NEG, R_BFIN_COMP,
R_BFIN_PAGE, R_BFIN_HWPAGE, R_BFIN_ADDR, R_BFIN_PLTPLC,
R_BFIN_GOT, R_BFIN_MAX): Renamed from R_unused0, R_pcrel5ms,
R_unused1, R_pcrel10, R_pcrel12_jump, R_rimm16, R_luimm16,
R_huimm16, R_pcrel12_jump_s, R_pcrel24_jump_x, R_pcrel24,
R_unusedb, R_unusedc, R_pcrel24_jump_l, R_pcrel24_call_x,
R_var_eq_symb, R_byte_data, R_byte2_data, R_byte4_data, R_pcrel11,
R_push, R_const, R_add, R_sub, R_mult, R_div, R_mod, R_lshift,
R_rshift, R_and, R_or, R_xor, R_land, R_lor, R_len, R_neg, R_comp,
R_page, R_hwpage, R_addr, R_pltpc, R_got.
2009-08-10 00:45:05 +08:00
|
|
|
END_RELOC_NUMBERS (R_BFIN_max)
|
2005-09-30 23:12:52 +08:00
|
|
|
|
* elf/bfin.h (R_BFIN_GOT17M4, R_BFIN_GOTHI, R_BFIN_GOTLO,
R_BFIN_FUNCDESC, R_BFIN_FUNCDESC_GOT17M4, R_BFIN_FUNCDESC_GOTHI,
R_BFIN_FUNCDESC_GOTLO, R_BFIN_FUNCDESC_VALUE,
R_BFIN_FUNCDESC_GOTOFF17M4, R_BFIN_FUNCDESC_GOTOFFHI,
R_BFIN_FUNCDESC_GOTOFFLO, R_BFIN_GOTOFF17M4, R_BFIN_GOTOFFHI,
R_BFIN_GOTOFFLO): New relocs.
(EF_BFIN_PIC, EF_BFIN_FDPIC, EF_BFIN_PIC_FLAGS): New macros.
2006-03-26 02:21:47 +08:00
|
|
|
/* Processor specific flags for the ELF header e_flags field. */
|
|
|
|
#define EF_BFIN_PIC 0x00000001 /* -fpic */
|
|
|
|
#define EF_BFIN_FDPIC 0x00000002 /* -mfdpic */
|
|
|
|
|
|
|
|
#define EF_BFIN_PIC_FLAGS (EF_BFIN_PIC | EF_BFIN_FDPIC)
|
2005-09-30 23:12:52 +08:00
|
|
|
#endif /* _ELF_BFIN_H */
|