binutils-gdb/bfd/elf32-m68hc1x.h

195 lines
6.7 KiB
C
Raw Normal View History

* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* Motorola 68HC11/68HC12-specific support for 32-bit ELF
Copyright 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
Free Software Foundation, Inc.
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
Contributed by Stephane Carrez (stcarrez@nerim.fr)
This file is part of BFD, the Binary File Descriptor library.
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02: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.
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02: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.
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02: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. */
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
#ifndef _ELF32_M68HC1X_H
#define _ELF32_M68HC1X_H
#include "elf-bfd.h"
#include "bfdlink.h"
#include "elf/m68hc11.h"
/* Name of symbols exported by HC11/HC12 linker when there is a memory
bank window. */
#define BFD_M68HC11_BANK_START_NAME "__bank_start"
#define BFD_M68HC11_BANK_SIZE_NAME "__bank_size"
#define BFD_M68HC11_BANK_VIRTUAL_NAME "__bank_virtual"
/* Set and control ELF flags in ELF header. */
extern bfd_boolean _bfd_m68hc11_elf_merge_private_bfd_data (bfd*,bfd*);
extern bfd_boolean _bfd_m68hc11_elf_set_private_flags (bfd*,flagword);
extern bfd_boolean _bfd_m68hc11_elf_print_private_bfd_data (bfd*, void*);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* This hash entry is used to record a trampoline that must be generated
to call a far function using a normal calling convention ('jsr').
The trampoline is used when a pointer to a far function is used.
It takes care of installing the proper memory bank as well as creating
the 'call/rtc' calling convention. */
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
struct elf32_m68hc11_stub_hash_entry
{
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* Base hash table entry structure. */
struct bfd_hash_entry root;
/* The stub section. */
asection *stub_sec;
/* Offset within stub_sec of the beginning of this stub. */
bfd_vma stub_offset;
/* Given the symbol's value and its section we can determine its final
value when building the stubs (so the stub knows where to jump. */
bfd_vma target_value;
asection *target_section;
};
/* Placeholder for the parameters to compute memory page and physical address.
The following formulas are used:
sym > bank_virtual =>
%addr(sym) = (((sym - bank_virtual) & bank_mask) + bank_physical
%page(sym) = (((sym - bank_virtual) >> bank_shift) % 256
sym < bank_virtual =>
%addr(sym) = sym
%page(sym) = 0
These parameters are obtained from the symbol table by looking
at the following:
__bank_start Symbol marking the start of memory bank window
(bank_physical)
__bank_virtual Logical address of symbols for which the transformation
must be computed
__bank_page_size Size in bytes of page size (this is *NOT* the memory
bank window size and the window size is always
less or equal to the page size)
For 68HC12, the window is at 0x8000 and the page size is 16K (full window).
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
For 68HC11 this is board specific (implemented by external hardware). */
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
struct m68hc11_page_info
{
bfd_vma bank_virtual;
bfd_vma bank_physical;
bfd_vma bank_physical_end;
bfd_vma bank_mask;
bfd_vma bank_size;
int bank_shift;
int bank_param_initialized;
bfd_vma trampoline_addr;
};
struct m68hc11_elf_link_hash_table
{
struct elf_link_hash_table root;
struct m68hc11_page_info pinfo;
/* The stub hash table. */
struct bfd_hash_table* stub_hash_table;
/* Linker stub bfd. */
bfd *stub_bfd;
asection* stub_section;
asection* tramp_section;
/* Linker call-backs. */
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
asection * (*add_stub_section) (const char *, asection *);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* Assorted information used by elf32_hppa_size_stubs. */
unsigned int bfd_count;
int top_index;
asection **input_list;
/* Small local sym cache. */
struct sym_cache sym_cache;
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
bfd_boolean (* size_one_stub) (struct bfd_hash_entry*, void*);
bfd_boolean (* build_one_stub) (struct bfd_hash_entry*, void*);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
};
/* Get the Sparc64 ELF linker hash table from a link_info structure. */
#define m68hc11_elf_hash_table(p) \
* elf-bfd.h (emum elf_object_id): Rename to elf_target_id. Add entries for other architectures. (struct elf_link_hash_table): Add hash_table_id field. (elf_hash_table_id): New accessor macro. * elflink.c (_bfd_elf_link_hash_table_init): Add target_id parameter. * elf-m10300.c (elf32_mn10300_hash_table): Check table id before returning cast pointer. (elf32_mn10300_link_hash_table_create): Identify new table as containing MN10300 extensions. (mn10300_elf_relax_section): Check pointer returned by elf32_mn10300_hash_table. * elf32-arm.c: Likewise, except using ARM extensions. * elf32-avr.c: Likewise, except using AVR extensions. * elf32-bfin.c: Likewise, except using BFIN extensions. * elf32-cris.c: Likewise, except using CRIS extensions. * elf32-frv.c: Likewise, except using FRV extensions. * elf32-hppa.c: Likewise, except using HPPA32 extensions. * elf32-i386.c: Likewise, except using I386 extensions. * elf32-lm32.c: Likewise, except using LM32 extensions. * elf32-m32r.c: Likewise, except using M32RM extensions. * elf32-m68hc11.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.c: Likewise, except using M68HC11 extensions. * elf32-m68hc1x.h: Likewise, except using M68HC11 extensions. * elf32-m68k.c: Likewise, except using M68K extensions. * elf32-microblaze.c: Likewise, except using MICROBLAZE extensions. * elf32-ppc.c: Likewise, except using PPC32 extensions. * elf32-s390.c: Likewise, except using S390 extensions. * elf32-sh.c: Likewise, except using SH extensions. * elf32-spu.c: Likewise, except using SPU extensions. * elf32-xtensa.c: Likewise, except using XTENSA extensions. * elf64-alpha.c: Likewise, except using ALPHA extensions. * elf64-hppa.c: Likewise, except using HPPA64 extensions. * elf64-ppc.c: Likewise, except using PPC64 extensions. * elf64-s390.c: Likewise, except using S390 extensions. * elf64-x86-64.c: Likewise, except using X86_64 extensions. * elfxx-ia64.c: Likewise, except using IA64 extensions. * elfxx-mips.c: Likewise, except using MIPS extensions. * elfxx-sparc.c: Likewise, except using SPARC extensions. * elfxx-sparc.h: Likewise, except using SPARC extensions. * elf32-cr16.c (struct elf32_cr16_link_hash_table): Delete redundant structure. (elf32_cr16_hash_table): Delete unused macro. (elf32_cr16_link_hash_traverse): Delete unused macro. * elf32-score.c: Likewise. * elf32-score7.c: Likewise. * elf32-vax.c: Likewise. * elf64-sh64.c: Likewise. * emultempl/alphaelf.em: Update value expected from elf_object_id. * emultempl/hppaelf.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise.
2010-02-04 10:16:43 +01:00
(elf_hash_table_id ((struct elf_link_hash_table *) ((p)->hash)) \
== M68HC11_ELF_DATA ? ((struct m68hc11_elf_link_hash_table *) ((p)->hash)) : NULL)
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* Create a 68HC11/68HC12 ELF linker hash table. */
extern struct m68hc11_elf_link_hash_table* m68hc11_elf_hash_table_create
(bfd*);
extern void m68hc11_elf_bfd_link_hash_table_free (struct bfd_link_hash_table*);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
extern void m68hc11_elf_get_bank_parameters (struct bfd_link_info*);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* Return 1 if the address is in banked memory.
This can be applied to a virtual address and to a physical address. */
extern int m68hc11_addr_is_banked (struct m68hc11_page_info*, bfd_vma);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* Return the physical address seen by the processor, taking
into account banked memory. */
extern bfd_vma m68hc11_phys_addr (struct m68hc11_page_info*, bfd_vma);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* Return the page number corresponding to an address in banked memory. */
extern bfd_vma m68hc11_phys_page (struct m68hc11_page_info*, bfd_vma);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
bfd_reloc_status_type m68hc11_elf_ignore_reloc
(bfd *abfd, arelent *reloc_entry,
asymbol *symbol, void *data, asection *input_section,
bfd *output_bfd, char **error_message);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
bfd_reloc_status_type m68hc11_elf_special_reloc
(bfd *abfd, arelent *reloc_entry,
asymbol *symbol, void *data, asection *input_section,
bfd *output_bfd, char **error_message);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
bfd_boolean elf32_m68hc11_check_relocs
(bfd * abfd, struct bfd_link_info * info,
asection * sec, const Elf_Internal_Rela * relocs);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
bfd_boolean elf32_m68hc11_relocate_section
(bfd *output_bfd, struct bfd_link_info *info,
bfd *input_bfd, asection *input_section,
bfd_byte *contents, Elf_Internal_Rela *relocs,
Elf_Internal_Sym *local_syms, asection **local_sections);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
bfd_boolean elf32_m68hc11_add_symbol_hook
(bfd *abfd, struct bfd_link_info *info,
Elf_Internal_Sym *sym, const char **namep,
flagword *flagsp, asection **secp,
bfd_vma *valp);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
void elf32_m68hc11_merge_symbol_attribute
(struct elf_link_hash_entry *, const Elf_Internal_Sym *,
bfd_boolean, bfd_boolean);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
/* Tweak the OSABI field of the elf header. */
extern void elf32_m68hc11_post_process_headers (bfd*, struct bfd_link_info*);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
int elf32_m68hc11_setup_section_lists (bfd *, struct bfd_link_info *);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
bfd_boolean elf32_m68hc11_size_stubs
(bfd *, bfd *, struct bfd_link_info *,
asection * (*) (const char *, asection *));
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
bfd_boolean elf32_m68hc11_build_stubs (bfd* abfd, struct bfd_link_info *);
* elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (m68hc11_elf_hash_table_create): New function. (elf32_m68hc11_link_hash_table_free): New function. (stub_hash_newfunc): New function. (m68hc11_add_stub): New function. (elf32_m68hc11_add_symbol_hook): New function. (elf32_m68hc11_setup_section_lists): New function. (elf32_m68hc11_next_input_section): New function. (elf32_m68hc11_size_stubs): New function. (elf32_m68hc11_build_stubs): New function. (m68hc11_get_relocation_value): New function. (elf32_m68hc11_relocate_section): Call the above to redirect some relocations to the trampoline code. (m68hc11_elf_export_one_stub): New function. (m68hc11_elf_set_symbol): New function. (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. (m68hc11_elf_get_bank_parameters): Get parameters only when the info is not yet initialized. * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) (elf32_m68hc11_stub_hash_entry): New struct. (m68hc11_page_info): Add trampoline handler address. (m68hc11_elf_link_hash_table): Add stubs generation members. (elf32_m68hc11_add_symbol_hook): Declare. (elf32_m68hc11_setup_section_lists): Declare. (elf32_m68hc11_size_stubs): Declare. (elf32_m68hc11_build_stubs): Declare. * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. (_bfd_m68hc11_elf_set_private_flags): Ditto. (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. (bfd_elf32_bfd_link_hash_table_create): Define. (elf_backend_add_symbol_hook): Define. (m68hc11_elf_bfd_link_hash_table_create): New function. (m68hc11_elf_build_one_stub): New function. (m68hc11_elf_size_one_stub): New function. (m68hc11_elf_bfd_link_hash_table_create): Install the above. (bfd_elf32_bfd_link_hash_table_create): Define. * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. (m68hc12_phys_addr): Ditto. (m68hc12_phys_page): Ditto. (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. (elf32_m68hc11_gc_mark_hook): Likewise. (elf32_m68hc11_gc_sweep_hook): Likewise. (elf32_m68hc11_check_relocs): Likewise. (elf32_m68hc11_relocate_section): Likewise. (_bfd_m68hc12_elf_set_private_flags): Likewise. (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. (m68hc12_elf_build_one_stub): New function. (m68hc12_elf_size_one_stub): New function. (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. (elf_backend_add_symbol_hook): Define. (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks.
2003-04-21 15:22:14 +02:00
#endif