summaryrefslogtreecommitdiff
path: root/ld/pe-dll.c
Commit message (Collapse)AuthorAgeFilesLines
* * pe-dll.c (process_def_file_and_drectve): Don't handle VCKai Tietz2013-03-211-2/+5
| | | | generated C++-symbols as stdcall/fastcall.
* Remove trailing white spaces in ldH.J. Lu2013-01-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * deffilep.y: Remove trailing white spaces. * elf-hints-local.h: Likewise. * ldexp.c: Likewise. * ldlang.h: Likewise. * ldmisc.c: Likewise. * ldwrite.c: Likewise. * pe-dll.c: Likewise. * emulparams/criself.sh: Likewise. * emulparams/crislinux.sh: Likewise. * emulparams/elf32_tic6x_le.sh: Likewise. * emulparams/elf32bmipn32-defs.sh: Likewise. * emulparams/elf32mb_linux.sh: Likewise. * emulparams/elf32mep.sh: Likewise. * emulparams/elf32microblaze.sh: Likewise. * emulparams/elf32ppc.sh: Likewise. * emulparams/elf64_s390.sh: Likewise. * emulparams/elf64alpha.sh: Likewise. * emulparams/elf_s390.sh: Likewise. * emulparams/elf_x86_64.sh: Likewise. * emulparams/tic80coff.sh: Likewise. * emultempl/aix.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/cr16elf.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/tic6xdsbt.em: Likewise.
* PR ld/14357Nick Clifton2012-07-131-2/+3
| | | | | | | | | | | | * ldmain.c (trace_file_tries): Rename to 'verbose'. * ldfile.c: Likewise. * ldlang.c: Likewise. * ldmain.h: Likewise. * lexsup.c: Likewise. * emultempl/elf32.em: Likewise. * emultemp/spuelf.em: Likewise. * pe-dll.c (pe_dll_generate_implib): Only print creation message in verbose mode.
* 2012-05-07 Tristan Gingold <gingold@adacore.com>Tristan Gingold2012-05-071-1/+1
| | | | * pe-dll.c (udef_table): Make it static.
* Replace all uses of bfd_abs_section, bfd_com_section, bfd_und_sectionAlan Modra2012-05-051-6/+7
| | | | | and bfd_ind_section with their _ptr variants, or use corresponding bfd_is_* macros.
* 2012-03-14 Kai Tietz <ktietz@redhat.com>Kai Tietz2012-03-141-26/+168
| | | | | | | | | | | | | | | Pascal Obry <pascal@obry.net> * pe-dll.c (found_sym): New static variable. (undef_count): Likewise. (key_value): New structure. (undef_sort_cmp): Compare routine for qsort/bsearch. (pe_find_cdecl_alias_match): Add new argument. (pe_undef_alias_cdecl_match): Removed. (pe_undef_count): New helper routine. (pe_create_undef_table): Likewise. (pe_process_import_defs): Use pe_create_undef_table and new pe_undef_alias_cdecl_match function.
* * deffilep.y (cmp_import_elem): Sort first by module name.Kai Tietz2012-02-191-88/+96
| | | | | | | | | * pe-dll.c (process_def_file_and_drectve): Free strings from removed export-element. (add_bfd_to_link): Optimize loop on import-elements and lower allocated memory. (pe_implied_import_dll): Pass NULL instead of 0 for pointer argument.
* * pe-dll.c (auto_export): Use bsearch to speed up scan of exportsNick Clifton2012-02-111-8/+21
| | | | | | table. (process_def_file_and_drectve): Maintain sorting of exports table after stripping leading @ signs.
* * pe-dll.c (generate_reloc): Don't emit a base reloc for anDave Korn2011-10-131-0/+9
| | | | underlying BFD reloc that will be discarded in eh_frame data.
* Check if a symbol is hidden by linker script.H.J. Lu2011-09-161-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bfd/ 2011-09-15 H.J. Lu <hongjiu.lu@intel.com> PR ld/12975 * bfd-in.h (bfd_elf_size_dynamic_sections): Remove pointer to struct bfd_elf_version_tree. * elflink.c (elf_info_failed): Remove verdefs. (_bfd_elf_export_symbol): Updated. _bfd_elf_link_assign_sym_version): Likewise. (bfd_elf_size_dynamic_sections): Remove pointer to struct bfd_elf_version_tree. Updated. (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is hidden by linker script. * linker.c (bfd_hide_sym_by_version): New. * bfd-in2.h: Regenerated. include/ 2011-09-15 H.J. Lu <hongjiu.lu@intel.com> PR ld/12975 * bfdlink.h (bfd_link_info): Add version_info. ld/ 2011-09-15 H.J. Lu <hongjiu.lu@intel.com> PR ld/12975 * ldlang.c (lang_elf_version_info): Removed. (lang_register_vers_node): Replace lang_elf_version_info with link_info.version_info. (lang_add_vers_depend): Likewise. * pe-dll.c (process_def_file_and_drectve): Likewise. * emultempl/solaris2.em (elf_solaris2_before_allocation): Likewise. * ldlang.h (lang_elf_version_info): Removed. * plugin.c (is_visible_from_outside): Check if symbol is hidden by version script. * emultempl/elf32.em (gld${EMULATION_NAME}_before_allocation): Remove lang_elf_version_info. ld/testsuite/ 2011-09-15 H.J. Lu <hongjiu.lu@intel.com> PR ld/12975 * ld-elf/pr12975.d: New. * ld-elf/pr12975.s: Likewise. * ld-elf/pr12975.t: Likewise.
* PR ld/12726Alan Modra2011-05-031-3/+3
| | | | | | | | | | | * ldexp.h (lang_phase_type): Add lang_assigning_phase_enum. * ldexp.c (exp_fold_tree_1): Correct assign to dot comment. Don't assign to dot when lang_assigning_phase_enum. * ldlang.h (lang_do_assignments): Update prototype. * ldlang.c (lang_do_assignments): Add phase parameter. Update all callers. * pe-dll.c (pe_dll_fill_sections, pe_exe_fill_sections): Update lang_do_assignments calls.
* 2011-04-13 Kai Tietz <ktietz@redhat.com>Kai Tietz2011-04-131-7/+13
| | | | | | | | | | | | | | | | | PR binutils/12658 * deffile.h (def_file_add_export): Add is_dup argument. (def_file_add_import): Likewise. * deffilep.y (are_names_equal): New helper. (cmp_export_elem): New helper. (find_export_in_list): Add search routine for exports. (def_file_add_export): Check for duplicates. (cmp_import_elem): New helper. (find_import_in_list): Add search routine for imports. (def_file_add_import): Check for duplicates. (def_exports): Handle duplicates. (def_imports): Likewise. * pe-dll.c (process_def_file_and_drectve): Likewise. (pe_implied_import_dll): Likewise.
* 2011-02-28 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2011-02-281-5/+6
| | | | | | | | | | | | | | | | | | | | | * emultempl/beos.em (sort_by_file_name): Use filename_(n)cmp. * emultempl/elf32.em (gld${EMULATION_NAME}_vercheck): Likewise. (gld${EMULATION_NAME}_stat_needed): Likewise. (gld${EMULATION_NAME}_check_needed): Likewise. * emultempl/pe.em (gld_${EMULATION_NAME}_after_open): Likewise. (gld_${EMULATION_NAME}_unrecognized_file): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_after_open): Likewise. (gld_${EMULATION_NAME}_unrecognized_file): Likewise. * ldfile.c (ldfile_open_file): Likewise. * ldlang.c (wild_sort): Likewise. (lookup_name): Likewise. (check_excluded_libs): Likewise. * ldmisc.c (vfinfo): Likewise. * pe-dll.c (libnamencmp): Likewise. (auto_export): Likewise. (pe_dll_generate_implib): Likewise. * testplug.c (onclaim_file): Likewise.
* 2011-02-15 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2011-02-151-2/+1
| | | | | * pe-dll.c (process_def_file_and_drectve): Don't strip leading underscore from symbol by calling bfd_find_version_for_sym.
* fix set but unused variable warningsAlan Modra2010-06-271-14/+2
|
* PR ld/11603Dave Korn2010-06-091-22/+22
| | | | | * pe-dll.c (process_def_file_and_drectve): Reorder check for forwarded export name after check for ordinary export.
* 2010-05-15 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2010-05-151-2/+8
| | | | | | | | | | | | | | | | | * emultempl/pe.em (is_underscoring): New helper function. (gld_${EMULATION_NAME}_before_parse): Replace code for pe(p)_leading_underscore detection by is_underscoring. (U): Likewise. (GET_INIT_SYMBOL_NAME): Likewise. (U_SIZE): Likewise. (set_pe_name): (set_entry_point): (gld_${EMULATION_NAME}_set_symbols): * emultempl/pep.em: Likewise. * pe-dll.c (pe_detail_list): Set default underscoring for x64 target. (pe_dll_id_target): Add initialization of pe(p)_leading_underscore.
* * pe-dll.c: Removed trailing whitespaces.Dave Korn2010-05-151-5/+5
|
* 2010-04-27 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2010-04-281-14/+15
| | | | | | | | | | * pe-dll.c (_nm_-symbols): Use always underscored variant for symbols. (__imp_-symbols): Likewise. (___imp_-symbols): Likewise. * NEWS: Mention ABI change for x64 PE-COFF. PS: Sorry, missed this part of approved patch.
* 2010-04-05 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2010-04-051-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * emultempl/pep.em (U): Macro modified. (U_SIZE): New helper macro. (GET_INIT_SYMBOL_NAME): Likewise. (enum options): Add OPTION_NO_LEADING_UNDERSCORE and OPTION_LEADING_UNDERSCORE enumerator-values. (gld${EMULATION_NAME}_add_options): Add --(no-)leading-underscore option. (definfo): Add new member is_c_symbol. (D): Add to macro underscore mode parameter. (init): Add definition for is_c_symbol. (gld_${EMULATION_NAME}_list_options): Display new options. (set_pep_name): Adjust underscoring dependent fixed symbol handling. (gld_${EMULATION_NAME}_set_symbols): Likewise. (saw_option): Likewise. (gld_${EMULATION_NAME}_unrecognized_file): Likewise. (set_entry_point): Initial initial_symbol_char dependent to target's default and new option flag pep_leading_underscore. * emultempl/pe.em (U): Macro modified. (U_SIZE): New helper macro. (GET_INIT_SYMBOL_NAME): Likewise. (OPTION_LEADING_UNDERSCORE): Add new option define. (OPTION_NO_LEADING_UNDERSCORE): Likewise. (gld${EMULATION_NAME}_add_options): Add --(no-)leading-underscore option. (definfo): Add new member is_c_symbol. (D): Add to macro underscore mode parameter. (init): Add definition for is_c_symbol. (gld_${EMULATION_NAME}_list_options): Display new options. (set_pep_name): Adjust underscoring dependent fixed symbol handling. (gld_${EMULATION_NAME}_set_symbols): Likewise. (saw_option): Likewise. (gld_${EMULATION_NAME}_unrecognized_file): Likewise. (set_entry_point): Initial initial_symbol_char dependent to target's default and new option flag pep_leading_underscore. * pe-dll.c (pe_leading_underscore): New flag variable. (pe_detail_list): Remove const to allow modify of member underscore. (pe_dll_id_target): Initialize pe_details' underscore variable dependent to target's default and flag pe_leading_underscore. * pe-dll.h (pe_leading_underscore): Add extern declaration of option flag. * pep-dll.c (pe_leading_underscore): Add alias define for pep_leading_underscore. * pep-dll.h (pep_leading_underscore) Add extern declaration of option flag. * ld.texinfo: Add documentation for --(no-)leading-underscore option.
* * pe-dll.c (make_one): Make text section readonly.Nick Clifton2010-03-181-3/+7
| | | | | | (make_one): Add *ABS* symbol @feat.00 with value 1 to tag the jump stub on X86 as /SAFESEH compatible for native toolchains.
* * pe-dll.c (generate_reloc): Take account of wrapper options whenDave Korn2009-12-171-3/+22
| | | | | testing if a weak symbol is defined or not, and when it is not, consider whether the default value requires a base reloc anyway.
* Add -Wshadow to the gcc command line options used when compiling the binutils.Nick Clifton2009-12-111-20/+20
| | | | Fix up all warnings generated by the addition of this switch.
* 2009-11-27 Tristan Gingold <gingold@adacore.com>Tristan Gingold2009-11-271-2/+7
| | | | | * pe-dll.c (pe_implied_import_dll): Return early if there is no export entries.
* 2009-11-15 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-11-151-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | * pe-dll.c (pe_undef_alias_cdecl_match): New function. (pe_find_cdecl_alias_match): New function. (pe_process_import_defs): Add matching for import symbols declared as cdecl for fastcall/stdcall. * emultempl/pe.em (pe_undef_cdecl_match): Treat fastcall symbols, too. (pe_fixup_stdcalls): Likewise. (gld_XXX_after_open): Redo scanning for imported fastcall/stdcall symbols as cdecl one. * emultempl/pep.em (pep_undef_cdecl_match): Treat fastcall symbols, too. (pep_fixup_stdcalls): Likewise. (gld_XXX_after_open): Redo scanning for imported fastcall/stdcall symbols as cdecl one. 2009-11-15 Kai Tietz <kai.tietz@onevision.com> * ld-pe/direct2_client.c: New file. * ld-pe/direct2_dll.c: Likewise. * ld-pe/direct2_dll.def: Likewise. * ld-pe/pe-run2.exp: Likewise.
* 2009-10-23 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-10-231-8/+32
| | | | | | | | | | | | | | | | | | | | | | | | | * deffile.h (def_file_export): New member its_name. (def_file_import): Likewise. (def_file_add_export): Add argument its_name. (def_file_add_import): Likewise. * deffilep.y (def_exports): Add argument its_name. (def_import): Likewise. (EQUAL): Add new token for '=='. (opt_equalequal_name): New rule. (expline): Add rule opt_equalequal_name. (impline): Likewise. (def_file_free): Free for exports and imports the optional member its_name. (def_lex): Add scan of '==' as EQUAL. * pe-dll.c (pe_export_sort): Sort for its_name too. (process_def_file_and_drectve): Adjust calls to def_file_add_export. (generate_edata): Take its_name in account. (make_one): Likewise. (pe_process_import_defs): Likewise. (pe_dll_generate_def_file): Add print of new '==' option. * ld.texinfo: Extend documentation about .def file syntax. * NEWS: Mention new feature.
* * emultempl/pe.em (OPTION_EXCLUDE_ALL_SYMBOLS): New macro.Nick Clifton2009-10-161-5/+7
| | | | | | | | | | | | | | | (gld${EMULATION_NAME}_add_options): Add new --exclude-all-symbols option to exclude all symbols from automatic export. (gld_${EMULATION_NAME}_list_options): Describe it. (gld${EMULATION_NAME}_handle_option): Handle it. * emultempl/pep.em: Likewise to all the above. * pe-dll.c (pe_dll_exclude_all_symbols): New variable. (process_def_file_and_drectve): Use it. * pe-dll.h (pe_dll_exclude_all_symbols): Declare. * pep-dll.c (pep_dll_exclude_all_symbols): Define pep_ alias. * pep-dll.h (pe_dll_exclude_all_symbols): Declare. * NEWS: Mention the new feature. * ld.texinfo: Document the new command line switch.
* ==> bfd/ChangeLog <==Dave Korn2009-05-191-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * cofflink.c (process_embedded_commands): Ignore "-aligncomm". ==> gas/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * NEWS: Mention new feature. * config/obj-coff.c (obj_coff_common_parse): New function. (obj_coff_comm): Likewise. (coff_pseudo_table): Override default ".comm" definition on PE. * doc/as.texinfo: Document new feature. ==> gas/testsuite/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * gas/pe/: New directory for PE format-specific tests. * gas/pe/aligncomm-a.d: New test pattern file. * gas/pe/aligncomm-a.s: New test source file. * gas/pe/aligncomm-b.d: New test pattern file. * gas/pe/aligncomm-b.s: New test source file. * gas/pe/aligncomm-c.d: New test pattern file. * gas/pe/aligncomm-c.s: New test source file. * gas/pe/aligncomm-d.d: New test pattern file. * gas/pe/aligncomm-d.s: New test source file. * gas/pe/pe.exp: New test control script. * lib/gas-defs.exp (is_pecoff_format): New function. ==> ld/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * NEWS: Mention new feature. * deffile.h (def_file_aligncomm): Add new struct definition. (def_file): Add new def_file_aligncomm member. * deffilep.y (%token): Add new ALIGNCOMM token. (command): Add production rule for ALIGNCOMM. (def_file_free): Free any chained def_file_aligncomm structs. (diropts[]): Add entry for '-aligncomm' .drectve command. (def_aligncomm): New grammar function. * ld.texinfo: Document new feature. * pe-dll.c (process_def_file): Rename from this ... (process_def_file_and_drectve): ... to this, updating all callers, and process any aligncomms chained to the def file after scanning all .drectve sections. (generate_edata): Updated to match. (pe_dll_build_sections): Likewise. ==> ld/testsuite/ChangeLog <== 2009-05-19 Dave Korn <dave.korn.cygwin@gmail.com> * ld-pe/aligncomm-1.c: New test source file. * ld-pe/aligncomm-2.c: Likewise. * ld-pe/aligncomm-3.c: Likewise. * ld-pe/aligncomm-4.c: Likewise. * ld-pe/aligncomm.d: New test pattern file. * ld-pe/direct.exp: Deleted, and content moved into ... * ld-pe/pe-run.exp: ... New common file for all PE run tests. * ld-pe/vers-script.exp: Deleted, and content merged into ... * ld-pe/pe-compile.exp: ... New common file for PE tests needing a compiler, adding aligned common tests. * ld-pe/pe.exp: Update header comment.
* Committed on behalf ofDave Korn2009-05-171-0/+4
| | | | | | | | | | | | | | 2008-08-07 Aaron W. LaFramboise <aaron98wiridge9@aaronwl.com> ld/ChangeLog: * pe-dll.c (process_def_file): Do not create empty export table. ld/testsuite/ChangeLog: * ld-pe/exports.d: New file. * ld-pe/exports.s: New file. * ld-pe/pe.exp: New test for empty export table.
* bfd/ChangeLogDave Korn2009-05-041-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | * elflink.c (find_version_for_sym): Remove from here, ... * linker.c (bfd_find_version_for_sym): ... rename, replace here, make public and update all callers. * bfd-in2.h: Regenerate. ld/ChangeLog * NEWS: Mention new feature. * ld.texinfo (--version-script): Document extent of PE support. (WIN32): Mention --version-script. Extend auto-export description. * pe-dll.c (process_def_file): Use version script info to filter symbols from auto-export. * testsuite/ld-pe/vers-script-1.d: New file. * testsuite/ld-pe/vers-script-2.d: New file. * testsuite/ld-pe/vers-script-3.d: New file. * testsuite/ld-pe/vers-script-4.d: New file. * testsuite/ld-pe/vers-script-1.ver: New file. * testsuite/ld-pe/vers-script-2.ver: New file. * testsuite/ld-pe/vers-script-3.ver: New file. * testsuite/ld-pe/vers-script-4.ver: New file. * testsuite/ld-pe/vers-script-dll.c: New file. * testsuite/ld-pe/vers-script.exp: New test script.
* bfd/ChangeLogDave Korn2009-02-181-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * coff-alpha.c (alpha_ecoff_backend_data): Initialise fields which control long section name handling with ECOFF_NO_LONG_SECTION_NAMES. * coff-mips.c (mips_ecoff_backend_data): Likewise. * coff-rs6000.c (bfd_xcoff_backend_data): Initialise fields which control long section name handling with XCOFF_NO_LONG_SECTION_NAMES. (bfd_pmac_xcoff_backend_data): Likewise. * coff64-rs6000.c (bfd_xcoff_backend_data): Likewise. (bfd_xcoff_aix5_backend_data): Likewise. (xcoff64_write_object_contents): Delete unused long_section_names local variable. * coff-sh.c (bfd_coff_small_swap_table): Initialise long section name members using COFF_DEFAULT_LONG_SECTION_NAMES and make entire struct non-const. * coffcode.h (documentation): Update to describe long section names. (COFFLONGSECTIONCATHELPER): New helper macro. (BLANKOR1TOODD): Likewise. (COFF_ENABLE_LONG_SECTION_NAMES): Likewise. (COFF_LONG_SECTION_NAMES_SETTER): Likewise. (COFF_DEFAULT_LONG_SECTION_NAMES): Likewise. (bfd_coff_set_long_section_names_allowed): New function. (bfd_coff_set_long_section_names_disallowed): Likewise. (struct bfd_coff_backend_data): Add new backend hook function pointer _bfd_coff_set_long_section_names. (bfd_coff_set_long_section_names): New backend hook. (coff_write_object_contents): Only generate long section names if bfd_coff_long_section_names() indicates they are currently enabled. (bfd_coff_std_swap_table): Make non-const, and initialise long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. (ticoff0_swap_table): Likewise to both. (ticoff1_swap_table): Again, likewise to both. * coffgen.c (make_a_section_from_file): Allow long section names as inputs even if not currently allowed for outputs. * ecoff.c (_bfd_ecoff_no_long_sections): New function. * efi-app-ia32.c (COFF_LONG_SECTION_NAMES): Define to 0, not blank. * efi-app-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-app-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-bsdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-ia32.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-ia64.c (COFF_LONG_SECTION_NAMES): Likewise. * efi-rtdrv-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-arm.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-i386.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-mcore.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-mips.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-ppc.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-sh.c (COFF_LONG_SECTION_NAMES): Likewise. * pei-x86_64.c (COFF_LONG_SECTION_NAMES): Likewise. * libcoff-in.h: Update copyright year to cause updated copyright year in generated libcoff.h, and fix typo. * libcoff.h: Regenerated. * libecoff.h (ECOFF_NO_LONG_SECTION_NAMES): New macro. (_bfd_ecoff_no_long_sections): Add prototype. * libxcoff.h (XCOFF_NO_LONG_SECTION_NAMES): New macro. * pe-mips.c (COFF_LONG_SECTION_NAMES): Define empty if not already defined by an including .c file. * ticoff.h (ticoff0_swap_table): Make non-const, and initialise long section name fields using COFF_DEFAULT_LONG_SECTION_NAMES. (ticoff1_swap_table): Likewise to both. ld/ChangeLog * ld.texinfo: Update to mention long section name options. * NEWS: Mention new behaviour and command-line options. * pe-dll.c (pe_use_coff_long_section_names): New global variable. (pe_output_file_set_long_section_names): New function. (pe_dll_build_sections): Call it on output BFDs. (pe_exe_build_sections): Likewise. (pe_dll_fill_sections): Likewise. (pe_exe_fill_sections): Likewise. * pe-dll.h (pe_use_coff_long_section_names): Declare extern. (pe_output_file_set_long_section_names): Add prototype. * pep-dll.c (pe_use_coff_long_section_names): Define pep_ alias. (pe_output_file_set_long_section_names): Likewise. * pep-dll.h (pep_use_coff_long_section_names): Declare extern. (pep_output_file_set_long_section_names): Add prototype. * pe.em (OPTION_ENABLE_LONG_SECTION_NAMES): New getopt value macro. (OPTION_DISABLE_LONG_SECTION_NAMES): Likewise. (gld${EMULATION_NAME}_add_options): Add new options to xtra_long[]. (gld_${EMULATION_NAME}_list_options): Describe them. (gld${EMULATION_NAME}_handle_option): Set or clear global pe_use_coff_long_section_names flag when options recognised. (gld_${EMULATION_NAME}_after_open): En/disable long section names for main output bfd by calling pe_output_file_set_long_section_names. * pep.em (enum options): Extend enum with new getopt option values. (gld${EMULATION_NAME}_add_options): Add new options to xtra_long[]. (gld_${EMULATION_NAME}_list_options): Describe them. (gld${EMULATION_NAME}_handle_option): Set or clear global pe_use_coff_long_section_names flag when options recognised. (gld_${EMULATION_NAME}_after_open): En/disable long section names for main output bfd by calling pep_output_file_set_long_section_names. ld/testsuite/ChangeLog * ld-pe/longsecn-1.d: New test file. * ld-pe/longsecn-2.d: Likewise. * ld-pe/longsecn-3.d: Likewise. * ld-pe/longsecn-4.d: Likewise. * ld-pe/longsecn-5.d: Likewise. * ld-pe/longsecn.d: Likewise. * ld-pe/longsecn.exp: New test control script. * ld-pe/longsecn.s: New test source file.
* 2009-01-26 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-01-261-16/+86
| | | | | | | | | * pe-dll.c (tmp_seq2): New static variable. (make_singleton_name_imp): New. (make_import_fixup_entry): Use for v2 the _imp_<name> symbol and avoid duplicate import table generation for same symbol. (pe_create_runtime_relocator_reference): Make reference for 64-bit 8 bytes.
* 2009-01-08 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-01-081-7/+21
| | | | | | | | | | | | | | | | | | * pe.em (OPTION_USE_NUL_PREFIXED_IMPORT_TABLES): New. (gld..._add_options): Add new option --use-nul-prefixed-import-tables. (gld..._handle_option): Likewise. * pep.em: Same as for pe.em. * ld.texinfo: Add new option documentation for --use-nul-prefixed-import-tables. * pe-dll.c (pe_use_nul_prefixed_import_tables): New. (make_head): Make prefix leading zero prefix element for idata$4 and idata$5 dependent to new flag. (make_import_fixup_entry): Remove idata4/5 prefix. * pe-dll.h (pe_use_nul_prefixed_import_tables): New. * pep-dll.c (pe_use_nul_prefixed_import_tables): New. * pep-dll.h (pep_use_nul_prefixed_import_tables): New. * NEWS: Add new option.
* * NEWS: Mention new feature --exclude-modules-for-implib.Dave Korn2009-01-031-4/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ld.texinfo: Document new --exclude-modules-for-implib option. * pe-dll.c (exclude_list_struct): Change type member from int to new enumeration exclude_type. (pe_dll_add_excludes): Accept exclude_type instead of int param. (auto_export): Replace magic constants by exclude_type values and handle new choice EXCLUDEFORIMPLIB. (pe_dll_generate_implib): Accept a pointer to the link_info and iterate all input BFDs looking for EXCLUDEFORIMPLIB modules; re-open fresh BFDs for any found and link into import lib archive chain. * pe-dll.h (exclude_type): Add new enumerated type to replace magic constants previously used for exclude_list_struct type member. (pe_dll_add_excludes, pe_dll_generate_implib): Update prototypes. * pep-dll.h (exclude_type, pe_dll_add_excludes, pe_dll_generate_implib): Likewise to all the above. * emultempl/pe.em (OPTION_EXCLUDE_MODULES_FOR_IMPLIB): Define new getopts long option code for new --exclude-modules-for-implib option. (gld${EMULATION_NAME}_add_options): Add new entry to xtra_long[]. (gld_${EMULATION_NAME}_list_options): List usage for it. (gld${EMULATION_NAME}_handle_option): Use exclude_type enumerated values when calling pe_dll_add_excludes, and handle EXCLUDEFORIMPLIB. (gld_${EMULATION_NAME}_finish): Pass pointer to link_info when calling pe_dll_generate_implib. * emultempl/pep.em (options): Define new enumerated value for getopts long option code for new --exclude-modules-for-implib option. (gld${EMULATION_NAME}_add_options, gld_${EMULATION_NAME}_list_options, gld${EMULATION_NAME}_handle_option, gld_${EMULATION_NAME}_finish): Again, likewise to all the above.
* 2009-01-03 Dave Korn <dave.korn.cygwin@gmail.com>Dave Korn2009-01-031-1/+33
| | | | | | | | * pe-dll.c (autofilter_liblist): Add entry for shared libgcc. (libnamencmp): New function. (auto_export): Use it in place of strncmp when filtering libraries. Also rolled over ChangeLog to ChangeLog-2008
* include/elf/Nick Clifton2008-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * common.h (STT_IFUNC): Define. elfcpp/ * elfcpp.h (enum STT): Add STT_IFUNC. bfd/ * syms.c (struct bfd_symbol): Add new flag BSF_INDIRECT_FUNCTION. Remove redundant flag BFD_FORT_COMM_DEFAULT_VALUE. Renumber flags to remove gaps. (bfd_print_symbol_vandf): Return 'i' for BSF_INDIRECT_FUNCTION. (bfd_decode_symclass): Likewise. * elf.c (swap_out_syms): Translate BSF_INDIRECT_FUNCTION into STT_IFUNC. (elf_find_function): Treat STT_IFUNC in the same way as STT_FUNC. (_bfd_elf_is_function_type): Likewise. * elf32-arm.c (arm_elf_find_function): Likewise. (elf32_arm_adjust_dynamic_symbol): Likewise. (elf32_arm_swap_symbol_in): Likewise. (elf32_arm_additional_program_headers): Likewise. * elf32-i386.c (is_indirect_symbol): New function. (elf_i386_check_relocs): Also generate dynamic relocs for relocations against STT_IFUNC symbols. (allocate_dynrelocs): Likewise. (elf_i386_relocate_section): Likewise. * elf64-x86-64.c (is_indirect_symbol): New function. (elf64_x86_64_check_relocs): Also generate dynamic relocs for relocations against STT_IFUNC symbols. (allocate_dynrelocs): Likewise. (elf64_x86_64_relocate_section): Likewise. * elfcode.h (elf_slurp_symbol_table): Translate STT_IFUNC into BSF_INDIRECT_FUNCTION. * elflink.c (_bfd_elf_adjust_dynamic_reloc_section): Add support for STT_IFUNC symbols. (get_ifunc_reloc_section_name): New function. (_bfd_elf_make_ifunc_reloc_section): New function. * elf-bfd.h (struct bfd_elf_section_data): Add indirect_relocs field. * bfd-in2.h: Regenerate. gas/ * config/obj-elf.c (obj_elf_type): Add support for STT_IFUNC type. * doc/as.texinfo: Document new feature. * NEWS: Mention new feature. gas/testsuite/ * gas/elf/type.s: Add test of STT_IFUNC symbol type. * gas/elf/type.e: Update expected disassembly. * gas/elf/elf.exp: Update grep of symbol types. ld/ * NEWS: Mention new feature. * pe-dll.c (process_def_file): Replace use of redundant BFD_FORT_COMM_DEFAULT_VALUE with 0. * scripttempl/elf.sc: Add .rel.ifunc.dyn and .rela.ifunc.dyn sections. ld/testsuite/ * ld-mips-elf/reloc-1-n32.d: Updated expected output for reloc descriptions. * ld-mips-elf/reloc-1-n64.d: Likewise. * ld-i386/ifunc.d: New test. * ld-i386/ifunc.s: Source file for the new test. * ld-i386/i386.exp: Run the new test.
* 2008-12-02 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2008-12-021-1/+8
| | | | | * pe-dll.c (make_runtime_pseudo_reloc): Make symtab big enough to hold relocations.
* 2008-11-14 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2008-11-141-37/+64
| | | | | | | | | | | | | | | | | | | | | | * emultempl/pep.em (..._before_parse): initialize pei386_runtime_pseudo_reloc by version 2. (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V1): New option. (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V2): New option. (make_import_fixup): Use relocation size to read addend. * emultempl/pe.em (..._before_parse): initialize pei386_runtime_pseudo_reloc by version 1. (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V1): New option. (OPTION_DLL_ENABLE_RUNTIME_PSEUDO_RELOC_V2): New option. * pe-dll.c (pe-dll.h): Remove useless include. (make_runtime_pseudo_reloc): Change addend to use bfd_vma. Handle the two variants of pseudo-relocation. (pe_create_import_fixup): Change addend to type bfd_vma. Modify for the two pseudo_relocation variants. (runtime_pseudp_reloc_v2_init): New static variable. * pe-dll.h (pe_create_import_fixup): Change addend argument type to bfd_vma. * pep-dll.h (pep_create_import_fixup): Likewise. * NEWS: Add comment.
* 2008-09-26 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2008-09-291-0/+1
| | | | * pe-dll.c (make_import_fixup_entry): Make sure reloc is addend.
* bfd/Alan Modra2008-08-171-12/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | * bfd.c (struct _bfd): Correct outsymbols comment. * bfd-in2.h: Regenerate. * linker.c (bfd_generic_link_read_symbols): Renamed from.. (generic_link_read_symbols): ..this, and made global. include/ * bfdlink.h (bfd_generic_link_read_symbols): Declare. ld/ PR 6478 * ldcref.c (check_local_sym_xref): Use bfd_generic_link_read_symbols. Don't free symbol pointer array. (check_refs): Likewise. * ldmain.c (warning_callback): Likewise. * ldmisc.c (vfinfo): Likewise. * pe-dll.c (process_def_file): Likewise. (pe_walk_relocs_of_symbol, generate_reloc): Likewise. * emultempl/pe.em (pe_find_data_imports): Likewise. (gld_${EMULATION_NAME}_after_open): Likewise. * emultempl/pep.em (pep_find_data_imports): Likewise. (gld_${EMULATION_NAME}_after_open): Likewise. * ldlang.h (lang_input_statement_type): Delete asymbols, symbol_count, passive_position, closed. * ldlang.c (new_afile): Don't set asymbols and symbol_count. * ldmain.c (add_archive_element): xcalloc lang_input_statement_type.
* 2008-07-31 Takashi Ono <t_ono@hkfreak.net>Danny Smith2008-07-311-0/+10
| | | | | * pe-dll.c (generate_relocs): Don't generate relocs for undefined weak symbols.
* *pe-dll.c (autofilter_symbolprefixlist): Excude all symbolsDanny Smith2008-07-091-2/+7
| | | | | | | | | starting with ".". Exclude "_IMPORT_DESCRIPTOR_". (autofilter_symbolsuffixlist): Exclude "_NULL_THUNK_DATA". (autofilter_symbollist_generic): Don't check for ".text". Exclude "_NULL_IMPORT_DESCRIPTOR". (autofilter_symbollist_i386): Likewise.
* 2008-05-27 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2008-05-271-35/+38
| | | | | | | * pe-dll.c (fill_edata): Make sure we calculate vma's in type bfd_vma. (generate_reloc): Likewise. (pe_implied_import_dll): Likewise.
* 2008-05-09 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2008-05-091-4/+5
| | | | | | | | | | | ld/PR6502 * emultempl/pep.em (compute_dll_image_base): Use bfd_vma instead of long and change return type to bfd_vma. (definfo): Change type of address from long to bfd_vma. (set_pep_value): Replace strtoul to strtoull. (gld_${EMULATION_NAME}_set_symbols): use bfd_vma instead of long.. * pe-dll.c (pe_dll_generate_def_file): Use fprintf_vma to print ImageBase. (quick_reloc): Change argument address from int to bfd_size_type.
* Kai Tietz <kai.tietz@onevision.com>Kai Tietz2008-04-031-1/+1
| | | | | PR ld/6026 * pe-dll.c (make_head): Fix iat and thunk addend offset.
* include/Alan Modra2008-02-151-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bfdlink.h (struct bfd_link_hash_table): Delete creator field. (struct bfd_link_info): Add output_bfd. bfd/ * elflink.c: Replace all accesses to hash->creator field with output_bfd->xvec. * cofflink.c: Likewise. * coff-h8300.c: Likewise. * ecoff.c: Likewise. * elf32-m68hc1x.c: Likewise. * elf32-ppc.c: Likewise. * elf64-alpha.c: Likewise. * elf64-ppc.c: Likewise. * elf64-sparc.c: Likewise. * elfxx-mips.c: Likewise. * i386linux.c: Likewise. * m68klinux.c: Likewise. * sparclinux.c: Likewise. * sunos.c: Likewise. * xcofflink.c: Likewise. * linker.c: Likewise. (_bfd_link_hash_table_init): Don't store creator. ld/ * ldmain.h (output_bfd): Delete. * ldmain.c (output_bfd): Delete. Replace all occurrences of output_bfd with link_info.output_bfd. * ldcref.c: Likewise. * ldctor.c: Likewise. * ldemul.c: Likewise. * ldexp.c: Likewise. * ldfile.c: Likewise. * ldlang.c: Likewise. * ldmisc.c: Likewise. * ldwrite.c: Likewise. * pe-dll.c: Likewise. * emultempl/aix.em: Likewise. * emultempl/alphaelf.em: Likewise. * emultempl/armcoff.em: Likewise. * emultempl/armelf.em: Likewise. * emultempl/avrelf.em: Likewise. * emultempl/beos.em: Likewise. * emultempl/elf-generic.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/irix.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68hc1xelf.em: Likewise. * emultempl/mmix-elfnmmo.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/scoreelf.em: Likewise. * emultempl/sh64elf.em: Likewise. * emultempl/spuelf.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/vxworks.em: Likewise. * emultempl/xtensaelf.em: Likewise. * emultempl/z80.em: Likewise. * ldlang.c (open_output): Don't return output, instead write link_info_output_bfd directly. * emultempl/alphaelf.em: Replace occurrences of link_info.hash->creator with link_info.output_bfd->xvec. * emultempl/hppaelf.em: Likewise. * emultempl/ppc32elf.em: Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/spuelf.em: Likewise.
* bfd/Pedro Alves2007-10-251-6/+6
| | | | | | | | | | | | * bfd-in.h (STRING_COMMA_LEN): Don't handle NULL STR case. * bfd-in2.h: Regenerate. ld/ * pe-dll.c (autofilter_symbollist_generic) (autofilter_symbollist_i386, autofilter_liblist) (autofilter_objlist, autofilter_symbolprefixlist) (autofilter_symbolsuffixlist): Don't use STRING_COMMA_LEN with NULL.
* * emultempl/pep.em: (pep_enable_stdcall_fixup): Set to value 1.Nick Clifton2007-08-061-0/+9
| | | | | (gld_xxx_recognized_file): Use pep_bfd_is_dll for detection of shared objects. * pe-dll.c: (autofilter_symbollist_i386): Define set for amd64 mingw target.
* Update sources to GPLv3Nick Clifton2007-07-061-8/+8
|
* bfd/Alan Modra2007-06-271-4/+4
| | | | | | | | | | | | | | | | | | * bfd.c (struct bfd): Rename "next" to "archive_next". * archive.c: Rename uses throughout file. * archive64.c: Likewise. * coff-rs6000.c: Likewise. * ecoff.c: Likewise. * som.c: Likewise. * bfd-in2.h: Regenerate. binutils/ * ar.c: Rename uses of bfd.next to bfd.archive_next throughout. * arsup.c: Likewise. * binemul.c: Likewise. * objcopy.c: Likewise. * dlltool.c: Likewise. ld/ * pe-dll.c: Rename uses of bfd.next to bfd.archive_next throughout.