aboutsummaryrefslogtreecommitdiff
path: root/ld/ChangeLog
AgeCommit message (Collapse)AuthorFilesLines
2010-12-02Re-indent plugin.h.H.J. Lu1-0/+4
2010-12-01 H.J. Lu <hongjiu.lu@intel.com> * plugin.h: Re-indent.
2010-11-30Add sparc64-rtems.Alan Modra1-0/+4
2010-11-26update japanese translationAlan Modra1-0/+4
2010-11-25Update translationsAlan Modra1-0/+8
2010-11-25 * scripttempl/elf.sc: Group .text.exit, text.startup and .text.hotAlan Modra1-0/+5
sections.
2010-11-23 * configure.ac: For --enable-gold, handle value `default' instead ofNick Clifton1-0/+7
`both*'. New configure option --{en,dis}able-ld. ld, gold/ * configure.ac: For --enable-gold, handle value `default' instead of `both*'. Always install ld as ld.gold, install as ld if gold is the default.
2010-11-21Re-indent plugin code.H.J. Lu1-0/+7
2010-11-21 H.J. Lu <hongjiu.lu@intel.com> * ldfile.c: Re-indent plugin code. * ldlang.c: Likewise. * ldmain.c: Likewise. * plugin.c: Likewise.
2010-11-20Set alignment of common plugin symbol to 1 for For ELF targets.H.J. Lu1-0/+6
2010-11-20 H.J. Lu <hongjiu.lu@intel.com> PR ld/12246 * plugin.c (asymbol_from_plugin_symbol): Set alignment of common symbol to 1 for For ELF targets.
2010-11-20Properly report loading plugin error.H.J. Lu1-0/+5
2010-11-20 H.J. Lu <hongjiu.lu@intel.com> PR ld/12247 * lexsup.c (parse_args): Properly report loading plugin error.
2010-11-19 * plugin.c (is_visible_from_outside): New function.Dave Korn1-0/+5
(get_symbols): Use it.
2010-11-15blackfin: add support for L1 code/data flagsMike Frysinger1-0/+8
Add new linker options for marking programs to load into L1 memory at runtime. This needs new EF flag bits, so declare them. Signed-off-by: Jie Zhang <jie.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-15 * emultempl/pe.em (_list_options): Correct typo.Alan Modra1-0/+5
* emultempl/pep.em (_list_options): Likewise.
2010-11-08Improve binutils testsuite coverage for GNU/Hurd.Thomas Schwinge1-0/+4
binutils/testsuite/ * lib/utils-lib.exp (is_elf_format): Consider for *-*-gnu*, too. * binutils-all/elfedit-2.d (target): Likewise. * binutils-all/elfedit-3.d (target): Likewise. * binutils-all/i386/i386.exp: Likewise. * binutils-all/objcopy.exp: Likewise. * binutils-all/strip-3.d (target): Likewise. gas/testsuite/ * lib/gas-defs.exp (is_elf_format): Consider for *-*-gnu*, too. * gas/elf/elf.exp: Likewise. * gas/symver/symver.exp: Likewise. ld/ * configure.host: Add stanza for *-*-gnu*. ld/testsuite/ * lib/ld-lib.exp (is_elf_format): Consider for *-*-gnu*, too. * ld-discard/discard.exp: Likewise. * ld-elf/binutils.exp: Likewise. * ld-elf/commonpage1.d (target): Likewise. * ld-elf/compress1c.d (target): Likewise. * ld-elf/discard1.d (target): Likewise. * ld-elf/discard2.d (target): Likewise. * ld-elf/discard3.d (target): Likewise. * ld-elf/dynsym1.d (target): Likewise. * ld-elf/eh6.d (target): Likewise. * ld-elf/elf.exp: Likewise. (array_tests): Move -static tests to... (array_tests_static): ... here, and handle it accordingly. * ld-elf/hash.d (target): Likewise. * ld-elf/header.d (target): Likewise. * ld-elf/loadaddr1.d (target): Likewise. * ld-elf/loadaddr2.d (target): Likewise. * ld-elf/loadaddr3a.d (target): Likewise. * ld-elf/loadaddr3b.d (target): Likewise. * ld-elf/local1.d (target): Likewise. * ld-elf/maxpage1.d (target): Likewise. * ld-elf/maxpage2.d (target): Likewise. * ld-elf/maxpage3a.d (target): Likewise. * ld-elf/multibss1.d (target): Likewise. * ld-elf/noload-2.d (target): Likewise. * ld-elf/seg.d (target): Likewise. * ld-elf/textaddr1.d (target): Likewise. * ld-elf/textaddr2.d (target): Likewise. * ld-elf/textaddr3.d (target): Likewise. * ld-elf/textaddr4.d (target): Likewise. * ld-elf/textaddr5.d (target): Likewise. * ld-elf/textaddr6.d (target): Likewise. * ld-elf/textaddr7.d (target): Likewise. * ld-elf/tls_common.exp: Likewise. * ld-elf/unknown2.d (target): Likewise. * ld-elfvers/vers.exp: Likewise. * ld-elfvsb/elfvsb.exp: Likewise. * ld-elfweak/elfweak.exp: Likewise. (setup_xfail_gnu_hurd): New function. Use it where appropriate. * ld-gc/abi-note.d (target): Likewise. * ld-gc/gc.exp: Likewise. * ld-gc/pr11218.d (target): Likewise. * ld-gc/start.d (target): Likewise. * ld-i386/i386.exp: Likewise. * ld-ifunc/binutils.exp: Likewise. * ld-ifunc/ifunc.exp: Likewise. * ld-linkonce/linkonce.exp: Likewise. * ld-linkonce/zeroehl32.d (target): Likewise. * ld-pie/pie.exp: Likewise. * ld-scripts/phdrs2.exp: Likewise. * ld-scripts/rgn-at5.d (target): Likewise. * ld-shared/shared.exp: Likewise. * ld-undefined/entry-3.d (target): Likewise. * ld-undefined/entry-4.d (target): Likewise. * ld-undefined/weak-undef.exp: Likewise.
2010-11-05Fix spacing.Richard Sandiford1-1/+1
2010-11-05ld/Richard Sandiford1-0/+4
2010-11-05  Pierre Muller  <muller@ics.u-strasbg.fr> * emultempl/spuelf.em (new_tmp_file): Fix wrong first parameter.
2010-11-05bfd/Tristan Gingold1-0/+5
2010-11-05 Tristan Gingold <gingold@adacore.com> * po/bfd.pot: Regenerate binutils/ 2010-11-05 Tristan Gingold <gingold@adacore.com> * po/binutils.pot: Regenerate gas/ 2010-11-05 Tristan Gingold <gingold@adacore.com> * po/gas.pot: Regenerate * po/POTFILES.in: Regenerate gprof/ 2010-11-05 Tristan Gingold <gingold@adacore.com> * po/gprof.pot: Regenerate ld/ 2010-11-05 Tristan Gingold <gingold@adacore.com> * po/ld.pot: Regenerate * po/POTFILES.in: Regenerate opcodes/ 2010-11-05 Tristan Gingold <gingold@adacore.com> * po/opcodes.pot: Regenerate
2010-11-05binutils/Tristan Gingold1-0/+4
2010-11-05 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.21. gas/ 2010-11-05 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.21. ld/ 2010-11-05 Tristan Gingold <gingold@adacore.com> * NEWS: Add marker for 2.21.
2010-11-05 * plugin.h (plugin_active_plugins_p): New prototype.Dave Korn1-0/+11
(is_ir_dummy_bfd): Delete prototype. * plugin.c: Fix formatting issues. (is_ir_dummy_bfd): Make static. (plugin_active_plugins_p): New function. * ldfile.c (ldfile_try_open_bfd): Use it to save work if no plugins are loaded. Always close file descriptor after claim handler returns. * ldmain.c (add_archive_element): Likewise.
2010-11-05 * ldlang.c (lang_add_section): Distinguish ELF treatment of NOLOAD.Alan Modra1-0/+8
(map_input_to_output_sections): Likewise. (lang_size_sections_1): Likewise. (IGNORE_SECTION): Don't test SEC_NEVER_LOAD. (lang_check_section_addresses): Likewise.
2010-11-04bfd/Kai Tietz1-0/+5
2010-11-04 Kai Tietz <kai.tietz@onevision.com> * coffcode.h (GNU_LINKONCE_WT): New. (sec_to_styp_flags): Add handling of new debug section. (styp_to_sec_flags): Likewise. ld/ 010-11-04 Kai Tietz <kai.tietz@onevision.com> * scripttempl/pe.sc (.debug_types): New. * scripttempl/pep.sc: Likewise.
2010-11-04 * plugin.c (is_ir_dummy_bfd): Don't segfault on NULL abfd.Alan Modra1-0/+4
2010-11-03 PR ld/12001Nick Clifton1-0/+14
* ldlang.c (ldlang_def_chain_list): New variable. Contains a list of symbols defined via the --defsym command line option and currently waiting assignment. (insert_defined): Add a defined symbol to the symbol table. (ldlang_add_def): Add a entry to the ldlang_def_chain_list. (lang_place_defineds): Walk ldlang_def_chain_list defining the symbols. (lang_process): Call lang_place_defineds. (lang_add_assignment): If the assignment has come from a --defsym command line option then call lang_add_def. * ld-script/default-script2.d: Fix expected address for text section. PR gold/12001 * script.h (class Symbol_assignment: name): New member. Returns the name of the symbol. * scrfipt.cc (Script_options::is_pending_assignment): New member. Returns true if the given symbol name is on the list of assignments wating to be processed. * archive.cc (should_incldue_member): If the symbol is undefined, check to see if it is on the list of symbols pending assignment.
2010-11-03 * Makefile.am (eelf64hppa.c): Correct dependencies.Alan Modra1-0/+5
* Makefile.in: Regenerate.
2010-11-02Include compressed DWARF debug sections in ELF linker scripts.H.J. Lu1-0/+25
binutils/testsuite/ 2010-11-02 H.J. Lu <hongjiu.lu@intel.com> * binutils-all/libdw2.out: Also accept MIPS_DWARF. ld/ 2010-11-02 H.J. Lu <hongjiu.lu@intel.com> * scripttempl/armbpabi.sc: Include compressed DWARF debug sections. * scripttempl/avr.sc: Likewise. * scripttempl/elf32cr16.sc: Likewise. * scripttempl/elf32crx.sc: Likewise. * scripttempl/elf32msp430.sc: Likewise. * scripttempl/elf32msp430_3.sc: Likewise. * scripttempl/elf32sh-symbian.sc: Likewise. * scripttempl/elf64hppa.sc: Likewise. * scripttempl/elf_chaos.sc: Likewise. * scripttempl/elfd10v.sc: Likewise. * scripttempl/elfd30v.sc: Likewise. * scripttempl/elfi370.sc: Likewise. * scripttempl/elfm68hc11.sc: Likewise. * scripttempl/elfm68hc12.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. ld/testsuite/ 2010-11-02 H.J. Lu <hongjiu.lu@intel.com> * ld-elf/compress1a.d: Also check MIPS_DWARF. * ld-elf/compress1b.d: Likewise. * ld-elf/compress1c.d: Likewise.
2010-10-29Add compressed debug section support to binutils and ld.H.J. Lu1-0/+8
bfd/ 2010-10-29 H.J. Lu <hongjiu.lu@intel.com> Cary Coutant <ccoutant@google.com> * archive.c (bfd_openr_next_archived_file): Copy BFD_COMPRESS and BFD_DECOMPRESS. * bfd.c (BFD_COMPRESS): New. (BFD_DECOMPRESS): Likewise. (BFD_FLAGS_SAVED): Likewise. (bfd_preserve_save): Replace BFD_IN_MEMORY with BFD_FLAGS_SAVED. * compress.c (bfd_uncompress_section_contents): Removed. (get_uncompressed_size): New. (decompress_contents): Likewise. (bfd_compress_section_contents): Likewise. (bfd_get_full_section_contents): Likewise. (bfd_is_section_compressed): Likewise. (bfd_init_section_decompress_status): Likewise. (bfd_init_section_compress_status): Likewise. * dwarf2.c (dwarf_debug_sections): New. (dwarf_debug_section_enum): Likewise. (read_section): Remove section_name and compressed_section_name. Add dwarf_debug_section_enum. Try compressed debug section. (read_indirect_string): Updated. (read_abbrevs): Likewise. (decode_line_info): Likewise. (read_debug_ranges): Likewise. (find_line): Updated. * ecoff.c (bfd_debug_section): Add compress_status and compressed_size. * elf.c (_bfd_elf_make_section_from_shdr): Call bfd_is_section_compressed to check if a DWARF debug section is compressed. Call bfd_init_section_compress_status or bfd_init_section_decompress_status if needed. * elflink.c (elf_link_input_bfd): Replace bfd_get_section_contents with bfd_get_full_section_contents. * merge.c (_bfd_add_merge_section): Likewise. * reloc.c (bfd_generic_get_relocated_section_contents): Likewise. * simple.c (bfd_simple_get_relocated_section_contents): Likewise. * elfxx-target.h (TARGET_BIG_SYM): Allow BFD_COMPRESS and BFD_DECOMPRESS. (TARGET_LITTLE_SYM): Likewise. * libbfd-in.h (dwarf_debug_section): New. (dwarf_debug_sections): Likewise. * libbfd.c (_bfd_generic_get_section_contents): Issue an error when getting contents on compressed/decompressed section. * section.c (COMPRESS_SECTION_NONE): New. (COMPRESS_SECTION_DONE): Likewise. (DECOMPRESS_SECTION_SIZED): Likewise. (BFD_FAKE_SECTION): Add compress_status and compressed_size. (bfd_malloc_and_get_section): Replace bfd_get_section_contents with bfd_get_full_section_contents. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. binutils/ 2010-10-29 H.J. Lu <hongjiu.lu@intel.com> * addr2line.c (process_file): Set BFD_DECOMPRESS. * objcopy.c (do_debug_sections): New. (OPTION_COMPRESS_DEBUG_SECTIONS): New. (OPTION_DECOMPRESS_DEBUG_SECTIONS): Likewise. (copy_options): Add OPTION_COMPRESS_DEBUG_SECTIONS and OPTION_DECOMPRESS_DEBUG_SECTIONS. (copy_usage): Add --compress-debug-sections and --decompress-debug-sections. (copy_file): Set BFD_COMPRESS or BFD_DECOMPRESS. (copy_section): Replace bfd_get_section_contents with bfd_get_full_section_contents. (copy_main): Handle OPTION_COMPRESS_DEBUG_SECTIONS and OPTION_DECOMPRESS_DEBUG_SECTIONS. Check do_debug_sections to rename DWARF debug sections. * objdump.c (load_specific_debug_section): Replace bfd_get_section_contents with bfd_get_full_section_contents. Remove bfd_uncompress_section_contents. (dump_section): Replace bfd_get_section_contents with bfd_get_full_section_contents. (display_file): Set BFD_DECOMPRESS if needed. * readelf.c (uncompress_section_contents): Set buffer to NULL to indiate decompression failure. (load_specific_debug_section): Always call uncompress_section_contents. * doc/binutils.texi: Document --compress-debug-sections and --decompress-debug-sections. binutils/testsuite/ 2010-10-29 H.J. Lu <hongjiu.lu@intel.com> * binutils-all/compress.exp: New. * binutils-all/dw2-1.S: Likewise. * binutils-all/dw2-2.S: Likewise. * binutils-all/libdw2-compressed.out: Likewise. * binutils-all/libdw2.out: Likewise. gas/ 2010-10-29 H.J. Lu <hongjiu.lu@intel.com> * write.c (compress_debug): Optimize section flags check. gas/testsuite/ 2010-10-29 H.J. Lu <hongjiu.lu@intel.com> * elf/dwarf2-1.s: Replace .zdebug_abbrev section with .debug_abbrev section. * elf/dwarf2-2.3: Likewise. * elf/dwarf2-1.d: Pass --compress-debug-sections to assembler. Updated. * elf/dwarf2-2.d: Likewise. * gas/i386/i386.exp: Remove xfail on dw2-compress-2 and x86-64-dw2-compress-2. ld/ 2010-10-29 H.J. Lu <hongjiu.lu@intel.com> * ldfile.c (ldfile_try_open_bfd): Set BFD_DECOMPRESS after bfd_openr returns. * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Likewise. * scripttempl/elf.sc: Include compressed DWARF debug sections. ld/testsuite/ 2010-10-29 H.J. Lu <hongjiu.lu@intel.com> * ld-elf/compress.exp: New. * ld-elf/compress1.s: Likewise. * ld-elf/compress1a.d: Likewise. * ld-elf/compress1b.d: Likewise. * ld-elf/compress1c.d: Likewise.
2010-10-28 * ldfile.c (find_scripts_dir): Don't look in absolute SCRIPTDIR.Alan Modra1-0/+4
2010-10-28Add directory section for info document.Alan Modra1-0/+5
2010-10-28 * emultempl/ppc64elf.em (gld${EMULATION_NAME}_new_vers_pattern): ForAlan Modra1-0/+5
--no-undefined-version, don't report dot sym versions added by ld.
2010-10-28 * ldlang.h (ldlang_add_undef): Add cmdline param.Alan Modra1-0/+12
* ldlang.c (undef_from_cmdline): New var. (ldlang_add_undef): Add cmdline param. Set undef_from_cmdline. (lang_end): Really require -e or -u from command line on relocatable --gc-sections. * ldemul.c (after_parse_default): Adjust ldlang_add_undef call. * ldgram.y (extern_name_list_body): Likewise. * lexsup.c (parse_args): Likewise. * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Likewise.
2010-10-25 * plugin.c (plugin_get_ir_dummy_bfd): Set bfd_use_reserved_id.Alan Modra1-0/+5
Formatting.
2010-10-22 ld:Rainer Orth1-0/+7
* emulparams/elf32_sparc_sol2.sh (OUTPUT_FORMAT): Set to elf32-sparc-sol2. * emulparams/elf64_sparc_sol2.sh (OUTPUT_FORMAT): Set to elf64-sparc-sol2. gas: * config/tc-sparc.h [TE_SOLARIS] (ELF_TARGET_FORMAT): Define as elf32-sparc-sol2. (ELF64_TARGET_FORMAT): Define as elf64-sparc-sol2. bfd: * elfxx-sparc.c (tpoff): Define bed, static_tls_size. Consider static_tls_alignment. * elf32-sparc.c (TARGET_BIG_SYM): Redefine to bfd_elf32_sparc_sol2_vec. (TARGET_BIG_NAME): Redefine to elf32-sparc-sol2. (elf32_bed): Redefine to elf32_sparc_sol2_bed. (elf_backend_static_tls_alignment): Redefine to 8. Include elf32-target.h. (elf_backend_static_tls_alignment): Undef again for VxWorks. * elf64-sparc.c (TARGET_BIG_SYM): Redefine to bfd_elf64_sparc_sol2_vec. (TARGET_BIG_NAME): Redefine to elf64-sparc-sol2. (ELF_OSABI): Undef. (elf64_bed): Redefine to elf64_sparc_sol2_bed. (elf_backend_static_tls_alignment): Redefine to 16. Include elf64-target.h. * config.bfd (sparc-*-solaris2.[0-6]): Split from sparc-*-elf*. Set targ_defvec to bfd_elf32_sparc_sol2_vec. [BFD64] (sparc-*-solaris2*): Set targ_defvec to bfd_elf32_sparc_sol2_vec. Replace bfd_elf64_sparc_vec by bfd_elf64_sparc_sol2_vec in targ_selvecs. * configure.in: Handle bfd_elf32_sparc_sol2_vec, bfd_elf64_sparc_sol2_vec. * configure: Regenerate. * targets.c (bfd_elf32_sparc_sol2_vec): Declare. (bfd_elf64_sparc_sol2_vec): Declare. (_bfd_target_vector): Add bfd_elf32_sparc_sol2_vec, bfd_elf64_sparc_sol2_vec.
2010-10-21 * ldwrite.c (build_link_order <lang_data_statement_enum>): Don'tAlan Modra1-6/+12
output when section has no contents. (build_link_order <lang_reloc_statement_enum>): Likewise.
2010-10-21bfd:Joseph Myers1-0/+5
* elf32-tic6x.c (elf32_tic6x_merge_arch_attributes): Update for attribute renaming. (elf_backend_obj_attrs_section): Change to ".c6xabi.attributes". binutils: * readelf.c (display_tic6x_attribute): Update for attribute renaming. gas: * config/tc-tic6x.c (tic6x_arch_attribute, tic6x_arches, md_assemble, tic6x_set_attributes): Update for attribute renaming. * doc/c-tic6x.texi: Update for attribute renaming. gas/testsuite: * gas/tic6x/attr-arch-directive-1.d, gas/tic6x/attr-arch-directive-2.d, gas/tic6x/attr-arch-directive-3.d, gas/tic6x/attr-arch-directive-4.d, gas/tic6x/attr-arch-directive-4.s, gas/tic6x/attr-arch-directive-5.d, gas/tic6x/attr-arch-directive-5.s, gas/tic6x/attr-arch-opts-c62x.d, gas/tic6x/attr-arch-opts-c64x+.d, gas/tic6x/attr-arch-opts-c64x.d, gas/tic6x/attr-arch-opts-c674x.d, gas/tic6x/attr-arch-opts-c67x+.d, gas/tic6x/attr-arch-opts-c67x.d, gas/tic6x/attr-arch-opts-none-1.d, gas/tic6x/attr-arch-opts-none-2.d, gas/tic6x/attr-arch-opts-override-1.d, gas/tic6x/attr-arch-opts-override-2.d: Update for attribute renaming and renumbering. include/elf: * tic6x-attrs.h (Tag_C6XABI_Tag_CPU_arch): Change to Tag_ISA, value 4. * tic6x.h (Values for Tag_C6XABI_Tag_CPU_arch): Rename for attribute renaming. ld: * emulparams/elf32_tic6x_le.sh (ATTRS_SECTIONS): Use .c6xabi.attributes, not __TI_build_attributes. ld/testsuite: * ld-tic6x/attr-arch-c62x-c62x.d, ld-tic6x/attr-arch-c62x-c64x+.d, ld-tic6x/attr-arch-c62x-c64x.d, ld-tic6x/attr-arch-c62x-c674x.d, ld-tic6x/attr-arch-c62x-c67x+.d, ld-tic6x/attr-arch-c62x-c67x.d, ld-tic6x/attr-arch-c64x+-c62x.d, ld-tic6x/attr-arch-c64x+-c64x+.d, ld-tic6x/attr-arch-c64x+-c64x.d, ld-tic6x/attr-arch-c64x+-c674x.d, ld-tic6x/attr-arch-c64x+-c67x+.d, ld-tic6x/attr-arch-c64x+-c67x.d, ld-tic6x/attr-arch-c64x-c62x.d, ld-tic6x/attr-arch-c64x-c64x+.d, ld-tic6x/attr-arch-c64x-c64x.d, ld-tic6x/attr-arch-c64x-c674x.d, ld-tic6x/attr-arch-c64x-c67x+.d, ld-tic6x/attr-arch-c64x-c67x.d, ld-tic6x/attr-arch-c674x-c62x.d, ld-tic6x/attr-arch-c674x-c64x+.d, ld-tic6x/attr-arch-c674x-c64x.d, ld-tic6x/attr-arch-c674x-c674x.d, ld-tic6x/attr-arch-c674x-c67x+.d, ld-tic6x/attr-arch-c674x-c67x.d, ld-tic6x/attr-arch-c67x+-c62x.d, ld-tic6x/attr-arch-c67x+-c64x+.d, ld-tic6x/attr-arch-c67x+-c64x.d, ld-tic6x/attr-arch-c67x+-c674x.d, ld-tic6x/attr-arch-c67x+-c67x+.d, ld-tic6x/attr-arch-c67x+-c67x.d, ld-tic6x/attr-arch-c67x-c62x.d, ld-tic6x/attr-arch-c67x-c64x+.d, ld-tic6x/attr-arch-c67x-c64x.d, ld-tic6x/attr-arch-c67x-c674x.d, ld-tic6x/attr-arch-c67x-c67x+.d, ld-tic6x/attr-arch-c67x-c67x.d: Update for attribute renaming.
2010-10-20 * plugin.c (get_symbols): Check symbol type correctly.Dave Korn1-0/+4
2010-10-15Provide win32-based dlapi replacements on windows platforms without dlfcn.h.Dave Korn1-0/+13
ld/ChangeLog: * configure.in: If <dlfcn.h> can't be found, try for <Windows.h> * configure: Regenerate. * config.in: Likewise. * plugin.c [!HAVE_DLFCN_H && HAVE_WINDOWS_H] (dlopen): Provide trival LoadLibrary-based replacement for Windows systems. [!HAVE_DLFCN_H && HAVE_WINDOWS_H] (dlsym): Likewise trivial replacement based on GetProcAddress. [!HAVE_DLFCN_H && HAVE_WINDOWS_H] (dlsym): Likewise FreeLibrary. * sysdep.h: Don't infer presence of <dlfcn.h> from ENABLE_PLUGINS anymore, use its own guard.
2010-10-15Fix potential use-after-free bugs.Dave Korn1-0/+6
ld/ChangeLog: * plugin.c (add_input_file): Take copy of input string. (add_input_library): Likewise. (set_extra_library_path): Likewise.
2010-10-14Applied patch series for LD plugin interface (six parts).Dave Korn1-0/+155
[PATCH] Add infrastructure for plugin API; functionality to follow. include/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 1/6). * plugin-api.h (LDPT_GNU_LD_VERSION): New ld_plugin_tag enum member. ld/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 1/6). * configure.in: Add AC_CHECKs for file io and dlfcn headers and functions and AC_SEARCH for -ldl. (enable_plugins): New shell variable set if above tests find dlopen functionality. (ENABLE_PLUGINS): Add related automake conditional. * configure: Regenerate. * config.in: Likewise. * Makefile.am (PLUGIN_C): Declare plugin C source file, conditional on ENABLE_PLUGINS being defined. (PLUGIN_H): Likewise for header file. (PLUGIN_OBJECT): Likewise for object file. (PLUGIN_CFLAGS): Likewise -D flag required to compile plugin support. (AM_CPPFLAGS): Use PLUGIN_CFLAGS. (CFILES): Use PLUGIN_C. (HFILES): Use PLUGIN_H. (OFILES): Use PLUGIN_OBJECT. (ld_new_SOURCES): Use PLUGIN_C. (noinst_LTLIBRARIES)[ENABLE_PLUGINS]: Declare test plugin. (libldtestplug_la_SOURCES)[ENABLE_PLUGINS]: Add automake definition for test plugin. (libldtestplug_la_CFLAGS)[ENABLE_PLUGINS]: Likewise. (libldtestplug_la_LDFLAGS)[ENABLE_PLUGINS]: Likewise. * Makefile.in: Regenerate. * sysdep.h: Include stdarg.h, unistd.h and one of fcntl.h or sys/file.h where available. Include dlfcn.h when ENABLE_PLUGINS. (O_RDONLY): Supply default definition likewise to bfd's sysdep.h (O_WRONLY): Likewise. (O_RDWR): Likewise. (O_ACCMODE): Likewise. (O_BINARY): Likewise. (SEEK_SET): Likewise. (SEEK_CUR): Likewise. (SEEK_END): Likewise. * ldmisc.c (vfinfo): Make non-static. Add %p format char. * ldmisc.h (vfinfo): Declare extern prototype. * lexsup.c (enum option_values)[ENABLE_PLUGINS]: Add new entries for OPTION_PLUGIN and OPTION_PLUGIN_OPT. (ld_options[])[ENABLE_PLUGINS]: Add option data for the above two. (parse_args)[ENABLE_PLUGINS]: Handle them, and load all plugins once option parsing is complete. * ldmain.c (main)[ENABLE_PLUGINS]: Call plugin cleanup hooks just after lang_finish. * plugin.c: New source file. * plugin.h: Likewise new header. * testplug.c: New source file. ld/testsuite/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 1/6). * ld-bootstrap/bootstrap.exp: Skip static tests also if LD plugins are enabled. * lib/ld-lib.exp (proc regexp_diff): Extend verbose debug output. (proc set_file_contents): Write a file with the supplied content. (run_ld_link_tests): Add new 'ld' action to test linker output. (proc check_plugin_api_available): Return true if linker under test supports the plugin API. * ld-plugin/func.c: New test source file. * ld-plugin/main.c: Likewise. * ld-plugin/text.c: Likewise. * ld-plugin/plugin-1.d: New dump test output pattern script. * ld-plugin/plugin-2.d: Likewise. * ld-plugin/plugin-3.d: Likewise. * ld-plugin/plugin-4.d: Likewise. * ld-plugin/plugin-5.d: Likewise. * ld-plugin/plugin.exp: New test control script. --- [PATCH] Implement claim file and all symbols read hooks and add symbols callback. ld/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 2/6). * ldfile.c (ldfile_try_open_bfd)[ENABLE_PLUGINS]: Don't return early during compat checks if they pass, instead offer any successfully opened and accepted file to the plugin claim file hooks chain. Create a dummy bfd to accept symbols added by the plugin, if the plugin claims the file. * ldlang.c (lang_process)[ENABLE_PLUGINS]: Call plugin all symbols read hook chain before ldemul_after_open. * ldlang.h (struct lang_input_statement_struct): Add new single-bit 'claimed' flag. * plugin.c (IRONLY_SUFFIX): New macro for dummy bfd file suffix. (IRONLY_SUFFIX_LEN): Length of the above string. (plugin_get_ir_dummy_bfd): New function to create the dummy bfd used to store symbols for ir-only files. (is_ir_dummy_bfd): New function to check if a bfd is ir-only. (asymbol_from_plugin_symbol): New function converts symbol formats. (add_symbols): Call it to convert plugin syms to bfd syms and add them to the dummy bfd. * plugin.h: Add missing include guards. (plugin_get_ir_dummy_bfd): Add prototype. (is_ir_dummy_bfd): Likewise. * testplug.c (TV_MESSAGE): New helper macro. (struct claim_file): New struct. (claim_file_t): New typedef. (tag_names[]): Make static and const. (claimfiles_list): New variable. (claimfiles_tail_chain_ptr): Likewise. (last_claimfile): Likewise. (record_claim_file): Record a file to claim on a singly-linked list. (parse_symdefstr): Parse an ASCII representation of a symbol from a plugin option into the fields of a struct ld_plugin_symbol. (record_claimed_file_symbol): Use it to parse plugin option for adding a symbol. (parse_option): Parse claim file and add symbol options. (dump_tv_tag): Use TV_MESSAGE. (onload): Likewise. (onclaim_file): Make static. Use TV_MESSAGE. Scan list of files to claim and claim this file if required, adding any symbols specified. (onall_symbols_read): Make static and use TV_MESSAGE. (oncleanup): Likewise. ld/testsuite/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 2/6). * ld-plugin/plugin-3.d: Enable regexes for new functionality. * ld-plugin/plugin-5.d: Likewise. * ld-plugin/plugin-6.d: New testcase. * ld-plugin/plugin-7.d: Likewise. * ld-plugin/plugin.exp: Use 'nm' on compiled test objects to determine whether symbols in plugin arguments need an underscore prefix. Add new plugin-6.d and plugin-7.d testcases. --- [PATCH] Implement get symbols callback. ld/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 3/6). * ldmain.c (notice)[ENABLE_PLUGINS]: Call plugin_notice. * plugin.c (non_ironly_hash): Add new bfd hash table. (plugin_load_plugins): Exit early if no plugins to load. If plugins do load successfully, set notice_all flag in link info. (get_symbols): Implement. (plugin_load_plugins): Exit early if no plugins to load, else after loading plugins successfully enable notice_all mode. (init_non_ironly_hash): Lazily init non_ironly_hash table. (plugin_notice): Record symbols referenced from non-IR files in the non_ironly_hash. Suppress tracing, cref generation and nocrossrefs tracking for symbols from dummy IR bfds. * plugin.h: Fix formatting. (plugin_notice): Add prototype. * testplug.c (dumpresolutions): New global var. (parse_options): Accept "dumpresolutions". (onall_symbols_read): Get syms and dump resolutions if it was given. ld/testsuite/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 3/6). * ld-plugin/plugin-8.d: New testcase. * ld-plugin/plugin.exp: Invoke it. --- [PATCH] Implement add input file, add input lib and set extra lib path callbacks. ld/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 4/6). * ldlang.c (lang_process)[ENABLE_PLUGINS]: Move invocation of plugin_call_all_symbols_read to before setting of gc_sym_list, and open any new input files that may have been added during it. * ldmain.c (multiple_definition)[ENABLE_PLUGINS]: Call out to plugin_multiple_definition and let it have first say over what to do with the clashing definitions. * plugin.c (no_more_claiming): New boolean variable. (plugin_cached_allow_multiple_defs): Likewise. (add_input_file): Implement. (add_input_library): Likewise. (set_extra_library_path): Likewise. (plugin_call_claim_file): Don't do anything when no_more_claiming set. (plugin_call_all_symbols_read): Set it. Disable link info "allow_multiple_definition" flag, but cache its value. (plugin_multiple_definition): New function. * plugin.h (plugin_multiple_definition): Add prototype. * testplug.c (addfile_enum_t): New enumerated typedef. (add_file_t): New struct typedef. (addfiles_list): New variable. (addfiles_tail_chain_ptr): Likewise. (record_add_file): New function. (parse_option): Parse "add:", "lib:" and "dir:" options and call it. (onall_symbols_read): Iterate the list of new files, libs and dirs, adding them. ld/testsuite/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 4/6). * ld-plugin/plugin-9.d: New testcase. * ld-plugin/plugin.exp: Invoke it. --- [PATCH] Add ELF symbol visibility support to plugin interface. ld/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 5/6). * plugin.c (asymbol_from_plugin_symbol): If the bfd is an ELF bfd, find the elf symbol data and set the visibility in the st_other field. ld/testsuite/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 5/6). * ld-plugin/plugin-ignore.d: New dump test control script. * ld-plugin/plugin-vis-1.d: Likewise. * ld-plugin/plugin.exp: Add list of ELF-only tests and run them if testing on an ELF target. --- [PATCH] Add archive support to plugin interface. bfd/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 6/6). * aoutx.h (aout_link_check_ar_symbols): Take new "subsbfd" reference parameter and pass it when invoking add_archive_element callback. (aout_link_check_archive_element): Handle substitute bfd if it was set during add_archive_element callback in the above. * cofflink.c (coff_link_check_ar_symbols): Take new "subsbfd" reference parameter and pass it when invoking add_archive_element callback. (coff_link_check_archive_element): Handle substitute bfd if it was set during add_archive_element callback in the above. * ecoff.c (read_ext_syms_and_strs): New function holds symbol-reading code factored-out from ecoff_link_check_archive_element. (reread_ext_syms_and_strs): Clear old symbols and call it. (ecoff_link_check_archive_element): Use the above. Handle substitute BFD if one is set by add_archive_element callback. (ecoff_link_add_archive_symbols): Likewise allow bfd substitution. * elflink.c (elf_link_add_archive_symbols): Likewise. * linker.c (generic_link_check_archive_element): Likewise. * pdp11.c (aout_link_check_ar_symbols): Take new "subsbfd" reference parameter and pass it when invoking add_archive_element callback. (aout_link_check_archive_element): Handle substitute bfd if it was set during add_archive_element callback in the above. * vms-alpha.c (alpha_vms_link_add_archive_symbols): Handle substitute BFD if one is set by add_archive_element callback. * xcofflink.c (xcoff_link_check_dynamic_ar_symbols): Take new "subsbfd" reference parameter and pass it when invoking add_archive_element callback. (xcoff_link_check_ar_symbols): Likewise. (xcoff_link_check_archive_element): Handle bfd substitution if it was set by callback in the above. include/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 6/6). * bfdlink.h (struct_bfd_link_callbacks): Document new argument to add_archive_element callback used to return a replacement bfd which is to be added to the hash table in place of the original element. ld/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 6/6). * ldlang.c (load_symbols): Handle bfd subsitution when calling the add_archive_element callback. * ldmain.c (add_archive_element)[ENABLE_PLUGINS]: Offer the archive member to the plugins and if claimed set "subsbfd" output parameter to point to the dummy IR-only BFD. ld/testsuite/ChangeLog: 2010-10-14 Dave Korn <dave.korn.cygwin@gmail.com> Apply LD plugin patch series (part 6/6). * ld-plugin/plugin-10.d: New dump test control script. * ld-plugin/plugin-11.d: Likewise. * ld-plugin/plugin.exp: Run them. ---
2010-10-12 * emultempl/solaris2.em (elf_solaris2_before_allocation): RenamedRainer Orth1-0/+20
basever_syms to global_syms. Emit global_syms into .dynamic section for all executables and shared objects. (elf_solaris2_after_allocation): New function. (LDEMUL_AFTER_ALLOCATION): Use it. * emulparams/solaris2.sh: New file. * emulparams/elf32_sparc_sol2.sh: Use it. * emulparams/elf64_sparc_sol2.sh: Likewise. * emulparams/elf_i386_sol2.sh: Likewise. * emulparams/elf_x86_64_sol2.sh: Likewise. * Makefile.am (eelf32_sparc_sol2.c): Depend on $(srcdir)/emulparams/solaris2.sh. (eelf64_sparc_sol2.c): Likewise. (eelf_x86_64_sol2.c): Likewise. (eelf_i386_sol2.c): Likewise. * Makefile.in: Regenerate.
2010-10-06 * script-sections.cc(class Memory_region): RemoveNick Clifton1-0/+5
current_lma_offset_ field. Rename current_vma_offset_ to current_offset_. Add last_section_ field. (Memory_region::get_current_vma_address): Rename to get_current_address. (Memory_region::get_current_lma_address): Delete. (Memory_region::increment_vma_offset): Rename to increment_offset. (Memory_region::increment_lma_offset): Delete. (Memory_region::attributes_compatible): New method. Returns true if the provided section is compatible with the region. (Memory_region::get_last_section): New method. Returns the last section to use the region. (Memory_region::set_last_section): New method. Stores the last section to use the region. (Script_sections::block_in_region): New method. Returns true if a block of memory is contained within a region. (Script_sections::find_memory_region): New method. Locates a memory region to be used to set a VMA or LMA address. (Output_section_definition::set_section_addresses): Add code to check for addresses set by memory regions. (Output_segment::set_section_addresses): Remove memory region walking code. (Script_sections::create_segment): Add a warning if a header segment is created outside of any region. * script-sections.h (class Script_sections): Add prototypes for find_memory_region and block_in_region methods. * testsuite/memory_test.s: Use .long instead of .word. * testsuite/memory_test.t: Add some more output sections. * testsuite/memory_test.sh: Update expected output. * ld.texinfo: Update description of computation of VMA and LMA addresses for output sections. * ld-scripts/rgn-at5.t: Add some more output sections. * ld-scripts/rgn-at5.d: Update expected output.
2010-10-06Fix typo in ld dependency commit.Ralf Wildenhues1-0/+3
ld/: * Makefile.am (ALL_64_EMULATIONS): Fix typo in last commit. * Makefile.in: Regenerate.
2010-10-06Fix dependency tracking in ld.Ralf Wildenhues1-0/+11
ld/: * Makefile.am (ALL_EMULATIONS): Rewrite in terms of ... (ALL_EMULATION_SOURCES): ... this new variable. (ALL_64_EMULATIONS): Rewrite in terms of ... (ALL_64_EMULATION_SOURCES): ... this new variable. (EXTRA_ld_new_SOURCES): Rewrite in terms of the _SOURCES variables. (eelf32microblaze.c): Fix indentation. * Makefile.in: Regenerate.
2010-10-04bfd/Bernd Schmidt1-0/+5
* elf-bfd.h (struct bfd_elf_section_reloc_data): New structure. (struct bfd_elf_section_data): New members REL and RELA; delete members REL_HDR, REL_HDR2, REL_COUNT, REL_COUNT2, REL_IDX, REL_IDX2, REL_HASHES. (_bfd_elf_init_reloc_shdr): Adjust declaration. (_bfd_elf_single_rel_hdr): Declare. (RELOC_AGAINST_DISCARDED_SECTION): Use it. * elf.c (bfd_section_from_shdr): Adjusted to match changes in data structures. (_bfd_elf_init_reloc_shdr): New arg RELDATA. Remove arg REL_HDR. All callers changed. Allocate memory for the Elf_Internal_Shdr structure. (_bfd_elf_single_rel_hdr): New function. (struct fake_section_arg): New structure. (elf_fake_section): Expect to see a pointer to it in the third argument. If doing a relocatable link, allocate both REL and RELA sections as needed. (assign_section_numbers): Adjusted to match changes in data structures. (_bfd_elf_compute_section_file_positions): Call elf_fake_sections with a struct fake_section_args argument. * elfcode.h (elf_write_relocs): Adjusted to match changes in data structures. (elf_slurp_reloc_table): Likewise. * elflink.c (_bfd_elf_link_read_relocs): Likewise. (_bfd_elf_link_size_reloc_section): Remove arg REL_HDR, replace with RELDATA. Remove argument O. All callers changed. Remove code to discover the right rel_hdr and count. (_bfd_elf_link_output_relocs): Adjusted to match changes in data structures. (elf_link_adjust_relocs): Remove args REL_HDR, COUNT and REL_HASH; replace with RELDATA. All callers changed. (elf_link_input_bfd): Correctly generate rel_hash data when both REL and RELA sections are present. (elf_reloc_link_order): Adjusted to match changes in data structures. (bfd_elf_final_link): Simplify code to count relocs. Free the hashes array for both REL and RELA. (get_dynamic_reloc_section_name): Use _bfd_elf_single_reloc_hdr * elf32-m32r.c (m32r_elf_fake_sections, elf_backend_fake_sections): Delete. * elf32-tic6x.c (elf32_tic6x_fake_sections, elf_backend_fake_sections): Delete. (elf32_tic6x_rel_relocation_p): Adjusted to match changes in data structures. * elf32-microblaze.c (microblaze_elf_check_relocs): Use _bfd_elf_single_rel_hdr. * elf32-ppc.c (ppc_elf_relax_section): Likewise. * elf32-spu.c (spu_elf_relocate_section): Likewise. * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. * elf64-hppa.c (get_reloc_section): Likewise. * elf64-mips.c (mips_elf64_slurp_reloc_table): Adjusted to match changes in data structures. (mips_elf64_write_relocs): Use _bfd_elf_single_rel_hdr. * elf64-ppc.c (ppc64_elf_edit_opd): Likewise. (ppc64_elf_edit_toc): Likewise. (get_relocs): Adjusted to match changes in data structures. Allocate an Elf_Internal_Shdr structure if necessary. (ppc64_elf_finish_dynamic_sections): Use _bfd_elf_single_rel_hdr. * elf64-sparc.c (elf64_sparc_slurp_reloc_table): Adjusted to match changes in data structures. * elfxx-ia64.c (get_reloc_section): Use _bfd_elf_single_rel_hdr. * elfxx-mips.c (MIPS_RELOC_RELA_P): Remove macro. (mips_elf_rel_relocation_p): Adjusted to match changes in data structures. (_bfd_mips_elf_relocate_section): Use mips_elf_rel_relocation_p rather than MIPS_RELOC_RELOCA_P. * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Use _bfd_elf_single_rel_hdr. (_bfd_sparc_elf_relocate_section): Likewise. ld/ * emultempl/xtensaelf.em (replace_insn_sec_with_prop_sec): Use _bfd_elf_single_rel_hdr.
2010-10-01 PR ld/12066Alan Modra1-0/+7
* ldexp.c (fold_name): Treat absolute symbols as plain numbers. * ld.texinfo (Expression Section): Don't say absolute symbols are addresses.
2010-09-29 * ldlang.c (lang_place_orphans): Zero vma when relocatable or non-loadAlan Modra1-0/+5
section for orphans handled here.
2010-09-27Fix unportable shell quoting.Ralf Wildenhues1-0/+4
/: Sync from GCC: PR bootstrap/44621 * configure.ac: Fix unportable shell quoting. * configure: Regenerate. config/: * po.m4 (AM_PO_SUBDIRS): Fix unportable shell quoting. bfd/: * configure: Regenerate. gas/: * configure: Regenerate. gold/: * configure: Regenerate. intl/: * configure: Regenerate. ld/: * configure: Regenerate. opcodes/: * configure: Regenerate. binutils/: * configure: Regenerate. gprof/: * configure: Regenerate.
2010-09-24 * scripttempl/armcoff.sc: Revert 2010-09-22 change.Dave Korn1-0/+4
2010-09-23ld/Alan Modra1-0/+5
* ldlang.c (lang_add_section): Don't copy SEC_RELOC from input to output section on a final link. bfd/ * elf.c (_bfd_elf_init_private_section_data): Allow for SEC_RELOC difference between input and output section.
2010-09-222010-09-22 Kai Tietz <kai.tietz@onevision.com>Kai Tietz1-0/+6
* ldlang.c (lang_add_section): Allow for debugging section to be marked as noload but to keep content. (IGNORE_SECTION): Likewise. (lang_check_section_addresses): Likewise. * ldwrite.c (build_link_order): Likewise.
2010-09-222010-09-22 Kai Tietz <kai.tietz@onevision.com>Kai Tietz1-0/+10
* 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-09-20 * emulparams/elf32_sparc.sh: Set NOP to 0x01000000David S. Miller1-0/+4