summaryrefslogtreecommitdiff
path: root/ld/emultempl/pep.em
Commit message (Collapse)AuthorAgeFilesLines
* * ldlang.c (sort_def_symbol, lang_one_common): Don't handleAlan Modra2011-06-131-2/+1
| | | | | | warning symbols here. * emultempl/pe.em (pr_sym): Remove redundant test. * emultempl/pep.em (pr_sym): Likewise.
* [PATCH] Fix PE-COFF bug in orphan section alignment handling.Dave Korn2011-03-101-1/+8
| | | | | | | | | | | ld/ChangeLog: 2011-03-10 Dave Korn <dave.korn.cygwin@gmail.com> * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Preserve alignment of input sections when creating orphan output sections during relocatable link. * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
* 2011-02-28 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2011-02-281-8/+10
| | | | | | | | | | | | | | | | | | | | | * 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.
* * ldmain.c (main): Flush stdout before and stderr after printingAlan Modra2011-01-141-6/+1
| | | | | | | | | | | | message. * ldmisc.c (einfo): Similarly. * plugin.c (message): Likewise. * emultempl/ppc64elf.em: Likewise. * emultempl/xtensaelf.em: Likewise. * emulparams/elf32mcore.sh: Use einfo rather than printf. * emultempl/beos.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise.
* PR ld/12356Alan Modra2011-01-131-5/+6
| | | | | | | | | | | | * ldexp.h (exp_assop): Delete. (exp_assign, exp_defsym): Declare. * ldexp.c (exp_assop): Make static, handle all assignment variations. (exp_assign, exp_defsym): New functions. (exp_provide): Use exp_assop. * ldgram.y (defsym_expr): Use exp_defsym. * ldctor.c, * ldgram.y, * ldlang.c, * mri.c, * emultempl/beos.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/spuelf.em, * emultempl/xtensaelf.em: Update exp_assop -> exp_assign.
* * ld.texinfo (Expression Section): Describe treatment of numbersAlan Modra2010-12-201-0/+2
| | | | | | | | | | | | | | | | | | and absolute symbols. * ldemul.c (after_open_default): Look up __ld_compatibility. * ldexp.c (fold_name): Convert absolute symbols to numbers when inside output section definitions, or when __ld_compatibility >= 221. (exp_fold_tree_1): Convert numbers to absolute when not in output section definition and __ld_compatibility < 221. Don't always convert values outside an output section definition to absolute. * ldexp.h (uses_defined): Comment. * ldlang.c (ld_compatibility): New variable. * ldlang.h (ld_compatibility): Declare. * emultempl/aix.em, * emultempl/armcoff.em, * emultempl/beos.em, * emultempl/elf32.em, * emultempl/genelf.em, * emultempl/lnk960.em, * emultempl/m68kcoff.em, * emultempl/mmo.em, * emultempl/pe.em, * emultempl/pep.em, * emultempl/sunos.em, * emultempl/z80.em: Call after_open_default from after_open function.
* Replace is_archive with maybe_archive.H.J. Lu2010-12-061-1/+1
| | | | | | | | | | | | | | | | | | | 2010-12-05 H.J. Lu <hongjiu.lu@intel.com> * ldfile.c (ldfile_open_file_search): Check maybe_archive instead of is_archive. * emultempl/aix.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/pe.em: Likewise. * emultempl/pep.em: Likewise. * emultempl/sunos.em: Likewise. * emultempl/vms.em: Likewise. * ldlang.c (new_afile): Set maybe_archive instead of is_archive.. * ldlang.h (lang_input_statement_struct): Replace is_archive with maybe_archive.
* * emultempl/pe.em (_list_options): Correct typo.Alan Modra2010-11-151-2/+2
| | | | * emultempl/pep.em (_list_options): Likewise.
* 2010-09-22 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2010-09-221-1/+8
| | | | | | | | | | * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Add idata to orphan set. * emultempl/pep.em: Likewise. * scripttempl/armcoff.sc: Separate idata and add __IAT_start__ and __IAT_end__ labels. * scripttempl/pe.sc: Likewise. * scripttempl/pep.sc: Likewise.
* 2010-05-25 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2010-05-251-23/+2
| | | | | | | | | | * emultempl/pep.em (gld_${EMULATION_NAME}_before_parse): Enable by default auto_import. (gld${EMULATION_NAME}_handle_option): Warn about v1. (pep_find_data_imports): Remove superflous warnings about auto-import. (gld_${EMULATION_NAME}_get_script): Don't merge for auto-import and active pseudo-relocation-v2 rdata into data section.
* 2010-05-15 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2010-05-151-42/+29
| | | | | | | | | | | | | | | | | * 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.
* 2010-05-11 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2010-05-111-11/+39
| | | | | | | | | * emultempl/pe.em (gld_${EMULATION_NAME}_before_parse): Initialize pe(p)_leading_underscore variable. (set_pe_name): Likewise. * emultempl/pep.em: Likewise. Additional change default to non-underscore for pep_leading_underscore equal to -1.
* 2010-04-05 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2010-04-051-32/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * emultempl/elf32.em (_place_orphan): If an input section doesn'tDJ Delorie2010-01-141-0/+14
| | | | | | | | | | | match an existing output section, but an unused output section statement does match, use it. * emultempl/pe.em (_place_orphan): Likewise. * emultempl/pep.em (_place_orphan): Likewise. * ld-elf/orphan4.d: New. * ld-elf/orphan4.ld: New. * ld-elf/orphan4.s: New.
* 2009-11-15 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-11-151-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | * 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-11-04 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-11-041-47/+73
| | | | | | | | | | | | | | | | | | | | | | | | * emulparams/arm_epoc_pe.sh: Remove ENTRY. * emulparams/arm_wince_pe.sh: Likewise. * emulparams/i386pe.sh: Likewise. * emulparams/i386pe_posix.sh: Likewise. * emulparams/mcorepe.sh: Likewise. * emulparams/mipspe.sh: Likewise. * emulparams/ppcpe.sh: Likewise. * emulparams/armpe.sh: Likewise. * emulparams/i386pep.sh: Likewise. * emulparams/shpe.sh: Likewise. Additionally cleaned up double-defined variables SUBSYSTEM and INITIAL_SYMBOL_CHAR. * emultempl/pe.em: Remove use of ENTRY. (pe_subsystem): New local variable. (gld_XXX_before_parse): Don't set default entry point here. (set_entry_point): New function to set entry point. (set_pe_subsystem): Remove code for entry point. (gld_XXX_after_parse): Use set_entry_point here. * emultempl/pep.em: Likewise.
* 2009-10-28 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-10-281-1/+2
| | | | | * emultempl/pep.em (U): Define underscore macro. (init): Use for __ImageBase U macro.
* * emultempl/pe.em (OPTION_EXCLUDE_ALL_SYMBOLS): New macro.Nick Clifton2009-10-161-0/+6
| | | | | | | | | | | | | | | (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.
* PR ld/6766Alan Modra2009-09-131-16/+2
| | | | | | | | | | | | | | | | | * lexsup.c (parse_args <-e>): Revert 2009-03-18 change. * ldemul.c (after_parse_default): Add entry symbol as undef. * emultempl/alphaelf.em (alpha_after_parse): Call after_parse_default. * emultempl/cr16elf.em (cr16elf_after_parse): Likewise. * emultempl/crxelf.em (crxelf_after_parse): Likewise. * emultempl/hppaelf.em (hppaelf_after_parse): Likewise. * emultempl/ia64elf.em (gld${EMULATION_NAME}_after_parse): Likewise. * emultempl/pe.em (gld_${EMULATION_NAME}_after_parse): Call after_parse_default and delete now duplicate code. * emultempl/pep.em (gld_${EMULATION_NAME}_after_parse): Likewise. * scripttempl/elf32cr16.sc: No need to make entry extern. * scripttempl/elf32cr16c.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32xc16xs.sc: Only provide ENTRY on final link.
* ld/Alan Modra2009-05-151-23/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | * ldlang.c (lang_output_section_statement_lookup): Add function comment. Make "name" non-const. Ensure duplicate entries use the same string, allowing simple comparison in hash bucket loop. Tweak constraint check. (next_matching_output_section_statement): New function. * ldlang.h (lang_output_section_statement_lookup): Update. (next_matching_output_section_statement): Declare. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't combine orphan sections when input sections flags differ in alloc or load. * emultempl/pe.em: Formatting throughout. (gld${EMULATION_NAME}_place_orphan): As for elf32.em. * emultempl/pep.em: Formatting throughout. (gld${EMULATION_NAME}_place_orphan): As for elf32.em. ld/testsuite/ * ld-elf/orphan3.d, * ld-elf/orphan3a.s, * ld-elf/orphan3b.s, * ld-elf/orphan3c.s, * ld-elf/orphan3d.s, * ld-elf/orphan3e.s, * ld-elf/orphan3f.s: New test. * ld-pe/orphan.d, * ld-pe/orphana.s, * ld-pe/orphanb.s, * ld-pe/orphand.s, * ld-pe/orphane.s: New test. * ld-pe/direct.exp: Use is_pecoff_format. * ld-pe/longsecn.exp: Delete. * ld-pe/pe.exp: Run new test and longsecn tests.
* * ldlang.c (lang_insert_orphan): Add __start_<section> symbolAlan Modra2009-05-141-37/+20
| | | | | | | | | assignment inside output section statement. Ensure only one set of symbols per output section. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Add non- dollar sections before dollar sections. Correct add_child list insertion. * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
* ld/ChangeLogDave Korn2009-04-021-0/+6
| | | | | | | | | | | | | | | PR ld/6744 * ld.texinfo (--export-dynamic): Mention --export-all-symbols. * emultempl/pe.em (gld_${EMULATION_NAME}_after_parse): Issue warning if --export-dynamic was passed on command-line. * emultempl/pep.em (gld_${EMULATION_NAME}_after_parse): Likewise. ld/testsuite/ChangeLog PR ld/6744 * ld-pe/export_dynamic_warning.d: New test control file. * ld-pe/export_dynamic_warning.s: New test source file. * ld-pe/pe.exp: Also run export_dynamic_warning dump test.
* include/ChangeLogDave Korn2009-03-141-2/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-03-12 Dave Korn <dave.korn.cygwin@gmail.com> * coff/internal.h (struct internal_extra_pe_aouthdr): Correct type of DllCharacteristics flags field to unsigned. * coff/pe.h (IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLLCHARACTERISTICS_NO_ISOLATION, IMAGE_DLLCHARACTERISTICS_NO_SEH, IMAGE_DLLCHARACTERISTICS_NO_BIND, IMAGE_DLLCHARACTERISTICS_WDM_DRIVER, IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE): New macros to define flag bit values for DllCharacteristics field of PEAOUTHDR, PEPAOUTHDR. ld/ChangeLog 2009-03-12 Dave Korn <dave.korn.cygwin@gmail.com> Danny Smith <dannysmith@users.sourceforge.net> * emultmpl/pe.em (pe_dll_characteristics): New variable. (OPTION_DYNAMIC_BASE, OPTION_FORCE_INTEGRITY, OPTION_NX_COMPAT, OPTION_NO_ISOLATION. OPTION_NO_SEH, OPTION_NO_BIND, OPTION_WDM_DRIVER, OPTION_TERMINAL_SERVER_AWARE): New macros for options to set DllCharacteristics flag bits. (gld${EMULATION_NAME}_add_options): Add dynamicbase, forceinteg, nxcompat, no-isolation, no-seh, no-bind, wdmdriver, tsaware options. (init): Add DllCharacteristics field. (gld_${EMULATION_NAME}_list_options): List new options. (gld${EMULATION_NAME}_handle_option): Handle new options. * emultmpl/pep.em (pe_dll_characteristics): New variable. (OPTION_DYNAMIC_BASE, OPTION_FORCE_INTEGRITY, OPTION_NX_COMPAT, OPTION_NO_ISOLATION. OPTION_NO_SEH, OPTION_NO_BIND, OPTION_WDM_DRIVER, OPTION_TERMINAL_SERVER_AWARE): New macros for options to set DllCharacteristics flags. (gld${EMULATION_NAME}_add_options): Add dynamicbase, forceinteg, nxcompat,no-isolation, no-seh, no-bind, wdmdriver, tsaware options. (init): Add DllCharacteristics field. (gld_${EMULATION_NAME}_list_options): List new options. (gld${EMULATION_NAME}_handle_option): Handle new options. * ldtexinfo : Document dynamicbase, forceinteg, nxcompat, no-isolation, no-seh, no-bind, wdmdriver, tsaware options.
* * emultempl/pe.em (debug_section_p): New bfd_map_over_sections hook.Dave Korn2009-03-031-0/+30
| | | | | | | | | | (gld_${EMULATION_NAME}_after_open): Use it to iterate all sections of all input BFDs, looking for debug info. Enable long section names if any found. * emultempl/pe.em (debug_section_p): Likewise. (gld_${EMULATION_NAME}_after_open): Likewise. * NEWS: Retrospectively adjust news announcement. * ld.texinfo: Update documentation to mention new behaviour.
* bfd/ChangeLogDave Korn2009-02-181-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * ldlang.c (push_stat_ptr, pop_stat_ptr): New functions.Alan Modra2009-02-161-6/+3
| | | | | | | | | | | | | | | | | | (stat_save, stat_save_ptr): New variables. (lang_insert_orphan): Use push_stat_ptr and pop_stat_ptr. (load_symbols): Likewise. Delete dead "bad_load" code. (open_input_bfds): Warn on script containing output sections. (lang_enter_output_section_statement): Use push_stat_ptr. (lang_enter_group): Likewise. (lang_leave_output_section_statement): Use pop_stat_ptr. (lang_leave_group): Likewise. * ldlang.h (push_stat_ptr, pop_stat_ptr): Declare. * ldctor.c (ldctor_build_sets): Use push_stat_ptr and pop_stat_ptr. * emultempl/beos.em (gld_${EMULATION_NAME}_set_symbols): Likewise. * emultempl/pe.em (gld_${EMULATION_NAME}_set_symbols): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_set_symbols): Likewise. * emultempl/spuelf.em (spu_place_special_section): Likewise. * emultempl/xtensaelf.em (ld_xtensa_insert_page_offsets): Likewise.
* 2009-01-08 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-01-081-1/+7
| | | | | | | | | | | | | | | | | | * 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.
* 2009-01-05 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2009-01-051-4/+4
| | | | | | * emultempl/pe.em: Prefix dollar characters to be outputed in generated C file. * emultempl/pep.em: Likewise.
* * NEWS: Mention new feature --exclude-modules-for-implib.Dave Korn2009-01-031-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* 2008-11-14 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2008-11-141-6/+54
| | | | | | | | | | | | | | | | | | | | | | * 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.
* * ldemul.h (ldemul_place_orphan): Update prototype.Alan Modra2008-10-201-2/+2
| | | | | | | | | | | (struct ld_emulation_xfer_struct <place_orphan>): Likewise. * ldemul.c (ldemul_place_orphan): Return pointer to output section statement. * emultempl/beos.em (gld${EMULATION_NAME}_place_orphan): Likewise. * emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Likewise. * emultempl/mmo.em (mmo_place_orphan): Likewise. * emultempl/pe.em (gld_${EMULATION_NAME}_place_orphan): Likewise. * emultempl/pep.em (gld_${EMULATION_NAME}_place_orphan): Likewise.
* * ldemul.c (ldemul_place_orphan): Add "constraint" param.Alan Modra2008-10-041-5/+7
| | | | | | | | | | | | | | | | | | | | | | * ldemul.h (ldemul_place_orphan): Update prototype. (struct ld_emulation_xfer_struct <place_orphan>): Likewise add param. * ldlang.c (unique_section_p): Make static. (lang_output_section_statement_lookup): Optimise creation of SPECIAL sections. (lang_insert_orphan): Add "constraint" param. Pass to lang_enter_output_section_statement. (init_os): Don't use an existing bfd section for SPECIAL sections. (lang_place_orphans): Don't rename unique output sections, instead mark their output section statements SPECIAL. * ldlang.h (lang_insert_orphan): Update prototype. (unique_section_p): Delete. * emultempl/beos.em (place_orphan): Add "constraint" param. * emultempl/elf32.em (place_orphan): Likewise. Don't match existing output sections if set. * emultempl/pe.em (place_orphan): Likewise. * emultempl/pep.em (place_orphan): Likewise. * emultempl/mmo.em (mmo_place_orphan): Update. * emultempl/spuelf.em (spu_place_special_section): Update.
* bfd/Alan Modra2008-10-031-23/+7
| | | | | | | | | | | | | | | | | | | | | | | | * elf.c (bfd_elf_set_group_contents): Assign sh_info for ld -r when the signature symbol is global. * elflink.c (elf_link_input_bfd): Ensure group signature symbol is output when ld -r. Set group sh_info when local. * linker.c (default_indirect_link_order): Handle group sections specially. ld/ * ldemul.c (ldemul_place_orphan): Add "name" param. * ldemul.h (ldemul_place_orphan): Update prototype. (struct ld_emulation_xfer_struct <place_orphan>): Likewise. * ldlang.c (lang_place_orphans): Generate unique section names here.. * emultempl/elf32.em (place_orphan): ..rather than here. Don't directly use an existing output section statement that has no bfd section. * emultempl/pe.em (place_orphan): Likewise. * emultempl/pep.em (place_orphan): Likewise. * emultempl/beos.em (place_orphan): Adjust. * emultempl/spuelf.em (spu_place_special_section): Adjust place_orphan call. * emultempl/genelf.em (gld${EMULATION_NAME}_after_open): New function. (LDEMUL_AFTER_OPEN): Define.
* * emultempl/pe.em (pe_find_data_imports): Add trailing newlineNick Clifton2008-09-091-2/+2
| | | | | to warning message. * emultempl/pep.em (pep_find_data_imports): Likewise.
* bfd/Alan Modra2008-08-171-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Silence gcc printf warningsAlan Modra2008-07-301-1/+1
|
* 2008-05-09 Kai Tietz <kai.tietz@onevision.com>Kai Tietz2008-05-091-9/+9
| | | | | | | | | | | 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.
* include/Alan Modra2008-02-151-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Add __ImageBase symbol to pe.em and pep.em.Kai Tietz2007-11-061-2/+2
|
* PR linker/4844Nick Clifton2007-10-041-2/+14
| | | | | | * emultempl/pep.em (pep_find_data_imports): Issue a warning message if auto importing is triggered without --enable-auto-import having been specified on the command line. * emultempl/pe.em (pe_find_data_imports): Likewise.
* PR linker/4844Nick Clifton2007-10-011-0/+4
| | | | | | | | | | | | * genscript.sh: Add support for generating a .xa script for use with the --auto-import option. * ld.texinfo: Document the new behaviour of the --auto-import option. * ldint.texinfo: Document new script generation. * emulparams/i386pe.sh (GENERATE_AUTO_IMPORT): Define. * emulparams/i386pe_posix.sh (GENERATE_AUTO_IMPORT): Define. * emulparams/i386pep.sh (GENERATE_AUTO_IMPORT): Define. * emultemp/pe.em (..._get_script): Support the use of the auto import script. * scripttempl/pe.sc: Put the .rdata input sections into the .data output section when creating an auto import script. * scripttempl/pep.sc: Likewise.
* * emultempl/pep.em: (pep_enable_stdcall_fixup): Set to value 1.Nick Clifton2007-08-061-14/+3
| | | | | (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.
* 2007-07-19 Roland McGrath <roland@redhat.com>Roland McGrath2007-07-191-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * genscripts.sh (source_em, fragment): New sh functions. Truncate e${EMULATION_NAME}.c file before .em script fills it. Use source_em in place of . for the .em script. * emultempl/generic.em: Use fragment and source_em functions. * 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/cr16elf.em: Likewise. * emultempl/crxelf.em: Likewise. * emultempl/elf-generic.em: Likewise. * emultempl/elf32.em: Likewise. * emultempl/genelf.em: Likewise. * emultempl/gld960.em: Likewise. * emultempl/gld960c.em: Likewise. * emultempl/hppaelf.em: Likewise. * emultempl/ia64elf.em: Likewise. * emultempl/irix.em: Likewise. * emultempl/linux.em: Likewise. * emultempl/lnk960.em: Likewise. * emultempl/m68hc1xelf.em: Likewise. * emultempl/m68kcoff.em: Likewise. * emultempl/m68kelf.em: Likewise. * emultempl/mipsecoff.em: Likewise. * emultempl/mipself.em: Likewise. * emultempl/mmix-elfnmmo.em: Likewise. * emultempl/mmixelf.em: Likewise. * emultempl/mmo.em: Likewise. * emultempl/needrelax.em: Likewise. * emultempl/netbsd.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/ticoff.em: Likewise. * emultempl/vanilla.em: Likewise. * emultempl/vxworks.em: Likewise. * emultempl/xtensaelf.em: Likewise. * emultempl/z80.em: Likewise.
* Update sources to GPLv3Nick Clifton2007-07-061-6/+8
|
* bfd/Alan Modra2007-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | Many files: Include sysdep.h before bfd.h. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. binutils/ * bucumm.h: Split off host dependencies to.. * sysdep.h: ..here. Many files: Include sysdep.h. Remove duplicate headers and reorder. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. ld/ Many files: Include sysdep.h first. Remove duplicate headers. * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. opcodes/ * Makefile.am: Run "make dep-am". * Makefile.in: Regenerate. * ns32k-dis.c: Include sysdep.h first.
* Add x86_64-mingw64 targetNick Clifton2006-09-201-0/+1706