aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
AgeCommit message (Collapse)AuthorFilesLines
2004-03-27 * Makefile.am: Remove all mention of elflink.h.Alan Modra1-3586/+0
* Makefile.in: Regenerate. * bfd-in.h (bfd_elf_discard_info): Declare. (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. * bfd-in2.h: Regenerate. * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, bfd_elf32_link_record_dynamic_symbol, bfd_elf64_link_record_dynamic_symbol, _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, _bfd_elf32_link_record_local_dynamic_symbol, _bfd_elf64_link_record_local_dynamic_symbol, _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, _bfd_elf32_reloc_symbol_deleted_p, _bfd_elf64_reloc_symbol_deleted_p): Delete. (bfd_elf_link_record_dynamic_symbol, bfd_elf_link_record_local_dynamic_symbol, bfd_elf_final_link, bfd_elf_gc_sections, bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, bfd_elf_reloc_symbol_deleted_p): Declare. (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. * elf32-arm.h: Update for changed function names. Remove local WILL_CALL_FINISH_DYNAMIC_SECTION define. * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. (bfd_elfNN_print_symbol): Define. * elfcode.h: Don't include elflink.h. (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, elf_gc_record_vtinherit, elf_gc_record_vtentry, elf_link_record_local_dynamic_symbol): Don't define. * elflink.c: Update for changed function names. Move elflink.h code here. * elflink.h: Delete file. * po/SRC-POTFILES.in: Regenerate. * po/bfd.pot: Regenerate. doc/ * bfdint.texi: Remove all mention of elflink.h.
2004-03-27 * elf-bfd.h (struct elf_reloc_cookie): Add r_sym_shift field.Alan Modra1-100/+157
* elflink.h: Replace all occurrences of sizeof (Elf_External_*) where Elf_External_* is different for 64 and 32 bit, with corresponding elf_size_info field. (struct elf_final_link_info): Use "bfd_byte *" instead of "Elf_External_Sym *" for external_syms and symbuf. (elf_link_adjust_relocs): Set up r_type_mask and r_sym_shift local vars and use instead of ELF_R_INFO and ELF_R_TYPE macros. (struct elf_link_sort_rela): Add "sym_mask" alias for "offset". (elf_link_sort_cmp1): Use sym_mask field instead of ELF_R_SYM. (elf_link_sort_cmp2): Adjust. (elf_link_sort_relocs): Set up r_sym_mask local var instead of using ELF_R_SYM macro. Set u.sym_mask. (elf_bfd_final_link): Call _bfd_elf_stringtab_init instead of macro version, elf_stringtab_init. Ditto for bfd_section_from_elf_index vs. section_from_elf_index. Adjust Elf_External_Sym pointer arithmetic. Pass bed to elf_link_flush_output_syms. Adjust Elf_External_Dyn pointer arithmentic. Use bed swap_dyn_in and swap_syn_out functions. Rearrange dyn swap in/out switch. (elf_link_output_sym): Adjust Elf_External_Sym pointer arithmentic. Pass bed to elf_link_flush_output_syms. Use bed swap_symbol_out. (elf_link_flush_output_syms): Add elf_backend_data arg. (elf_link_check_versioned_symbol): Likewise. (elf_link_output_extsym): Pass bed to elf_link_check_versioned_symbol. Adjust Elf_External_Sym pointer arithmetic. Use bed swap_symbol_out. (elf_link_input_bfd): Use bfd_section_from_elf_index. Set up r_type_mask and r_sym_shift local vars and use instead of ELF_R_SYM, ELF_R_TYPE and ELF_R_INFO macros. (elf_reloc_link_order): Select ELF32_R_INFO or ELF64_R_INFO invocation based on size rather than using ELF_R_INFO. (elf_gc_mark): Set up r_sym_shift local var and use instead of ELF_R_SYM macro. (struct alloc_got_off_arg): New. (elf_gc_common_finalize_got_offsets): Use elf_size_info instead of ARCH_SIZE. Pass get entry size down to elf_gc_allocate_got_offsets. (elf_gc_allocate_got_offsets): Adjust. (elf_reloc_symbol_deleted_p): Usee cookie.r_sym_shift instead of ELF_R_SYM. Use bfd_section_from_elf_index. (elf_bfd_discard_info): Set cookie.r_sym_shift. * elfcode.h (elf_stringtab_init, section_from_elf_index): Delete. (elf_slurp_symbol_table): Use bfd_section_from_elf_index.
2004-03-26 * elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define.Alan Modra1-1325/+0
* elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete. (_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete. (_bfd_elf_finalize_dynstr, bfd_elf32_bfd_link_add_symbols): Delete. (bfd_elf64_bfd_link_add_symbols): Delete. (bfd_elf_link_add_symbols): Declare. * elfcode.h (elf_bfd_link_add_symbols): Delete. * elflink.c: Include safe-ctype.h. (elf_add_dt_needed_tag): Rename from _bfd_elf_add_dt_needed_tag, make static. (elf_sort_symbol): Rename from _bfd_elf_sort_symbol, make static. (elf_finalize_dynstr): Rename from _bfd_elf_finalize_dynstr, make static. (elf_link_add_archive_symbols): Rename from _bfd_elf_link_add_archive_symbols, make static. (elf_link_add_object_symbols): New function. Corresponding elflink.h function converted to use elf_size_info. (bfd_elf_link_add_symbols): Likewise. (bfd_elf_size_dynamic_sections): Adjust. * elflink.h (elf_bfd_link_add_symbols): Delete. (elf_link_add_object_symbols): Delete. * elf32-gen.c (elf32_generic_link_add_symbols): Call bfd_elf_link_add_symbols. * elf64-gen.c (elf64_generic_link_add_symbols): Likewise.
2004-03-25bfd/Alan Modra1-1224/+8
* elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed and chained shared libs only if dynsym. Clear dynsym on forced-local. * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare. (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete. (_bfd_elf_add_dt_needed_tag): Declare. (_bfd_elf_sort_symbol): Declare. (_bfd_elf_finalize_dynstr): Declare. (RELOC_FOR_GLOBAL_SYM): Formatting. * elfcode.h (elf_add_dynamic_entry): Delete. * elflink.c (_bfd_elf_add_dynamic_entry): New function. Corresponding elflink.h function converted to use elf_size_info. (_bfd_elf_add_dt_needed_tag): Likewise. (_bfd_elf_sort_symbol): Likewise. (_bfd_elf_finalize_dynstr): Likewise. (compute_bucket_count): Likewise. (bfd_elf_size_dynamic_sections): Likewise. Check result of _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref. (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from.. * elflink.h: ..here. (sort_symbol, add_dt_needed_tag): Delete. (elf_add_dynamic_entry, elf_finalize_dynstr): Delete. (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete. Update all users. * elf32-arm.h (add_dynamic_entry): Update. Remove casts. * elf32-cris.c (add_dynamic_entry): Likewise. * elf32-hppa.c (add_dynamic_entry): Likewise. * elf32-i370.c (add_dynamic_entry): Likewise. * elf32-i386.c (add_dynamic_entry): Likewise. * elf32-m32r.c (add_dynamic_entry): Likewise. * elf32-m68k.c (add_dynamic_entry): Likewise. * elf32-ppc.c (add_dynamic_entry): Likewise. * elf32-s390.c (add_dynamic_entry): Likewise. * elf32-sh.c (add_dynamic_entry): Likewise. * elf32-sparc.c (add_dynamic_entry): Likewise. * elf32-vax.c (add_dynamic_entry): Likewise. * elf32-xtensa.c (add_dynamic_entry): Likewise. * elf64-alpha.c (add_dynamic_entry): Likewise. * elf64-hppa.c (add_dynamic_entry): Likewise. * elf64-ppc.c (add_dynamic_entry): Likewise. * elf64-s390.c (add_dynamic_entry): Likewise. * elf64-sparc.c (add_dynamic_entry): Likewise. * elf64-x86-64.c (add_dynamic_entry): Likewise. * elfxx-ia64.c (add_dynamic_entry): Likewise. * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise. * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise. * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Update size_dynamic_sections call.
2004-03-19 * elflink.c (_bfd_elf_merge_symbol): Revert last change. MoveAlan Modra1-18/+5
type and size change code to where it was previously. Remove dt_needed param. Treat old weak syms as strong if new sym is from a shared lib, even when old sym is from another shared lib. Remove unnecessary tests of oldweak and newweak. Correct comments. (_bfd_elf_add_default_symbol): Remove dt_needed param. Update _bfd_elf_merge_symbol calls. * elflink.h (elf_link_add_object_symbols): Update calls. Remove dt_needed local var. Update comments. * elf-bfd.h (_bfd_elf_merge_symbol): Update prototype. (_bfd_elf_add_default_symbol): Likewise.
2004-03-18bfd/Alan Modra1-104/+103
* elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field. Add dyn_lib_class field. Rearrange for better packing. (elf_dt_soname): Delete. (elf_dyn_lib_class): Define. * elf.c (bfd_elf_set_dt_needed_name): Update comment. (bfd_elf_set_dt_needed_soname): Delete. (bfd_elf_set_dyn_lib_class): New function. * elflink.h (add_dt_needed_tag): New function. Split out from.. (elf_link_add_object_symbols): ..here. Rename "name" to "soname". Use elf_dyn_lib_class to set dt_needed and add_needed. Move fallback initialization of soname. (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of elf_dt_soname. * bfd-in.h (enum dynamic_lib_link_class): New. (bfd_elf_set_dt_needed_soname): Delete. (bfd_elf_set_dyn_lib_class): Declare. * bfd-in2.h: Regenerate. ld/ * ld.texinfo: Add --as-needed doco. * ldmain.c (as_needed): New global var. * ldmain.h (as_needed): Declare. * lexsup.c (option_values): Add OPTION_AS_NEEDED and OPTION_NO_AS_NEEDED. (ld_options): Likewise. (parse_args): Handle them. * ldlang.h (lang_input_statement_type): Add as_needed field. * ldlang.c (new_afile): Set p->as_needed. * emultempl/elf32.em (gld${EMULATION_NAME}_load_symbols): New function. (gld${EMULATION_NAME}_try_needed): Use bfd_elf_set_dyn_lib_class. (ld_${EMULATION_NAME}_emulation): Set LDEMUL_RECOGNIZED_FILE entry. * ldlang.c (open_input_bfds): Remove useless cast. (lang_do_assignments_1): Likewise. (lang_for_each_input_section): Delete.
2004-03-18 * elflink.c (_bfd_elf_merge_symbol): Rewrite weak symbol handling.Alan Modra1-7/+8
(_bfd_elf_add_default_symbol): Remove indirect BFD_ASSERTs. * elflink.h (elf_link_add_object_symbols): Don't clear dt_needed in symbol loop. Instead use add_needed to flag tag as written.
2004-02-292004-02-28 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-347/+1
* elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype. * elflink.h (is_global_data_symbol_definition): Moved to elflink.c. (elf_link_is_defined_archive_symbol): Likewise. (elf_link_add_archive_symbols): Likewise. Renamed to _bfd_elf_link_add_archive_symbols. * elflink.c (elf_link_is_defined_archive_symbol): Get the size of ELF symbol table entry from backend. (_bfd_elf_link_add_archive_symbols): Call bfd_link_add_symbols instead of elf_link_add_object_symbols.
2004-02-272004-02-27 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-38/+129
* elflink.h (sort_symbol): New. (elf_link_add_object_symbols): Use a sorted symbol array for weakdef.
2004-02-23 * elflink.h (size_dynamic_sections): If not adding DT_FLAGS andJakub Jelinek1-0/+5
DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry.
2004-01-01 * elflink.h (elf_gc_sections): Warn when gc-sections option is ignored.Alan Modra1-1/+4
* elf32-h8300.c (elf32_h8_gc_mark_hook): New function. (elf32_h8_gc_sweep_hook): New function. (elf_backend_gc_mark_hook): Define. (elf_backend_gc_sweep_hook): Define. (elf_backend_can_gc_sections): Define.
2003-12-08 * elf-bfd.h (struct elf_backend_data): Remove "bfd *" and addAlan Modra1-13/+17
"elflink_hash_entry *" param to elf_backend_link_output_symbol_hook. Add "elflink_hash_entry *" param to elf_backend_output_arch_syms. * elflink.h (elf_link_output_sym): Add "elflink_hash_entry *" param, and pass to output_symbol_hook. (elf_bfd_final_link): Adjust elf_link_output_sym calls. (elf_link_output_extsym): Likewise. (elf_link_input_bfd): Likewise. * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Adjust. * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise. * elf64-sparc.c (sparc64_elf_output_arch_syms): Likewise. * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. Validate dynh->h against h. * elf64-ppc.c (struct ppc_link_hash_entry): Add adjust_done bitfield. (link_hash_newfunc): Init it. (adjust_opd_syms): New function. (ppc64_elf_edit_opd): Set adjust_done when global .opd sym adjusted. Set opd.adjust for all .opd relocs. Call adjust_opd_syms. (ppc64_elf_tls_optimize): Adjust possible .opd sym values here. (ppc64_elf_relocate_section): Also adjust syms not a multiple of 24. (ppc64_elf_output_symbol_hook): New function. (elf_backend_link_output_symbol_hook): Define.
2003-12-01 * elf-bfd.h (is_elf_hash_table): Take hash tab rather than info arg.Alan Modra1-32/+32
* elf.c (_bfd_elf_merge_sections): Adjust to suit. (_bfd_elf_link_just_syms): Likewise. (bfd_elf_get_needed_list): Likewise. (bfd_elf_get_runpath_list): Likewise. (_bfd_elf_link_hash_copy_indirect): Remove unneeded parens. * elf32-hppa.c (elf32_hppa_setup_section_lists): Don't check hash tab creator flavour. (elf32_hppa_set_gp): Look up output sections rather than using htab. * elf32-i960.c: Comment fix. Formatting. * elf32-m32r.c (m32r_elf_add_symbol_hook): Use is_elf_hash_table rather than testing creator flavour. * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. * elflink.c (_bfd_elf_link_create_dynamic_sections): Adjust for is_elf_hash_table change. Remove redundant test. (bfd_elf_record_link_assignment): Use is_elf_hash_table rather than testing creator flavour. (elf_link_record_local_dynamic_symbol): Adjust for is_elf_hash_table. (_bfd_elf_fix_symbol_flags): Likewise. (_bfd_elf_adjust_dynamic_symbol): Likewise. * elflink.h (elf_link_add_object_symbols): Likewise. Remove redundant checks. Use is_elf_hash_table rather than testing creator flavour. Use hash_table throughout in place of info->hash. (elf_add_dynamic_entry): Adjust for is_elf_hash_table change. (NAME(bfd_elf,size_dynamic_sections)): Likewise. Remove redundant check. (elf_bfd_final_link): Adjust for is_elf_hash_table change. (elf_link_check_versioned_symbol): Use is_elf_hash_table rather than testing creator flavour. (elf_gc_sections): Add is_elf_hash_table check. (elf_gc_common_finalize_got_offsets): Likewise. (elf_bfd_discard_info): Adjust for is_elf_hash_table change. Remove redundant check. * elfxx-ia64.c (elfNN_ia64_relax_section): Use is_elf_hash_table rather than testing creator flavour.
2003-11-27 * elf32-arm.h: Fix comment typos.Kazu Hirata1-8/+8
* elf32-d30v.c: Likewise. * elf32-dlx.c: Likewise. * elf32-h8300.c: Likewise. * elf32-i370.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-mcore.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf32-v850.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mips.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sparc.c: Likewise. * elflink.c: Likewise. * elflink.h: Likewise. * elfn32-mips.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise.
2003-11-11Fix decision about when a .interp section should existNick Clifton1-1/+1
2003-11-04 * bfd-in.h (_bfd_elf_tls_setup): Declare.Alan Modra1-31/+15
* bfd-in2.h: Regenerate. * elf-bfd.h (struct elf_link_tls_segment): Delete. (struct elf_link_hash_table): Add tls_sec and tls_size. * elf.c (_bfd_elf_link_hash_table_init): Init tls_sec and tls_size. * elflink.c (_bfd_elf_tls_setup): New function. * elflink.h (struct elf_final_link_info): Remove first_tls_sec. (elf_bfd_final_link): Don't set first_tls_sec here. Update code saving tls segment info, round segment size up. (elf_link_output_extsym): Adjust code using tls segment info. (elf_link_input_bfd): Likewise. * elf32-i386.c (dtpoff_base, tpoff): Likewise. * elf32-s390.c (dtpoff_base, tpoff): Likewise. * elf32-sh.c (dtpoff_base, tpoff): Likewise. * elf32-sparc.c (dtpoff_base, tpoff): Likewise. * elf64-s390.c (dtpoff_base, tpoff): Likewise. * elf64-x86-64.c (dtpoff_base, tpoff): Likewise. * elfxx-ia64.c (elfNN_ia64_tprel_base): Likewise. (elfNN_ia64_dtprel_base): Likewise. * elf64-alpha.c (alpha_get_dtprel_base): Likewise. (alpha_get_tprel_base): Likewise. (struct alpha_relax_info): Remove tls_segment. (elf64_alpha_relax_got_load): Adjust invocation of alpha_get_dtprel_base and alpha_get_tprel_base. (elf64_alpha_relax_tls_get_addr): Likewise. (elf64_alpha_relax_section): Likewise. (elf64_alpha_relocate_section): Likewise. (elf64_alpha_relax_find_tls_segment): Delete. * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove tls_sec. (ppc_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. (ppc_elf_relocate_section): Adjust to use elf.tls_sec. * elf32-ppc.h (ppc_elf_tls_setup): Update. * elf64-ppc.c (struct ppc_link_hash_table): Remove tls_sec. (ppc64_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. (ppc64_elf_tls_optimize): Adjust to use elf.tls_sec. (ppc64_elf_relocate_section): Likewise. * elf64-ppc.h (ppc64_elf_tls_setup): Update. * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Call _bfd_elf_tls_setup.
2003-10-24bfd/H.J. Lu1-4/+2
2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Look up hash table for real symbols. include/ 2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (bfd_elf_version_expr): Add "symbol" and remove "wildcard". ld/ 2003-10-24 H.J. Lu <hongjiu.lu@intel.com> * ldlang.c (lang_vers_match): Check "symbol" instead of "wildcard" and "pattern". Fix a typo. (lang_finalize_version_expr_head): Likewise. (lang_register_vers_node): Likewise. (realsymbol): New function. (lang_new_vers_pattern): Set "symbol" and remove "wildcard". * ldlex.l (V_IDENTIFIER): Allow '\\'.
2003-10-22bfd/Jakub Jelinek1-3/+5
* elflink.c (_bfd_elf_export_symbol): Adjust for globals and locals field changes. (_bfd_elf_link_assign_sym_version): Likewise. * elflink.h (size_dynamic_sections): Likewise. include/ * bfdlink.h (struct bfd_elf_version_expr): Remove match field. Add wildcard and mask fields. (BFD_ELF_VERSION_C_TYPE): Define. (BFD_ELF_VERSION_CXX_TYPE): Likewise. (BFD_ELF_VERSION_JAVA_TYPE): Likewise. (struct bfd_elf_version_expr_head): New. (struct bfd_elf_version_tree): Add match field. Change type of globals and locals fields to struct bfd_elf_version_expr_head. ld/ * ldlang.c: Include hashtab.h. (lang_vers_match_lang_c, lang_vers_match_lang_cplusplus, lang_vers_match_lang_java): Remove. (lang_vers_match): New function. (lang_new_vers_pattern): Initialize wildcard and mask fields, don't initialize match. (lang_new_vers_node): Use xcalloc. Adjust for globals and locals field type changes. Set match field. (version_expr_head_hash, version_expr_head_eq): New functions. (lang_finalize_version_expr_head): New function. (lang_register_vers_node): Call lang_finalize_version_expr_head. Search in hash table if not wildcard when looking for duplicates. * emultempl/ppc64elf.em (new_vers_pattern): Don't bother with duplicate checking. Initialize all fields of dot_entry from entry with the exception of pattern and next.
2003-10-162003-10-16 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-2/+1
* elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also warn undefined patterns with '*'.
2003-10-14 * elf-bfd.h (struct elf_backend_data): New function pointer memberKaz Kojima1-0/+4
elf_backend_merge_symbol_attribute. * elflink.h (elf_link_add_object_symbols): Adjust call to elf_backend_merge_symbol_attribute if the backend defined it. * elfxx-target.h (elf_backend_merge_symbol_attribute): New macro. (elfNN_bed): Add that to the initializer.
2003-10-07bfd/Changelog:Nathan Sidwell1-20/+27
* libbfd-in.h (_bfd_link_section_stabs): Add string offset parameter. * cofflink.c (coff_link_add_symbols): Deal with split stab sections. * elflink.h (elf_link_add_object_symbols): Deal with split stab sections. * stabs.c (_bfd_link_section_stabs): Add string offset parameter. * libbfd.h: Regenerated. ld/ChangeLog: * ldwrite.c (unsplittable_name): New. (clone_section): Strip existing numeric suffix. Only truncate names for coff targets. (split_sections): Use unsplittable_name. binutils/ChangeLog: * objdump.c (read_section_stabs): Just read one section, return pointer to it. Add size parameter. (print_section_stabs): Add string offset parameter. Adjust. (struct stab_section_names): Add string offset member. (find_stabs_sections): Correct check for split section suffix, adjust read_section_stabs and print_section_stabs calls. (dump_stabs_section): Clear string_offset, free string table.
2003-08-23 * elflink.h (elf_link_add_object_symbols): Don't crash on NULL owner.Alan Modra1-1/+2
2003-08-20Better handking for unresolved symbolsNick Clifton1-16/+10
2003-08-07 * elfxx-target.h: Remove PTR cast.Alan Modra1-17/+18
* targets.c (bfd_target): Make backend_data const void *. * elf-bfd.h: Constify all occurrences of struct elf_backend_data. * elf-m10300.c: Likewise. * elf.c: Likewise. * elf32-hppa.c: Likewise. * elf32-i386.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-ppc.c: Likewise. * elf32-s390.c: Likewise. * elf32-sh.c: Likewise. * elf32-sh64.c: Likewise. * elf32-sparc.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-mips.c: Likewise. * elf64-ppc.c: Likewise. * elf64-s390.c: Likewise. * elf64-sh64.c: Likewise. * elf64-sparc.c: Likewise. * elf64-x86-64.c: Likewise. * elfcode.h: Likewise. * elfcore.h: Likewise. * elflink.c: Likewise. * elflink.h: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. * elfxx-mips.h: Likewise. * elf.c (prep_headers): Remove useless check for null backend_data. * bfd-in2.h: Regenerate.
2003-08-04Prefix .gnu.warning section messages with "warning: ".Nick Clifton1-3/+7
2003-08-04 * elfcode.h: Convert to C90, remove unneeded casts and prototypes.Alan Modra1-391/+246
* elfcore.h: Likewise. * elflink.c: Likewise. * elflink.h: Likewise. * elf.c (sym_is_global): Remove INLINE. (align_file_position): Replace INLINE with inline. * elfcode.h (elf_swap_dyn_in, elf_swap_dyn_out): Remove INLINE. (elf_file_p): Replace INLINE with inline.
2003-07-10 * elf64-ppc.c (bfd_elf64_mkobject): Define.Alan Modra1-15/+14
(struct ppc64_elf_obj_tdata): New. (ppc64_elf_tdata, ppc64_tlsld_got): Define. (ppc64_elf_mkobject): New function. (struct got_entry): Add "owner". Move "tls_type". (struct ppc_link_hash_table): Delete "relgot", "tlsld_got". (ppc64_elf_init_stub_bfd): New function. (create_got_section): Create header .got in dynobj. Create .got and .rela.got in each bfd. Stash pointers in ppc64_elf_obj_tdata. (ppc64_elf_create_dynamic_sections): Don't call create_got_section. Look for dynobj .got, and test it. (ppc64_elf_copy_indirect_symbol): Adjust for changed got. (update_local_sym_info): Likewise. (ppc64_elf_check_relocs): Likewise. (ppc64_elf_gc_sweep_hook): Likewise. (ppc64_elf_tls_optimize): Likewise. (allocate_dynrelocs): Likewise. (ppc64_elf_size_dynamic_sections): Likewise. (ppc64_elf_relocate_section): Likewise. (ppc64_elf_next_toc_section): Update comment. (toc_adjusting_stub_needed): Remove unneeded cast. (ppc64_elf_build_stubs): Check for stub sections in stub bfd by testing section flags. (ppc64_elf_build_stubs): Likewise. (ppc64_elf_size_stubs): Likewise. Remove stub_bfd param. (ppc64_elf_finish_dynamic_sections): Write out got sections. (func_desc_adjust): Copy over dynamic info for undef weaks. * elf64-ppc.h (ppc64_elf_init_stub_bfd): Declare. (ppc64_elf_size_stubs): Update prototype. * elflink.h (elf_link_sort_relocs): Use link_orders to find reldyn input sections rather than scanning dynobj.
2003-07-04 * elf-bfd.h (_bfd_elf_create_linker_section) Don't declare.Alan Modra1-258/+0
(_bfd_elf_find_pointer_linker_section): Likewise. (bfd_elf32_create_pointer_linker_section): Likewise. (bfd_elf32_finish_pointer_linker_section): Likewise. (bfd_elf64_create_pointer_linker_section): Likewise. (bfd_elf64_finish_pointer_linker_section): Likewise. (_bfd_elf_make_linker_section_rela): Likewise. * elfcode.h (elf_create_pointer_linker_section): Don't define. (elf_finish_pointer_linker_section): Likewise. * elflink.c (_bfd_elf_make_linker_section_rela): Delete. (_bfd_elf_create_linker_section): Move this function.. (_bfd_elf_find_pointer_linker_section): ..and this.. * elflink.h (elf_create_pointer_linker_section): ..and this.. (elf_finish_pointer_linker_section): ..and this.. * elf32-ppc.c: ..to here, renaming to the following, and adjusting calls. (elf_create_linker_section): Convert to C90, tidy. (elf_find_pointer_linker_section): Likewise. (elf_create_pointer_linker_section): Likewise. (elf_finish_pointer_linker_section): Likewise. * elf32-i370.c: Delete #if 0 code.
2003-06-25Correct spelling of "relocatable".Alan Modra1-35/+35
2003-06-232003-06-23 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-2/+2
* elflink.h (elf_link_input_bfd): Check raw size when using kept_section to preserve debug information discarded by linkonce.
2003-06-18 * elflink.h (elf_gc_record_vtentry): Revert last change. CorrectAlan Modra1-8/+9
size calculation from addend. Round size up.
2003-06-18bfd/H.J. Lu1-9/+27
2003-06-17 H.J. Lu <hongjiu.lu@intel.com> * section.c (struct sec): Put back kept_section. (STD_SECTION): Put back kept_section initialization. * bfd-in2.h: Regenerate. * elflink.h (elf_link_input_bfd): Also check discarded linkonce sections for relocateable output. Use kept_section to preserve debug information discarded by linkonce. ld/ 2003-06-17 H.J. Lu <hongjiu.lu@intel.com> * ldlang.c (section_already_linked): Put back assignment of kept_section.
2003-06-17(elf_gc_record_vtentry): Allocate an extra element in the vtable_entries_usedNick Clifton1-3/+4
array to allow for the accessing the largest element.
2003-06-03binutils/Jakub Jelinek1-0/+37
* readelf.c (get_segment_type): Handle PT_GNU_STACK. bfd/ * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK. (bfd_section_from_phdr): Likewise. (map_sections_to_segments): Create PT_GNU_STACK segment header. (get_program_header_size): Count with PT_GNU_STACK. * elf-bfd.h (struct elf_obj_tdata): Add stack_flags. * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags. include/ * bfdlink.h (struct bfd_link_info): Add execstack and noexecstack. * elf/common.h (PT_GNU_STACK): Define. ld/ * ldgram.y (phdr_type): Grok PT_GNU_STACK. * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Add -z execstack and -z noexecstack. (gld${EMULATION_NAME}_list_options): Likewise. * scripttempl/elf.sc: If not -r, discard .note.GNU-stack section.
2003-06-03bfd/H.J. Lu1-26/+21
2003-06-03 H.J. Lu <hongjiu.lu@intel.com> * elflink.h (elf_link_input_bfd): Call linker error_handler for discarded definitions. include/ 2003-06-03 H.J. Lu <hongjiu.lu@intel.com> * bfdlink.h (LD_DEFINITION_IN_DISCARDED_SECTION): New. ld/ 2003-06-03 H.J. Lu <hongjiu.lu@intel.com> * ldmisc.c: Include "bfdlink.h". (error_handler): Handle LD_DEFINITION_IN_DISCARDED_SECTION and -LD_DEFINITION_IN_DISCARDED_SECTION. * Makefile.am: Rebuild dependency. * Makefile.in: Regenerated. ld/testsuite/ 2003-06-03 H.J. Lu <hongjiu.lu@intel.com> * ld-discard/extern.d: Updated. * ld-discard/start.d: Likewise. * ld-discard/static.d: Likewise.
2003-05-30bfd/Jakub Jelinek1-5/+6
* elflink.h (elf_link_add_object_symbols): Use !info->executable instead of info->shared where appropriate. (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. * elflink.c (_bfd_elf_create_got_section): Likewise. (_bfd_elf_link_create_dynamic_sections): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section and DT_DEBUG dynamic tag even for position independent executables. * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. include/ * bfdlink.h (struct bfd_link_info): Add pie and executable bits. ld/ * lexsup.c (OPTION_PIE): Define. (ld_options): Add -pie and --pic-executable options. (parse_args): Handle OPTION_PIE. * ldmain.c (main): Initialize link_info.pie and link_info.executable. * genscripts.sh: Generate PIE scripts. * ld.texinfo: Document -pie and --pic-executable options. * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): (gld${EMULATION_NAME}_place_orphan): Likewise. (gld${EMULATION_NAME}_get_script): Include PIE scripts. * scripttempl/elf.sc: In PIE scripts set . the same way as in shared scripts. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Set to yes. * emulparams/elf64_ia64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64ppc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_x86_64.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf32_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_sparc.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64alpha.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf64_s390.sh (GENERATE_PIE_SCRIPT): Likewise. * emulparams/elf_i386.sh (GENERATE_PIE_SCRIPT): Likewise.
2003-05-20bfd/H.J. Lu1-1/+1
2003-05-20 Jakub Jelinek <jakub@redhat.com> * elflink.h (elf_link_output_extsym): Only issue error about != STV_DEFAULT symbols if they are bfd_link_hash_undefined. 2003-05-20 H.J. Lu <hongjiu.lu@intel.com> * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF when removing the old definition for symbols with non-default visibility. ld/testsuite/ 2003-05-20 Jakub Jelinek <jakub@redhat.com> * ld-elfvsb/common.c: New file. * ld-elfvsb/elfvsb.exp: Add common. 2003-05-20 H.J. Lu <hongjiu.lu@intel.com> * ld-elfvsb/sh3.c: New file. * ld-elfvsb/test.c: Likewise. * ld-elfvsb/elfvsb.exp: Add new weak hidden symbol tests.
2003-05-17 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCALAlan Modra1-1/+1
to trim plt entries. Move undefweak non-default visibility test.. (allocate_dynrelocs): ..from here. * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test dynamic_sections_created here. Update comment. Move undefweak non-default visibility test.. (allocate_dynrelocs): ..from here. Fix comment. * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to trim plt entries. Move undefweak non-default visibility test.. (allocate_dynrelocs): ..from here. Fix comment. * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with STV_DEFAULT rather than comparing with zero. * elflink.c (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. Format comment.
2003-05-152003-05-14 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-2/+4
* elflink.h (elf_link_check_versioned_symbol): Also allow the base version.
2003-05-09 * elflink.c (_bfd_elf_link_create_dynamic_sections): Move fromAlan Modra1-2135/+60
elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align. (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align. (bfd_elf_record_link_assignment): Move from elflink.h. (_bfd_elf_merge_symbol): Likewise. (_bfd_elf_add_default_symbol): Likewise. (_bfd_elf_export_symbol): Likewise. (_bfd_elf_link_find_version_dependencies): Likewise. (_bfd_elf_link_assign_sym_version): Likewise. (_bfd_elf_link_read_relocs): Likewise. (_bfd_elf_link_size_reloc_section): Likewise. (_bfd_elf_fix_symbol_flags): Likewise. (_bfd_elf_adjust_dynamic_symbol): Likewise. (_bfd_elf_link_sec_merge_syms): Likewise. (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel and bed->s->sizeof_rela. (_bfd_elf_link_output_relocs): Likewise. * elf-bfd.h (struct elf_size_info): Rename file_align to log_file_align. (struct elf_info_failed): Move from elflink.h. (struct elf_assign_sym_version_info): Likewise. (struct elf_find_verdep_info): Likewise. (_bfd_elf_create_dynamic_sections): Delete duplicate declaration. (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol, _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, _bfd_elf_link_assign_sym_version, _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs, _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs, _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, _bfd_elf_link_sec_merge_syms): Declare. (bfd_elf32_link_create_dynamic_sections): Don't declare. (_bfd_elf32_link_read_relocs): Likewise. (bfd_elf64_link_create_dynamic_sections): Likewise. (_bfd_elf64_link_read_relocs): Likewise. * elflink.h: Move lots o' stuff elsewhere. * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare. (bfd_elf64_record_link_assignment): Likewise. (bfd_elf_record_link_assignment): Declare. * bfd-in2.h: Regenerate. * elfcode.h (elf_link_create_dynamic_sections): Don't declare. (NAME(_bfd_elf,size_info)): Adjust for log_file_align. * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align. (assign_file_positions_for_segments): Likewise. (assign_file_positions_except_relocs): Likewise. (swap_out_syms, elfcore_write_note): Likewise. * elf-m10200.c: Adjust for changed function names. * elf-m10300.c: Likewise. * elf32-arm.h: Likewise. * elf32-h8300.c: Likewise. * elf32-hppa.c: Likewise. * elf32-ip2k.c: Likewise. * elf32-m32r.c: Likewise. * elf32-m68hc11.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-m68k.c: Likewise. * elf32-mips.c: Likewise. * elf32-ppc.c: Likewise. * elf32-sh.c: Likewise. * elf32-v850.c: Likewise. * elf32-xtensa.c: Likewise. * elf64-alpha.c: Likewise. * elf64-hppa.c: Likewise. * elf64-mmix.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sh64.c: Likewise. * elfxx-ia64.c: Likewise. * elfxx-mips.c: Likewise. (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align. * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align. * elf64-hppa.c (hppa64_elf_size_info): Likewise. * elf64-mips.c (mips_elf64_size_info): Likewise. * elf64-s390.c (s390_elf64_size_info): Likewise. * elf64-sparc.c (sparc64_elf_size_info): Likewise.
2003-05-082003-05-08 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-1/+2
* elflink.h (elf_add_default_symbol): After skipping the unversioned symbol, go to non-default one.
2003-05-082003-05-07 H.J. Lu <hongjiu.lu@intel.com>H.J. Lu1-7/+32
* elflink.h (elf_link_check_versioned_symbol): Also handle the case that a DSO references a hidden symbol which may be satisfied by a versioned symbol in another DSO. (elf_link_output_extsym): Check versioned definition for hidden symbol referenced by a DSO.
2003-05-05bfd/H.J. Lu1-1/+13
2003-05-04 H.J. Lu <hjl@gnu.org> * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic relocation entries for weak undefined symbols with non-default visibility. (elf_i386_relocate_section): Initialize the GOT entries and skip R_386_32/R_386_PC32 for weak undefined symbols with non-default visibility. * elfxx-ia64.c (allocate_fptr): Don't allocate function descriptors for weak undefined symbols with non-default visibility. (allocate_dynrel_entries): Don't allocate relocation entries for symbols resolved to 0. (set_got_entry): Don't install dynamic relocation for weak undefined symbols with non-default visibility. (set_pltoff_entry): Likewise. * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols with non-default visibility. (elf_link_output_extsym): Don't make weak undefined symbols with non-default visibility dynamic. ld/testsuite/ 2003-05-04 H.J. Lu <hjl@gnu.org> * ld-elfvsb/main.c: Updated. * ld-elfvsb/sh1.c: Likewise.
2003-05-05bfd/H.J. Lu1-15/+62
2003-05-04 H.J. Lu <hjl@gnu.org> * elflink.h (elf_merge_symbol): Correctly handle weak definiton. ld/testsuite/ 2003-05-04 H.J. Lu <hjl@gnu.org> * ld-elfvers/vers18.dsym: Updated for weak definiton change. * ld-elfvers/vers18.ver: Likewise. * ld-elfvers/vers19.ver: Likewise. * ld-elfweak/elfweak.exp: Remove xfail.
2003-05-052003-05-04 H.J. Lu <hjl@gnu.org>H.J. Lu1-4/+21
* elflink.h (elf_merge_symbol): Don't record a hidden/internal symbol dynamic. Check indirection when removing the old definition for symbols with non-default visibility. (elf_add_default_symbol): Skip when told by elf_merge_symbol.
2003-04-28bfd/H.J. Lu1-1/+3
2003-04-28 H.J. Lu <hjl@gnu.org> * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol to copy any information related to dynamic linking when we flip the indirection. ld/testsuite/ 2003-04-28 H.J. Lu <hjl@gnu.org> * ld-elfvers/vers.exp (picflag): Set PIC flag for compiler. (build_vers_lib): Support PIC. (build_vers_lib_no_pic): New. Change all calls to build_vers_lib to build_vers_lib_no_pic. (build_vers_lib_pic): New. Add tests vers26a, vers26b1, vers26b2 and vers26b3 for versioned definition vs. normal definition in different files. * ld-elfvers/vers26a.c: New file. * ld-elfvers/vers26a.dsym: Likewise. * ld-elfvers/vers26a.map: Likewise. * ld-elfvers/vers26a.ver: Likewise. * ld-elfvers/vers26b.c: Likewise. * ld-elfvers/vers26b.dsym: New empty file. * ld-elfvers/vers26b.ver: Likewise.
2003-04-28bfd/H.J. Lu1-13/+110
2003-04-27 H.J. Lu <hjl@gnu.org> * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New. (ELF_LINK_DYNAMIC_WEAK): New. * elflink.h (elf_merge_symbol): Add one argument to indicate if a symbol should be skipped. Ignore definitions in dynamic objects for symbols with non-default visibility. (elf_add_default_symbol): Adjusted. (elf_link_add_object_symbols): Check if a symbol should be skipped. Don't merge the visibility field with the one from a dynamic object. (elf_link_check_versioned_symbol): Use undef_bfd. (elf_link_output_extsym): Warn if a forced local symbol is referenced from dynamic objects. Make non-weak undefined symbol with non-default visibility a fatal error. ld/testsuite/ 2003-04-27 H.J. Lu <hjl@gnu.org> * ld-elfvsb/elfvsb.dat: Updated. * ld-elfvsb/elfvsb.exp: Likewise. * ld-elfvsb/main.c: Likewise. * ld-elfvsb/sh1.c: Likewise. * ld-elfvsb/sh2.c: Likewise.
2003-04-252003-04-25 Alan Modra <amodra@bigpond.net.au>H.J. Lu1-15/+30
* elflink.h (elf_merge_symbol): When we find a regular definition for an indirect symbol, flip the indirection so that the old direct symbol now points to the new definition.
2003-04-15Properly report filename for alignment reduction.Nick Clifton1-6/+20
Add test for alignment reduction.
2003-04-14Maintain maximum alignment for common symbols. Warn reducing alignment forNick Clifton1-7/+62
common symbols. Report old filename when symbol size changes.