From caed712042c10c84bbf25a266988874679813689 Mon Sep 17 00:00:00 2001 From: Yufeng Zhang Date: Wed, 26 Jun 2013 10:49:29 +0000 Subject: [AArch64, ILP32] 4/6 Split elfnn-aarch64.c to elfxx-aarch64.c bfd/ * Makefile.am (BFD64_BACKENDS): Add elfxx-aarch64.c. (BFD64_BACKENDS_CFILES): Add elfxx-aarch64.lo. * Makefile.in: Re-generated. * configure.in (bfd_elf64_bigaarch64_vec): Add elfxx-aarch64.lo. (bfd_elf64_littleaarch64_vec): Likewise. (bfd_elf32_bigaarch64_vec): Likewise. (bfd_elf32_littleaarch64_vec): Likewise. * configure: Re-generated. * elfxx-aarch64.c: New file; split from elf64-aarch64.c. * elfxx-aarch64.h: New file. * elfnn-aarch64.c: Include "elfxx-aarch64.h"; move the following stuff to elfxx-aarch64.c. (bfd_elf_aarch64_put_addend): Removed. (PG_OFFSET, PG): Likewise. (elfNN_aarch64_small_plt0_entry): Support ELF32. (elfNN_aarch64_tlsdesc_small_plt_entry): Likewise. (elf64_aarch64_grok_prstatus): Removed. (elf_backend_grok_prstatus): Removed. (insn32): Likewise. (aarch64_unsigned_overflow): Likewise. (aarch64_signed_overflow): Likewise. (aarch64_resolve_relocation): Likewise. (MASK): Likewise. (decode_branch_ofs_26): Likewise. (decode_cond_branch_ofs_19): Likewise. (decode_ld_lit_ofs_19): Likewise. (decode_tst_branch_ofs_14): Likewise. (decode_movw_imm): Likewise. (decode_adr_imm): Likewise. (decode_add_imm): Likewise. (reencode_branch_ofs_26): Likewise. (reencode_cond_branch_ofs_19): Likewise. (reencode_ld_lit_ofs_19): Likewise. (reencode_tst_branch_ofs_14): Likewise. (reencode_movw_imm): Likewise. (reencode_adr_imm): Likewise. (reencode_ldst_pos_imm): Likewise. (reencode_add_imm): Likewise. (reencode_movzn_to_movz): Likewise. (reencode_movzn_to_movn): Likewise. (aarch64_relocate): Update to call the new function names in elfxx-aarch64.c. (aarch64_calculate_got_entry_vma): Likewise. (elfNN_aarch64_final_link_relocate): Likewise. (elf64_aarch64_update_plt_entry): Likewise; change the type of the parameter 'r_type' to bfd_reloc_code_real_type; rename to ... (elf_aarch64_update_plt_entry): ... this. (elfNN_aarch64_create_small_pltn_entry): Update. (elfNN_aarch64_init_small_plt0_entry): Remove plt_got_base; add bfd_vma plt_got_2nd_ent; update to call elf_aarch64_update_plt_entry. (elfNN_aarch64_finish_dynamic_sections): Add plt_entry; update to call elf_aarch64_update_plt_entry. --- bfd/elfxx-aarch64.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 bfd/elfxx-aarch64.h (limited to 'bfd/elfxx-aarch64.h') diff --git a/bfd/elfxx-aarch64.h b/bfd/elfxx-aarch64.h new file mode 100644 index 0000000..dece641 --- /dev/null +++ b/bfd/elfxx-aarch64.h @@ -0,0 +1,47 @@ +/* AArch64-specific backend routines. + Copyright 2009-2013 Free Software Foundation, Inc. + Contributed by ARM Ltd. + + 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 3 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; see the file COPYING3. If not, + see . */ + +#include "bfd.h" +#include "elf-bfd.h" +#include "stdint.h" + +/* Take the PAGE component of an address or offset. */ +#define PG(x) ((x) & ~ (bfd_vma) 0xfff) +#define PG_OFFSET(x) ((x) & (bfd_vma) 0xfff) + +extern bfd_reloc_status_type +_bfd_aarch64_elf_put_addend (bfd *, bfd_byte *, bfd_reloc_code_real_type, + reloc_howto_type *, bfd_signed_vma); + +extern bfd_vma +_bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type, bfd_vma, bfd_vma, + bfd_vma, bfd_boolean); + +extern bfd_boolean +_bfd_aarch64_elf_add_symbol_hook (bfd *, struct bfd_link_info *, + Elf_Internal_Sym *, const char **, + flagword *, asection **, bfd_vma *); + +extern bfd_boolean +_bfd_aarch64_elf_grok_prstatus (bfd *, Elf_Internal_Note *); + + +#define elf_backend_add_symbol_hook _bfd_aarch64_elf_add_symbol_hook +#define elf_backend_grok_prstatus _bfd_aarch64_elf_grok_prstatus -- cgit v1.1