13d8817e4Smiod /* MIPS ELF specific backend routines. 23d8817e4Smiod Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 33d8817e4Smiod 43d8817e4Smiod This file is part of BFD, the Binary File Descriptor library. 53d8817e4Smiod 63d8817e4Smiod This program is free software; you can redistribute it and/or modify 73d8817e4Smiod it under the terms of the GNU General Public License as published by 83d8817e4Smiod the Free Software Foundation; either version 2 of the License, or 93d8817e4Smiod (at your option) any later version. 103d8817e4Smiod 113d8817e4Smiod This program is distributed in the hope that it will be useful, 123d8817e4Smiod but WITHOUT ANY WARRANTY; without even the implied warranty of 133d8817e4Smiod MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 143d8817e4Smiod GNU General Public License for more details. 153d8817e4Smiod 163d8817e4Smiod You should have received a copy of the GNU General Public License 173d8817e4Smiod along with this program; if not, write to the Free Software 183d8817e4Smiod Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ 193d8817e4Smiod 203d8817e4Smiod #include "elf/common.h" 213d8817e4Smiod #include "elf/internal.h" 223d8817e4Smiod 233d8817e4Smiod extern bfd_boolean _bfd_mips_elf_new_section_hook 243d8817e4Smiod (bfd *, asection *); 253d8817e4Smiod extern void _bfd_mips_elf_symbol_processing 263d8817e4Smiod (bfd *, asymbol *); 273d8817e4Smiod extern unsigned int _bfd_mips_elf_eh_frame_address_size 283d8817e4Smiod (bfd *, asection *); 293d8817e4Smiod extern bfd_boolean _bfd_mips_elf_name_local_section_symbols 303d8817e4Smiod (bfd *); 313d8817e4Smiod extern bfd_boolean _bfd_mips_elf_section_processing 323d8817e4Smiod (bfd *, Elf_Internal_Shdr *); 333d8817e4Smiod extern bfd_boolean _bfd_mips_elf_section_from_shdr 343d8817e4Smiod (bfd *, Elf_Internal_Shdr *, const char *, int); 353d8817e4Smiod extern bfd_boolean _bfd_mips_elf_fake_sections 363d8817e4Smiod (bfd *, Elf_Internal_Shdr *, asection *); 373d8817e4Smiod extern bfd_boolean _bfd_mips_elf_section_from_bfd_section 383d8817e4Smiod (bfd *, asection *, int *); 393d8817e4Smiod extern bfd_boolean _bfd_mips_elf_add_symbol_hook 403d8817e4Smiod (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, 413d8817e4Smiod const char **, flagword *, asection **, bfd_vma *); 423d8817e4Smiod extern bfd_boolean _bfd_mips_elf_link_output_symbol_hook 433d8817e4Smiod (struct bfd_link_info *, const char *, Elf_Internal_Sym *, 443d8817e4Smiod asection *, struct elf_link_hash_entry *); 453d8817e4Smiod extern bfd_boolean _bfd_mips_elf_create_dynamic_sections 463d8817e4Smiod (bfd *, struct bfd_link_info *); 473d8817e4Smiod extern bfd_boolean _bfd_mips_elf_check_relocs 483d8817e4Smiod (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); 493d8817e4Smiod extern bfd_boolean _bfd_mips_elf_adjust_dynamic_symbol 503d8817e4Smiod (struct bfd_link_info *, struct elf_link_hash_entry *); 513d8817e4Smiod extern bfd_boolean _bfd_mips_vxworks_adjust_dynamic_symbol 523d8817e4Smiod (struct bfd_link_info *, struct elf_link_hash_entry *); 533d8817e4Smiod extern bfd_boolean _bfd_mips_elf_always_size_sections 543d8817e4Smiod (bfd *, struct bfd_link_info *); 553d8817e4Smiod extern bfd_boolean _bfd_mips_elf_size_dynamic_sections 563d8817e4Smiod (bfd *, struct bfd_link_info *); 573d8817e4Smiod extern bfd_boolean _bfd_mips_elf_relocate_section 583d8817e4Smiod (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, 593d8817e4Smiod Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); 603d8817e4Smiod extern bfd_boolean _bfd_mips_elf_finish_dynamic_symbol 613d8817e4Smiod (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, 623d8817e4Smiod Elf_Internal_Sym *); 633d8817e4Smiod extern bfd_boolean _bfd_mips_vxworks_finish_dynamic_symbol 643d8817e4Smiod (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, 653d8817e4Smiod Elf_Internal_Sym *); 663d8817e4Smiod extern bfd_boolean _bfd_mips_elf_finish_dynamic_sections 673d8817e4Smiod (bfd *, struct bfd_link_info *); 683d8817e4Smiod extern void _bfd_mips_elf_final_write_processing 693d8817e4Smiod (bfd *, bfd_boolean); 703d8817e4Smiod extern int _bfd_mips_elf_additional_program_headers 713d8817e4Smiod (bfd *); 723d8817e4Smiod extern bfd_boolean _bfd_mips_elf_modify_segment_map 733d8817e4Smiod (bfd *, struct bfd_link_info *); 743d8817e4Smiod extern asection * _bfd_mips_elf_gc_mark_hook 753d8817e4Smiod (asection *, struct bfd_link_info *, Elf_Internal_Rela *, 763d8817e4Smiod struct elf_link_hash_entry *, Elf_Internal_Sym *); 773d8817e4Smiod extern bfd_boolean _bfd_mips_elf_gc_sweep_hook 783d8817e4Smiod (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); 793d8817e4Smiod extern void _bfd_mips_elf_copy_indirect_symbol 803d8817e4Smiod (struct bfd_link_info *, struct elf_link_hash_entry *, 813d8817e4Smiod struct elf_link_hash_entry *); 823d8817e4Smiod extern void _bfd_mips_elf_hide_symbol 833d8817e4Smiod (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); 843d8817e4Smiod extern bfd_boolean _bfd_mips_elf_ignore_discarded_relocs 853d8817e4Smiod (asection *); 863d8817e4Smiod extern bfd_boolean _bfd_mips_elf_find_nearest_line 873d8817e4Smiod (bfd *, asection *, asymbol **, bfd_vma, const char **, 883d8817e4Smiod const char **, unsigned int *); 893d8817e4Smiod extern bfd_boolean _bfd_mips_elf_find_inliner_info 903d8817e4Smiod (bfd *, const char **, const char **, unsigned int *); 913d8817e4Smiod extern bfd_boolean _bfd_mips_elf_set_section_contents 923d8817e4Smiod (bfd *, asection *, const void *, file_ptr, bfd_size_type); 933d8817e4Smiod extern bfd_byte *_bfd_elf_mips_get_relocated_section_contents 943d8817e4Smiod (bfd *, struct bfd_link_info *, struct bfd_link_order *, 953d8817e4Smiod bfd_byte *, bfd_boolean, asymbol **); 963d8817e4Smiod extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create 973d8817e4Smiod (bfd *); 983d8817e4Smiod extern struct bfd_link_hash_table *_bfd_mips_vxworks_link_hash_table_create 993d8817e4Smiod (bfd *); 1003d8817e4Smiod extern bfd_boolean _bfd_mips_elf_final_link 1013d8817e4Smiod (bfd *, struct bfd_link_info *); 1023d8817e4Smiod extern bfd_boolean _bfd_mips_elf_merge_private_bfd_data 1033d8817e4Smiod (bfd *, bfd *); 1043d8817e4Smiod extern bfd_boolean _bfd_mips_elf_set_private_flags 1053d8817e4Smiod (bfd *, flagword); 1063d8817e4Smiod extern bfd_boolean _bfd_mips_elf_print_private_bfd_data 1073d8817e4Smiod (bfd *, void *); 1083d8817e4Smiod extern bfd_boolean _bfd_mips_elf_discard_info 1093d8817e4Smiod (bfd *, struct elf_reloc_cookie *, struct bfd_link_info *); 1103d8817e4Smiod extern bfd_boolean _bfd_mips_elf_write_section 1113d8817e4Smiod (bfd *, asection *, bfd_byte *); 1123d8817e4Smiod 1133d8817e4Smiod extern bfd_boolean _bfd_mips_elf_read_ecoff_info 1143d8817e4Smiod (bfd *, asection *, struct ecoff_debug_info *); 1153d8817e4Smiod extern void _bfd_mips16_elf_reloc_unshuffle 1163d8817e4Smiod (bfd *, int, bfd_boolean, bfd_byte *); 1173d8817e4Smiod extern void _bfd_mips16_elf_reloc_shuffle 1183d8817e4Smiod (bfd *, int, bfd_boolean, bfd_byte *); 1193d8817e4Smiod extern bfd_reloc_status_type _bfd_mips_elf_gprel16_with_gp 1203d8817e4Smiod (bfd *, asymbol *, arelent *, asection *, bfd_boolean, void *, bfd_vma); 1213d8817e4Smiod extern bfd_reloc_status_type _bfd_mips_elf32_gprel16_reloc 1223d8817e4Smiod (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); 1233d8817e4Smiod extern bfd_reloc_status_type _bfd_mips_elf_hi16_reloc 1243d8817e4Smiod (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); 1253d8817e4Smiod extern bfd_reloc_status_type _bfd_mips_elf_got16_reloc 1263d8817e4Smiod (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); 1273d8817e4Smiod extern bfd_reloc_status_type _bfd_mips_elf_lo16_reloc 1283d8817e4Smiod (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); 1293d8817e4Smiod extern bfd_reloc_status_type _bfd_mips_elf_generic_reloc 1303d8817e4Smiod (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); 1313d8817e4Smiod extern unsigned long _bfd_elf_mips_mach 1323d8817e4Smiod (flagword); 1333d8817e4Smiod extern bfd_boolean _bfd_mips_relax_section 1343d8817e4Smiod (bfd *, asection *, struct bfd_link_info *, bfd_boolean *); 1353d8817e4Smiod extern bfd_vma _bfd_mips_elf_sign_extend 1363d8817e4Smiod (bfd_vma, int); 1373d8817e4Smiod extern void _bfd_mips_elf_merge_symbol_attribute 1383d8817e4Smiod (struct elf_link_hash_entry *, const Elf_Internal_Sym *, bfd_boolean, bfd_boolean); 1393d8817e4Smiod extern bfd_boolean _bfd_mips_elf_ignore_undef_symbol 1403d8817e4Smiod (struct elf_link_hash_entry *); 1413d8817e4Smiod 1423d8817e4Smiod extern const struct bfd_elf_special_section _bfd_mips_elf_special_sections []; 1433d8817e4Smiod 144*666a50bbSmiod extern bfd_boolean _bfd_mips_elf_common_definition (Elf_Internal_Sym *); 145*666a50bbSmiod 146*666a50bbSmiod #define elf_backend_common_definition _bfd_mips_elf_common_definition 1473d8817e4Smiod #define elf_backend_name_local_section_symbols \ 1483d8817e4Smiod _bfd_mips_elf_name_local_section_symbols 1493d8817e4Smiod #define elf_backend_special_sections _bfd_mips_elf_special_sections 1503d8817e4Smiod #define elf_backend_eh_frame_address_size _bfd_mips_elf_eh_frame_address_size 1513d8817e4Smiod #define elf_backend_merge_symbol_attribute _bfd_mips_elf_merge_symbol_attribute 1523d8817e4Smiod #define elf_backend_ignore_undef_symbol _bfd_mips_elf_ignore_undef_symbol 153