aboutsummaryrefslogtreecommitdiff
path: root/ld
AgeCommit message (Collapse)AuthorFilesLines
2011-05-042011-05-04 Tristan Gingold <gingold@adacore.com>Tristan Gingold3-2/+63
* emultempl/generic.em (ld_${EMULATION_NAME}_emulation): Add LDEMUL_ADD_OPTIONS and LDEMUL_HANDLE_OPTION. * emultempl/vms.em (OPTION_IDENTIFICATION): New macro. (gld${EMULATION_NAME}_add_options): New function. (gld${EMULATION_NAME}_list_options): Ditto. (gld${EMULATION_NAME}_handle_option): Ditto. (LDEMUL_ADD_OPTIONS, LDEMUL_HANDLE_OPTION) (LDEMUL_LIST_OPTIONS): Define.
2011-05-03 PR ld/12726Alan Modra6-11/+27
* 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-05-032011-05-03 Paul Brook <paul@codesourcery.com>Paul Brook4-0/+44
bfd/ * elf32-tic6x.c (elf32_tic6x_howto_table, elf32_tic6x_howto_table_rel, (elf32_tic6x_gc_sweep_hook, elf32_tic6x_relocate_section, elf32_tic6x_check_relocs): Add R_C6000_EHTYPE. gas/ * config/tc-tic6x.c (s_ehtype): New function. (md_pseudo_table): Add "ehtype". (tic6x_fix_adjustable, md_apply_fix): BFD_RELOC_C6000_EHTYPE. * doc/c-tic6x.texi: Document .ehtype directive. ld/testsuite/ * ld-tic6x/ehtype-reloc-1-rel.d: New test. * ld-tic6x/ehtype-reloc-1.d: New test. * ld-tic6x/ehtype-reloc-1.s: New test.
2011-05-01Add testcases for PR ld/12718.H.J. Lu7-0/+59
2011-05-01 H.J. Lu <hongjiu.lu@intel.com> PR ld/12718 * ld-i386/i386.exp: Run pr12718. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pr12718.d: New. * ld-i386/pr12718.s: Likewise. * ld-x86-64/pr12718.d: Likewise. * ld-x86-64/pr12718.s: Likewise.
2011-04-28 PR ld/12614Alan Modra2-2/+10
* emultempl/pe.em (_after_open): Correctly check whether symbol is in undef list.
2011-04-26 * dw2gencfi.c (dwcfi_seg_list): New struct.Nick Clifton9-4/+129
(dwcfi_hash): New static hash variable. (get_debugseg_name): New. (alloc_debugseg_item): New. (make_debug_seg): New. (dwcfi_hash_insert): New. (dwcfi_hash_find): New. (dwcfi_hash_find_or_make): New. (cfi_insn_data): New member cur_seg. (cie_entry): Likewise. (fde_entry): New cseg and handled members. (alloc_fde_entry): Initialize cseg member. (alloc_cfi_insn_data): Initialize cur_seg member. (dot_cfi_sections): Compare for beginning of section names via strncmp. (get_cfi_seg): New. (cfi_finish): Treat link-once sections. (is_now_linkonce_segment): New local helper. (output_cie): Ignore cie entries not member of current segment. (output_fde): Likewise. (select_cie_for_fde): Likewise. (cfi_change_reg_numbers): Add new argument for current segment and ignore insn elements, if not part of current segment. * ehopt.c (get_cie_info): Use strncmp for section name matching. (heck_eh_frame): Likewise. * coffcode.h (sec_to_styp_flags): Allow linkonce for debugging sections. * scripttempl/pe.sc: Handle .eh_frame($|.)* sections. * scripttempl/pep.sc: Likewise. * ld-pe/pe.exp: Add cfi/cfi32 tests. * ld-pe/cfi.d: New. * ld-pe/cfi32.d: New. * ld-pe/cfia.s: New. * ld-pe/cfib.s: New.
2011-04-24 PR ld/12365Alan Modra3-115/+55
PR ld/12696 include/ * bfdlink.h (ENUM_BITFIELD): Define. (struct bfd_link_hash_entry): Make "type" a bitfield. Add "non_ir_ref". (struct bfd_link_callbacks <notice>): Pass bfd_link_hash_entry pointer rather than "name". bfd/ * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Update "notice" call. * linker.c (_bfd_link_hash_newfunc): Clear bitfields. (_bfd_generic_link_add_one_symbol): Update "notice" call. * elflink.c (_bfd_elf_merge_symbol): Don't skip weak redefs when it is a redef of an IR symbol in a real BFD. ld/ * ldmain.c (notice): Delete "name" param, add "h". * plugin.c (plugin_notice): Likewise. Set non_ir_ref. Handle redefinitions of IR symbols in real BFDs. (plugin_multiple_definition, plugin_multiple_common): Delete. (non_ironly_hash, init_non_ironly_hash): Delete. (is_visible_from_outside): Traverse entry_symbol chain. (get_symbols): Use non_ir_ref flag rather than hash lookup.
2011-04-21Skip local IFUNC symbols when checking dynamic relocs in read-only sections.H.J. Lu5-0/+42
bfd/ 2011-04-21 H.J. Lu <hongjiu.lu@intel.com> PR ld/12694 * elf32-i386.c (elf_i386_readonly_dynrelocs): Skip local IFUNC symbols. * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise. ld/testsuite/ 2011-04-21 H.J. Lu <hongjiu.lu@intel.com> PR ld/12694 * ld-ifunc/ifunc-14-i386.d: New. * ld-ifunc/ifunc-14-x86-64.d: Likewise. * ld-ifunc/ifunc-14a.s: Likewise. * ld-ifunc/ifunc-14b.s: Likewise.
2011-04-212011-04-21 Tristan Gingold <gingold@adacore.com>Tristan Gingold2-0/+31
* scripttempl/alphavms.sc: Add dwarf2 embedding marks.
2011-04-202011-04-20 Tristan Gingold <gingold@adacore.com>Tristan Gingold2-0/+5
* emultempl/aix.em (_add_options): Ignore -bbigtoc switch.
2011-04-20bfd/Alan Modra2-1/+5
* hash.c (bfd_default_hash_table_size): Make it an unsigned long. (bfd_hash_table_init_n): Overflow checking. (bfd_hash_set_default_size): Return current size. Take unsigned long arg. Add 65537 to hash_size primes. * bfd-in.h (bfd_hash_set_default_size): Update prototype. * bfd-in2.h: Regenerate. gas/ * hash.c (set_gas_hash_table_size): Use bfd_hash_set_default_size. (hash_new_sized): New function, split out from.. (hash_new): ..here. ld/ * ld.h (ld_config_type <hash_table_size>): Make it an unsigned long.
2011-04-20 PR ld/12365Alan Modra5-49/+88
bfd/ * elfcode.h (elf_slurp_symbol_table): Put common plugin IR symbols in their own common section. * elflink.c (elf_link_add_object_symbols): Likewise. * linker.c (generic_link_check_archive_element): Don't lose flags if common section is pre-existing. (_bfd_generic_link_add_one_symbol): Likewise. ld/ * ldfile.c (ldfile_try_open_bfd): Move code creating and switching to plugin IR BFD.. * ldmain.c (add_archive_element): ..and similar code here.. * plugin.c (plugin_maybe_claim): ..to here. New function. (plugin_call_claim_file): Make static. (asymbol_from_plugin_symbol): Set ELF st_shndx for common syms. (plugin_multiple_common): New function. (plugin_call_all_symbols_read): Hook in plugin_multiple_common. * plugin.h (plugin_call_claim_file): Don't declare. (plugin_maybe_claim): Declare.
2011-04-20 PR ld/12365Alan Modra3-42/+96
include/ * bfdlink.h (struct bfd_link_callbacks): Modify multiple_definition and multiple_common parameters to pass in a bfd_link_hash_entry pointer rather than name,bfd etc. found in the hash entry. bfd/ * elflink.c (_bfd_elf_merge_symbol): Update multiple_common calls. * linker.c (_bfd_generic_link_add_one_symbol): Likewise. Call multiple_definition regardless of allow_multiple_definition. * simple.c (simple_dummy_multiple_definition): Update. * xcofflink.c (xcoff_link_add_symbols): Update multiple_definition calls. ld/ * ldmain.c (multiple_definition): Take a bfd_link_hash_entry pointer arg rather than "name", "obfd", "osec", "oval". Add code removed from linker.c. Hack around xcofflink.c oddity in passing NULL nbfd. (multiple_common): Similarly. * plugin.c (orig_allow_multiple_defs): Delete. (plugin_call_all_symbols_read): Don't twiddle allow_multiple_definition. (plugin_multiple_definition): Update.
2011-04-19Remove the unused ld-plugin/plugin-ignore.d.H.J. Lu2-1/+4
2011-04-19 H.J. Lu <hongjiu.lu@intel.com> * ld-plugin/plugin-ignore.d: Removed.
2011-04-18Update expected LTO linker errors for GCC 4.6.H.J. Lu3-2/+8
2011-04-18 H.J. Lu <hongjiu.lu@intel.com> * ld-plugin/plugin-7.d: Update expected LTO linker errors for GCC 4.6. * ld-plugin/plugin-8.d: Likewise.
2011-04-182011-04-18 Kai Tietz <ktietz@redhat.com>Kai Tietz2-4/+32
* deffilep.y (def_aligncomm): Avoid duplets.
2011-04-182011-04-18 Kai Tietz <ktietz@redhat.com>Kai Tietz2-10/+78
* deffilep.y (def_pool_str): New type. (pool_strs): Local static. (def_pool_alloc): Local function. (def_pool_strdup): Likewise. (def_pool_free): Likewise. (opt_name): Replace xmalloc/xstrdup by def_pool_alloc/def_pool_strdup. (dot_name): Likewise. (anylang_id): Likewise. (def_lex): Likewise. (def_file_parse): Call def_pool_free on exit and cleanup directives elements. (def_file_add_directive): Call def_pool_free.
2011-04-182011-04-18 Paul Brook <paul@codesourcery.com>Paul Brook2-0/+10
ld/ * emulparams/elf32_tic6x_le.sh: Define OTHER_READONLY_SECTIONS for unwinding tables.
2011-04-17 PR ld/12365Alan Modra2-0/+46
PR ld/12672 missing changelog entries
2011-04-17 PR ld/12365Alan Modra9-179/+207
PR ld/12672 bfd/ * bfd.c (BFD_PLUGIN): Define. (BFD_FLAGS_SAVED, BFD_FLAGS_FOR_BFD_USE_MASK): Add BFD_PLUGIN. * bfd-in2.h: Regenerate. * elflink.c (elf_link_output_extsym): Strip undefined plugin syms. * opncls.c (bfd_make_readable): Don't lose original bfd flags. ld/ * ldfile.c (ldfile_try_open_bfd): Don't attempt any plugin action when no_more_claiming. * ldmain.c (add_archive_element): Likewise. (multiple_definition): Remove plugin_multiple_definition call. (notice): Remove plugin_notice call. * ldlang.c (lang_list_insert_after, void lang_list_remove_tail): Move. Delete prototype. (plugin_insert): New static var. (open_input_bfds): Only rescan libs after plugin insert point. (lang_gc_sections): Omit plugin claimed files. (lang_process): Set plugin_insert. Only rescan when plugin adds objects. * plugin.h (no_more_claiming): Declare. (plugin_notice, plugin_multiple_definition): Don't declare. * plugin.c: Formatting. (orig_notice_all, orig_allow_multiple_defs, orig_callbacks, plugin_callbacks): New static vars. (no_more_claiming): Make global. (plugin_cached_allow_multiple_defs): Delete. (plugin_get_ir_dummy_bfd): Set SEC_EXCLUDE on dummy .text section, use newer bfd_make_section variant. Make COMMON section too. Error handling. Correct setting of gp size. (asymbol_from_plugin_symbol): Properly cast last arg of concat. (message): Likewise for ACONCAT. (asymbol_from_plugin_symbol): Use our COMMON section. (get_symbols): When report_plugin_symbols, show visibility too. (init_non_ironly_hash): Move. Don't test non_ironly_hash. (plugin_load_plugins): Save state of linker callbacks, set up to call plugin_notice instead. Call init_non_ironly_hash here. (plugin_call_all_symbols_read): Set plugin_multiple_definition in plugin callbacks. (plugin_notice): Rewrite. (plugin_multiple_definition): Make static, call original callback. ld/testsuite/ * ld-plugin/plugin-7.d: Adjust for plugin changes. * ld-plugin/plugin-8.d: Likewise. * ld-plugin/plugin.exp: Pass --verbose=2 for visibility test, and compare ld output to.. * ld-plugin/plugin-12.d: New.
2011-04-15 * ld-m68k/tls-gd-ie-1.d: Stabilize test.Maxim Kuvyrkov4-3/+33
* ld-m68k/tls-gd-3.[sd]: New test.
2011-04-15 PR ld/12672Alan Modra2-10/+38
* ldlang.c (enum open_bfd_mode): New. (open_input_bfds): Replace "force" param with "mode". Reload archives for rescan. Update all callers. (lang_process): Make another open_input_bfds pass for plugins.
2011-04-132011-04-13 Kai Tietz <ktietz@redhat.com>Kai Tietz4-22/+214
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-04-12 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Do notRichard Henderson4-3/+25
exclude empty .got sections.
2011-04-11 * scripttempl/elf.sc (.exception_ranges): Add new section.Nick Clifton2-1/+10
2011-04-11 PR 10549Nick Clifton5-0/+273
* elf-bfd.h (has_ifunc_symbols): Renamed to has_gnu_symbols. (has_gnu_symbols): Renamed from has_ifunc_symbols. * elf.c (_bfd_elf_set_osabi): Use new has_gnu_symbols name. * elf32-arm.c (elf32_arm_add_symbol_hook): Set has_gnu_symbols also if STB_GNU_UNIQUE symbol binding was seen. * elf32-i386.c (elf_i386_add_symbol_hook): Likewise. * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise. * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise. * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise. * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise. * ld-unique: New directory. * ld-unique/unique.exp: New file: Run the UNIQUE tests. * ld-unique/unique.s: New test file. * ld-unique/unique_empty.s: Likewise. * ld-unique/unique_shared.s: Likewise.
2011-04-11 * ld-elf/eh-frame-hdr.d: xfail avr.Alan Modra2-0/+6
2011-04-08Properly handle R_386_TLS_LDO_32 for PIE.H.J. Lu4-0/+34
bfd/ 2011-04-08 H.J. Lu <hongjiu.lu@intel.com> PR ld/12654 * elf32-i386.c (elf_i386_relocate_section): Check !executable instead of shared for R_386_TLS_LDO_32. ld/testsuite/ 2011-04-08 H.J. Lu <hongjiu.lu@intel.com> PR ld/12654 * ld-i386/i386.exp: Run tlspie2. * ld-i386/tlspie2.d: New. * ld-i386/tlspie2.s: Likewise.
2011-04-08 PR ld/12643Nick Clifton2-3/+8
* configure.tgt: Add support for arm-*-gnueabihf targets.
2011-04-072011-04-07 Eric B. Weddington <eric.weddington@atmel.com>Eric B. Weddington2-5/+4
* Makefile.in: Regenerate. Remove stray eavrtiny10 rules.
2011-04-07 * configure.tgt: Remove stray ;;.Joseph Myers2-1/+4
2011-04-06bfd:Joseph Myers7-40/+33
* config.bfd (thumb-*-oabi): Don't handle in list of obsolete targets. (strongarm*, thumb*, xscale*): Remove architectures. (strongarm-*-kaos*, thumb-*-coff, thumb-*-elf, thumb-epoc-pe*, thumb-*-pe*, strongarm-*-elf, strongarm-*-coff, xscale-*-elf, xscale-*-coff): Remove targets. binutils: * configure.in (thumb-*-pe*): Remove. * configure: Regenerate. binutils/testsuite: * binutils-all/objcopy.exp (*arm*-*-coff): Change to arm*-*-coff. (xscale-*-coff, thumb*-*-coff, thumb*-*-pe): Don't handle. gas: * configure.tgt (strongarm*be, strongarm*b, strongarm*, xscale*be|xscale*b, xscale*): Remove architectures. (thumb-*-coff, thumb-*-rtems*, thumb-*-elf, thumb-epoc-pe, thumb-*-pe, xscale-*-coff, xscale-*-elf): Remove targets. gas/testsuite: * gas/all/gas.exp (*arm*-*-coff): Change to arm*-*-coff. (thumb*-*-coff, thumb*-*-pe*): Don;t handle. * gas/arm/arm.exp (*arm*-*-*): Change to arm*-*-*. (*xscale*-*-*): Don't handle. * gas/cfi/cfi.exp (xscale*-*): Don't handle. * gas/elf/elf.exp (*arm*-*-*): Change to arm*-*-*. (xscale*-*-*): Don't handle. ld: * configure.tgt (thumb-*-linux-* | thumb-*-uclinux*, strongarm-*-coff, strongarm-*-elf, strongarm-*-kaos*, thumb-*-coff, thumb-*-elf, thumb-epoc-pe, thumb-*-pe, xscale-*-coff, xscale-*-elf): Remove targets. ld/testsuite: * ld-selective/selective.exp (xscale-*-*): Don't handle. * ld-srec/srec.exp (strongarm*-*-*, xscale*-*-*, thumb-*-*): Don't handle. (*arm*-*-*): Change to arm*-*-*. (strongarm*-*-coff, xscale*-*-coff, thumb-*-coff*, thumb-*-pe*, thumb-*-elf*, strongarm*-*-*, thumb-*-*): Remove xfails. * ld-undefined/undefined.exp (thumb*-*-pe*, thumb*-*-pe*): Remove commented-out xfails. (thumb-elf): Remove reference in comment. * lib/ld-lib.exp (strongarm*-*-*, xscale*-*-*, thumb-*-*): Don't handle.
2011-04-04Add a testcase for PR ld/12627.H.J. Lu5-0/+56
2011-04-04 H.J. Lu <hongjiu.lu@intel.com> PR ld/12627 * ld-i386/i386.exp: Run pr12627. * ld-i386/pr12627.d: New. * ld-i386/pr12627.s: Likewise. * ld-i386/pr12627.t: Likewise.
2011-03-31Fix elf_l1om linker scripts.H.J. Lu3-36/+9
2011-03-31 H.J. Lu <hongjiu.lu@intel.com> * configure.tgt: Add elf_l1om to targ_extra_libpath for x86_64-*-linux-*. * emulparams/elf_l1om.sh: Remove duplicates.
2011-03-31include/elf/Bernd Schmidt84-9/+3426
* tic6x.h (R_C6000_JUMP_SPLOT, R_C6000_EHTYPE, R_C6000_PCR_H16, R_C6000_PCR_L16): New relocs. (SHN_TIC6X_SCOMMON): Define. bfd/ * elf32-tic6x.h (struct elf32_tic6x_params): New. (elf32_tic6x_setup): Declare. * elf32-tic6x.c: Include <limits.h>. (ELF_DYNAMIC_LINKER, DEFAULT_STACK_SIZE, PLT_ENTRY_SIZE): Define. (struct elf32_tic6x_link_hash_table, struct elf32_link_hash_entry): New structures. (elf32_tic6x_link_hash_table, is_tic6x_elf): New macros. (tic6x_elf_scom_section, tic6x_elf_scom_symbol, tic6x_elf_scom_symbol_ptr): New static variables. (elf32_tic6x_howto_table, elf32_tic6x_howto_table_rel, elf32_tic6x_reloc_map): Add R_C6000_JUMP_SLOT, R_C6000_EHTYPE, R_C6000_PCR_H16 and R_C6000_PCR_L16. (elf32_tic6x_link_hash_newfunc, elf32_tic6x_link_hash_table_create, elf32_tic6x_link_hash_table_free, elf32_tic6x_setup, elf32_tic6x_using_dsbt, elf32_tic6x_install_rela, elf32_tic6x_create_dynamic_sections, elf32_tic6x_make_got_dynreloc, elf32_tic6x_finish_dynamic_symbol, elf32_tic6x_gc_sweep_hook, elf32_tic6x_adjust_dynamic_symbol): New static functions. (elf32_tic6x_relocate_section): For R_C6000_PCR_S21, convert branches to weak symbols as required by the ABI. Handle GOT and DSBT_INDEX relocs, and copy relocs to the output file as needed when generating DSBT output. (elf32_tic6x_check_relocs, elf32_tic6x_add_symbol_hook, elf32_tic6x_symbol_processing, elf32_tic6x_section_from_bfd_section, elf32_tic6x_allocate_dynrelocs, elf32_tic6x_size_dynamic_sections, elf32_tic6x_always_size_sections, elf32_tic6x_modify_program_headers, elf32_tic6x_finish_dynamic_sections, elf32_tic6x_plt_sym_val, elf32_tic6x_copy_private_data, elf32_tic6x_link_omit_section_dynsym): New static functions. (ELF_MAXPAGESIZE): Define to 0x1000. (bfd_elf32_bfd_copy_private_bfd_data, bfd_elf32_bfd_link_hash_table_create, bfd_elf32_bfd_link_hash_table_free, elf_backend_can_refcount, elf_backend_want_got_plt, elf_backend_want_dynbss, elf_backend_plt_readonly, elf_backend_got_header_size, elf_backend_gc_sweep_hook, elf_backend_modify_program_headers, elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol, elf_backend_check_relocs, elf_backend_add_symbol_hook, elf_backend_symbol_processing, elf_backend_link_output_symbol_hook, elf_backend_section_from_bfd_section, elf_backend_finish_dynamic_symbol, elf_backend_always_size_sections, elf32_tic6x_size_dynamic_sections, elf_backend_finish_dynamic_sections, elf_backend_omit_section_dynsym, elf_backend_plt_sym_val): Define. * bfd/reloc.c (BFD_RELOC_C6000_JUMP_SLOT, BFD_RELOC_C6000_EHTYPE, BFD_RELOC_C6000_PCR_H16, BFD_RELOC_C6000_PCR_S16): Add. * bfd/bfd-in2.h: Regenerate. * bfd/libbfd.h: Regenerate. * config.bfd: Accept tic6x-*-* instead of tic6x-*-elf. gas/ * config/tc-tic6x.c (sbss_section, scom_section, scom_symbol): New static variables. (md_begin): Initialize them. (s_tic6x_scomm): New static function. (md_pseudo_table): Add "scomm". (tc_gen_reloc): Really undo all adjustments made by bfd_install_relocation. * doc/c-tic6x.texi: Document the .scomm directive. gas/testsuite/ * gas/tic6x/scomm-directive-1.s: New test. * gas/tic6x/scomm-directive-1.d: New test. * gas/tic6x/scomm-directive-2.s: New test. * gas/tic6x/scomm-directive-2.d: New test. * gas/tic6x/scomm-directive-3.s: New test. * gas/tic6x/scomm-directive-3.d: New test. * gas/tic6x/scomm-directive-4.s: New test. * gas/tic6x/scomm-directive-4.d: New test. * gas/tic6x/scomm-directive-5.s: New test. * gas/tic6x/scomm-directive-5.d: New test. * gas/tic6x/scomm-directive-6.s: New test. * gas/tic6x/scomm-directive-6.d: New test. * gas/tic6x/scomm-directive-7.s: New test. * gas/tic6x/scomm-directive-7.d: New test. * gas/tic6x/scomm-directive-8.s: New test. * gas/tic6x/scomm-directive-8.d: New test. ld/ * emulparams/elf32_tic6x_le.sh (BIG_OUTPUT_FORMAT, EXTRA_EM_FILE, GENERATE_SHLIB_SCRIPT): New defines. (TEXT_START_ADDR): Define differently depending on target. (.got): Redefine to include "*(.dsbt)". (SDATA_START_SYMBOLS): Remove, replace with (OTHER_GOT_SYMBOLS): New. (OTHER_BSS_SECTIONS): Define only for ELF targets. * emultempl/tic6xdsbt.em: New file. * gen-doc.texi: Set C6X. * ld.texinfo: Likewise. (Options specific to C6X uClinux targets): New section. binutils/ * readelf.c (get_symbol_index_type): Handle SCOM for TIC6X. (dump_relocations): Likewise. binutils/testsuite/ * lib/binutils-common.exp (is_elf_format): Accept tic6x*-*-uclinux*. ld/testsuite/ * ld-scripts/crossref.exp: Add CFLAGS for tic6x*-*-*. * ld-elf/sec-to-seg.exp: Remove tic6x from list of targets defining pagesize to 1. * ld-tic6x/tic6x.exp: Add support for DSBT shared library/executable linking tests. * ld-tic6x/dsbt.ld: New linker script. * ld-tic6x/dsbt-be.ld: New linker script. * ld-tic6x/dsbt-overflow.ld: New linker script. * ld-tic6x/dsbt-inrange.ld: New linker script. * ld-tic6x/shlib-1.s: New test. * ld-tic6x/shlib-2.s: New test. * ld-tic6x/shlib-app-1r.s: New test. * ld-tic6x/shlib-app-1.s: New test. * ld-tic6x/shlib-1.sd: New test. * ld-tic6x/shlib-1.dd: New test. * ld-tic6x/shlib-app-1.rd: New test. * ld-tic6x/shlib-app-1rb.rd: New test. * ld-tic6x/shlib-app-1.sd: New test. * ld-tic6x/static-app-1rb.od: New test. * ld-tic6x/shlib-app-1.dd: New test. * ld-tic6x/shlib-app-1rb.sd: New test. * ld-tic6x/static-app-1b.od: New test. * ld-tic6x/static-app-1r.od: New test. * ld-tic6x/shlib-1rb.rd: New test. * ld-tic6x/shlib-app-1rb.dd: New test. * ld-tic6x/shlib-1rb.sd: New test. * ld-tic6x/shlib-1rb.dd: New test. * ld-tic6x/shlib-app-1b.od: New test. * ld-tic6x/tic6x.exp: New test. * ld-tic6x/static-app-1rb.rd: New test. * ld-tic6x/shlib-app-1r.od: New test. * ld-tic6x/static-app-1.od: New test. * ld-tic6x/static-app-1b.rd: New test. * ld-tic6x/static-app-1r.rd: New test. * ld-tic6x/static-app-1rb.sd: New test. * ld-tic6x/static-app-1b.sd: New test. * ld-tic6x/static-app-1rb.dd: New test. * ld-tic6x/static-app-1r.sd: New test. * ld-tic6x/static-app-1b.dd: New test. * ld-tic6x/shlib-1b.rd: New test. * ld-tic6x/static-app-1r.dd: New test. * ld-tic6x/shlib-app-1b.rd: New test. * ld-tic6x/shlib-1r.rd: New test. * ld-tic6x/shlib-app-1r.rd: New test. * ld-tic6x/shlib-1b.sd: New test. * ld-tic6x/static-app-1.rd: New test. * ld-tic6x/shlib-app-1b.sd: New test. * ld-tic6x/shlib-1r.sd: New test. * ld-tic6x/shlib-1b.dd: New test. * ld-tic6x/shlib-app-1r.sd: New test. * ld-tic6x/shlib-app-1b.dd: New test. * ld-tic6x/shlib-1r.dd: New test. * ld-tic6x/static-app-1.sd: New test. * ld-tic6x/shlib-app-1r.dd: New test. * ld-tic6x/static-app-1.dd: New test. * ld-tic6x/shlib-noindex.rd: New test. * ld-tic6x/shlib-noindex.dd: New test. * ld-tic6x/shlib-noindex.sd: New test. * ld-tic6x/got-reloc-local-1.s: New test. * ld-tic6x/got-reloc-local-2.s: New test. * ld-tic6x/got-reloc-local-r.d: New test. * ld-tic6x/got-reloc-global.s: New test. * ld-tic6x/got-reloc-global-addend-1.d: New test. * ld-tic6x/got-reloc-global-addend-1.s: New test. * ld-tic6x/got-reloc-global-addend-2.d: New test. * ld-tic6x/got-reloc-inrange.d: New test. * ld-tic6x/got-reloc-overflow.d: New test. * ld-tic6x/got-reloc-global-addend-2.s: New test. * ld-tic6x/dsbt-index-error.d: New test. * ld-tic6x/dsbt-index.d: New test. * ld-tic6x/dsbt-index.s: New test. * ld-tic6x/shlib-app-1.od: New test. * ld-tic6x/shlib-app-1rb.od: New test. * ld-tic6x/shlib-1.rd: New test. * ld-tic6x/weak.d: New test. * ld-tic6x/weak-be.d: New test. * ld-tic6x/weak.s: New test. * ld-tic6x/weak-data.d: New test. * ld-tic6x/common.d: New test. * ld-tic6x/common.ld: New test. * ld-tic6x/common.s: New test.
2011-03-30 * ld-elf/elf.exp: Force 32-bit start address for alpha.Richard Henderson5-3/+16
* ld-elf/group8a.d: Don't disable for alpha. * ld-elf/group8b.d: Likewise. * ld-gc/start.s: Use .dc.a instead of .long.
2011-03-29 PR ld/12613Alan Modra2-1/+6
* ldlex.l (lex_warn_invalid): Don't assume char is unsigned.
2011-03-28Add support for DragonFlyBSD target.Nick Clifton4-7/+28
2011-03-28 * configure.in: Check for windows.h, not Windows.h.Joseph Myers4-5/+11
* configure: Regenerate. * plugin.c: Include windows.h, not Windows.h.
2011-03-25Regenerate Makefile.in.Eric B. Weddington2-0/+44
2011-03-23 * lexsup.c (parse_args): Only set report_plugin_symbols if pluginsJoseph Myers2-1/+8
are enabled. Mark level as possibly unused.
2011-03-23bfd/Alan Modra22-31/+440
* elf32-ppc.c (ppc_elf_tls_optimize): Catch more cases where old-style __tls_get_addr calls without marker relocs don't match their arg setup insn one for one. If such mismatches are found report the reloc and don't do any tls optimization. * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise. ld/testsuite/ * ld-powerpc/tlsmark.s: Delete non-optimizable section. * ld-powerpc/tlsmark32.s: Likewise. * ld-powerpc/tlsmark.d: Adjust to suit. * ld-powerpc/tlsmark32.d: Likewise. * ld-powerpc/tlsopt1.d, * ld-powerpc/tlsopt1.s: New. * ld-powerpc/tlsopt2.d, * ld-powerpc/tlsopt2.s: New. * ld-powerpc/tlsopt3.d, * ld-powerpc/tlsopt3.s: New. * ld-powerpc/tlsopt4.d, * ld-powerpc/tlsopt4.s: New. * ld-powerpc/tlsopt1_32.d, * ld-powerpc/tlsopt1_32.s: New. * ld-powerpc/tlsopt2_32.d, * ld-powerpc/tlsopt2_32.s: New. * ld-powerpc/tlsopt3_32.d, * ld-powerpc/tlsopt3_32.s: New. * ld-powerpc/tlsopt4_32.d, * ld-powerpc/tlsopt4_32.s: New. * ld-powerpc/powerpc.exp: Run new tests.
2011-03-22/bfd:Eric B. Weddington11-3/+139
2011-03-22 Eric B. Weddington <eric.weddington@atmel.com> * archures.c: Add AVR XMEGA architecture information. * cpu-avr.c (arch_info_struct): Likewise. * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise. (elf32_avr_object_p): Likewise. /gas: 2011-03-22 Eric B. Weddington <eric.weddington@atmel.com> * config/tc-avr.c (struct avr_opcodes_s): Add opcode field. (AVR_INSN): Change definition to match. (avr_opcodes): Likewise, change to match. (mcu_types): Add XMEGA architecture names and new XMEGA device names. (md_show_usage): Add XMEGA architecture names. (avr_operand): Add 'E' constraint for DES instruction of XMEGA devices. Add support for SPM Z+ instruction. * doc/c-avr.texi: Add documentation for XMEGA architectures and devices. /include/opcode: 2011-03-22 Eric B. Weddington <eric.weddington@atmel.com> * avr.h (AVR_ISA_SPMX,AVR_ISA_DES,AVR_ISA_M256,AVR_ISA_XMEGA): New instruction set flags. (AVR_INSN): Add new instructions for SPM Z+, DES for XMEGA. /ld: 2011-03-22 Eric B. Weddington <eric.weddington@atmel.com> * Makefile.am (ALL_EMULATION_SOURCES): Add AVR XMEGA architectures. (eavrxmega?.c): Likewise. * configure.tgt (targ_extra_emuls): Likewise. * emulparams/avrxmega1.sh: New file. * emulparams/avrxmega2.sh: Likewise. * emulparams/avrxmega3.sh: Likewise. * emulparams/avrxmega4.sh: Likewise. * emulparams/avrxmega5.sh: Likewise. * emulparams/avrxmega6.sh: Likewise. * emulparams/avrxmega7.sh: Likewise. * emultempl/avrelf.em (avr_elf_${EMULATION_NAME}_before_allocation): Add avrxmega6, avrxmega7 to list of architectures for no stubs. /opcodes: 2011-03-22 Eric B. Weddington <eric.weddington@atmel.com> * avr-dis.c (avr_operand): Add opcode_str parameter. Check for post-increment to support LPM Z+ instruction. Add support for 'E' constraint for DES instruction. (print_insn_avr): Adjust calls to avr_operand. Rename variable.
2011-03-212011-03-21 Eric B. Weddington <eric.weddington@atmel.com>Eric B. Weddington2-0/+25
* scripttempl/avr.sc: Add fuse, lock, and signature memory regions.
2011-03-15ld: vers19 test: add -rpath-linkMike Frysinger2-1/+5
Using -Wl,-rpath,. isn't sufficient for cross-linkers to locate the necessary libraries. So throw in -Wl,-rpath-link,. to make it work. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-03-14include/elf/Richard Sandiford72-45/+7285
* arm.h (R_ARM_IRELATIVE): New relocation. bfd/ * reloc.c (BFD_RELOC_ARM_IRELATIVE): New relocation. * bfd-in2.h: Regenerate. * elf32-arm.c (elf32_arm_howto_table_2): Rename existing definition to elf32_arm_howto_table_3 and replace with a single R_ARM_IRELATIVE entry. (elf32_arm_howto_from_type): Update accordingly. (elf32_arm_reloc_map): Map BFD_RELOC_ARM_IRELATIVE to R_ARM_IRELATIVE. (elf32_arm_reloc_name_lookup): Handle elf32_arm_howto_table_3. (arm_plt_info): New structure, split out from elf32_arm_link_hash_entry with an extra noncall_refcount field. (arm_local_iplt_info): New structure. (elf_arm_obj_tdata): Add local_iplt. (elf32_arm_local_iplt): New accessor macro. (elf32_arm_link_hash_entry): Replace plt_thumb_refcount, plt_maybe_thumb_refcount and plt_got_offset with an arm_plt_info. Change tls_type to a bitfield and add is_iplt. (elf32_arm_link_hash_newfunc): Update accordingly. (elf32_arm_allocate_local_sym_info): New function. (elf32_arm_create_local_iplt): Likewise. (elf32_arm_get_plt_info): Likewise. (elf32_arm_plt_needs_thumb_stub_p): Likewise. (elf32_arm_get_local_dynreloc_list): Likewise. (create_ifunc_sections): Likewise. (elf32_arm_copy_indirect_symbol): Update after the changes to elf32_arm_link_hash_entry. Assert the is_iplt has not yet been set. (arm_type_of_stub): Add an st_type argument. Use elf32_arm_get_plt_info to get PLT information. Assert that all STT_GNU_IFUNC references are turned into PLT references. (arm_build_one_stub): Pass the symbol type to elf32_arm_final_link_relocate. (elf32_arm_size_stubs): Pass the symbol type to arm_type_of_stub. (elf32_arm_allocate_irelocs): New function. (elf32_arm_add_dynreloc): In static objects, use .rel.iplt for all R_ARM_IRELATIVE. (elf32_arm_allocate_plt_entry): New function. (elf32_arm_populate_plt_entry): Likewise. (elf32_arm_final_link_relocate): Add an st_type parameter. Set srelgot to null for static objects. Use separate variables to record which st_value and st_type should be used when generating a dynamic relocation. Use elf32_arm_get_plt_info to find the symbol's PLT information, setting has_iplt_entry, splt, plt_offset and gotplt_offset accordingly. Check whether STT_GNU_IFUNC symbols should resolve to an .iplt entry, and change the relocation target accordingly. Broaden assert to include .iplts. Don't set sreloc for static relocations. Assert that we only generate dynamic R_ARM_RELATIVE relocations for R_ARM_ABS32 and R_ARM_ABS32_NOI. Generate R_ARM_IRELATIVE relocations instead of R_ARM_RELATIVE relocations if the target is an STT_GNU_IFUNC symbol. Pass the symbol type to arm_type_of_stub. Conditionally resolve GOT references to the .igot.plt entry. (elf32_arm_relocate_section): Update the call to elf32_arm_final_link_relocate. (elf32_arm_gc_sweep_hook): Use elf32_arm_get_plt_info to get PLT information. Treat R_ARM_REL32 and R_ARM_REL32_NOI as call relocations in shared libraries and relocatable executables. Count non-call PLT references. Use elf32_arm_get_local_dynreloc_list to get the list of dynamic relocations for a local symbol. (elf32_arm_check_relocs): Always create ifunc sections. Set isym at the same time as setting h. Use elf32_arm_allocate_local_sym_info to allocate local symbol information. Treat R_ARM_REL32 and R_ARM_REL32_NOI as call relocations in shared libraries and relocatable executables. Record PLT information for local STT_GNU_IFUNC functions as well as global functions. Count non-call PLT references. Use elf32_arm_get_local_dynreloc_list to get the list of dynamic relocations for a local symbol. (elf32_arm_adjust_dynamic_symbol): Handle STT_GNU_IFUNC symbols. Don't remove STT_GNU_IFUNC PLTs unless all references have been removed. Update after the changes to elf32_arm_link_hash_entry. (allocate_dynrelocs_for_symbol): Decide whether STT_GNU_IFUNC PLT entries should live in .plt or .iplt. Check whether the .igot.plt and .got entries can be combined. Use elf32_arm_allocate_plt_entry to allocate .plt and .(i)got.plt entries. Detect which .got entries will need R_ARM_IRELATIVE relocations and use elf32_arm_allocate_irelocs to allocate them. Likewise other non-.got dynamic relocations. (elf32_arm_size_dynamic_sections): Allocate .iplt, .igot.plt and dynamic relocations for local STT_GNU_IFUNC symbols. Check whether the .igot.plt and .got entries can be combined. Detect which .got entries will need R_ARM_IRELATIVE relocations and use elf32_arm_allocate_irelocs to allocate them. Use stashed section pointers intead of strcmp checks. Handle iplt and igotplt. (elf32_arm_finish_dynamic_symbol): Use elf32_arm_populate_plt_entry to fill in .plt, .got.plt and .rel(a).plt entries. Point STT_GNU_IFUNC symbols at an .iplt entry if non-call relocations resolve to it. (elf32_arm_output_plt_map_1): New function, split out from elf32_arm_output_plt_map. Handle .iplt entries. Use elf32_arm_plt_needs_thumb_stub_p. (elf32_arm_output_plt_map): Call it. (elf32_arm_output_arch_local_syms): Add mapping symbols for local .iplt entries. (elf32_arm_swap_symbol_in): Handle Thumb STT_GNU_IFUNC symbols. (elf32_arm_swap_symbol_out): Likewise. (elf32_arm_add_symbol_hook): New function. (elf_backend_add_symbol_hook): Define for all targets. opcodes/ * arm-dis.c (get_sym_code_type): Treat STT_GNU_IFUNCs as code. gas/ * config/tc-arm.c (md_pcrel_from_section): Use S_FORCE_RELOC to determine whether a relocation is needed. (md_apply_fix, arm_apply_sym_value): Likewise. ld/testsuite/ * ld-arm/ifunc-1.s, ld-arm/ifunc-1.dd, ld-arm/ifunc-1.gd, ld-arm/ifunc-1.rd, ld-arm/ifunc-2.s, ld-arm/ifunc-2.dd, ld-arm/ifunc-2.gd, ld-arm/ifunc-2.rd, ld-arm/ifunc-3.s, ld-arm/ifunc-3.dd, ld-arm/ifunc-3.gd, ld-arm/ifunc-3.rd, ld-arm/ifunc-4.s, ld-arm/ifunc-4.dd, ld-arm/ifunc-4.gd, ld-arm/ifunc-4.rd, ld-arm/ifunc-5.s, ld-arm/ifunc-5.dd, ld-arm/ifunc-5.gd, ld-arm/ifunc-5.rd, ld-arm/ifunc-6.s, ld-arm/ifunc-6.dd, ld-arm/ifunc-6.gd, ld-arm/ifunc-6.rd, ld-arm/ifunc-7.s, ld-arm/ifunc-7.dd, ld-arm/ifunc-7.gd, ld-arm/ifunc-7.rd, ld-arm/ifunc-8.s, ld-arm/ifunc-8.dd, ld-arm/ifunc-8.gd, ld-arm/ifunc-8.rd, ld-arm/ifunc-9.s, ld-arm/ifunc-9.dd, ld-arm/ifunc-9.gd, ld-arm/ifunc-9.rd, ld-arm/ifunc-10.s, ld-arm/ifunc-10.dd, ld-arm/ifunc-10.gd, ld-arm/ifunc-10.rd, ld-arm/ifunc-11.s, ld-arm/ifunc-11.dd, ld-arm/ifunc-11.gd, ld-arm/ifunc-11.rd, ld-arm/ifunc-12.s, ld-arm/ifunc-12.dd, ld-arm/ifunc-12.gd, ld-arm/ifunc-12.rd, ld-arm/ifunc-13.s, ld-arm/ifunc-13.dd, ld-arm/ifunc-13.gd, ld-arm/ifunc-13.rd, ld-arm/ifunc-14.s, ld-arm/ifunc-14.dd, ld-arm/ifunc-14.gd, ld-arm/ifunc-14.rd, ld-arm/ifunc-15.s, ld-arm/ifunc-15.dd, ld-arm/ifunc-15.gd, ld-arm/ifunc-15.rd, ld-arm/ifunc-16.s, ld-arm/ifunc-16.dd, ld-arm/ifunc-16.gd, ld-arm/ifunc-16.rd, ld-arm/ifunc-dynamic.ld, ld-arm/ifunc-static.ld: New tests. * ld-arm/farcall-group.d, ld-arm/farcall-group-size2.d, ld-arm/farcall-mixed-lib-v4t.d, ld-arm/farcall-mixed-lib.d: Update for new stub hashes. * ld-arm/arm-elf.exp: Run them.
2011-03-14include/elf/Richard Sandiford2-1/+6
* internal.h (elf_internal_sym): Add st_target_internal. * arm.h (arm_st_branch_type): New enum. (ARM_SYM_BRANCH_TYPE): New macro. bfd/ * elf-bfd.h (elf_link_hash_entry): Add target_internal. * elf.c (swap_out_syms): Set st_target_internal for each Elf_Internal_Sym. * elfcode.h (elf_swap_symbol_in): Likewise. * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise. * elf32-sh-symbian.c (sh_symbian_relocate_section): Likewise. * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise. * elflink.c (elf_link_output_extsym): Likewise. (bfd_elf_final_link): Likewise. (elf_link_add_object_symbols): Copy st_target_internal to the hash table if we see a definition. (_bfd_elf_copy_link_hash_symbol_type): Copy target_internal. * elf32-arm.c (elf32_arm_stub_hash_entry): Replace st_type with a branch_type field. (a8_erratum_fix, a8_erratum_reloc): Likewise. (arm_type_of_stub): Replace actual_st_type with an actual_branch_type parameter. (arm_build_one_stub): Use branch types rather than st_types to determine the type of branch. (cortex_a8_erratum_scan): Likewise. (elf32_arm_size_stubs): Likewise. (bfd_elf32_arm_process_before_allocation): Likewise. (allocate_dynrelocs_for_symbol): Likewise. (elf32_arm_finish_dynamic_sections): Likewise. (elf32_arm_final_link_relocate): Replace sym_flags parameter with a branch_type parameter. (elf32_arm_relocate_section): Update call accordingly. (elf32_arm_adjust_dynamic_symbol): Don't check STT_ARM_TFUNC. (elf32_arm_output_map_sym): Initialize st_target_internal. (elf32_arm_output_stub_sym): Likewise. (elf32_arm_symbol_processing): Delete. (elf32_arm_swap_symbol_in): Convert STT_ARM_TFUNCs into STT_FUNCs. Use st_target_internal to record the branch type. (elf32_arm_swap_symbol_out): Use st_target_internal to test for Thumb functions. (elf32_arm_is_function_type): Delete. (elf_backend_symbol_processing): Likewise. (elf_backend_is_function_type): Likewise. gas/ * config/tc-arm.c (arm_adjust_symtab): Set the branch type for Thumb symbols. ld/ * emultempl/armelf.em (gld${EMULATION_NAME}_finish): Check eh->target_internal. opcodes/ * arm-dis.c (get_sym_code_type): Don't check for STT_ARM_TFUNC. Use branch types instead. (print_insn): Likewise.
2011-03-14bfd/Richard Sandiford2-1/+6
* elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj. (elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion into the PLT block. ld/ * emultempl/armelf.em (arm_elf_before_allocation): Check dynobj instead of dynamic_sections_created.
2011-03-14bfd/Richard Sandiford6-0/+31
* elf32-arm.c (elf32_arm_check_relocs): Use call_reloc_p, may_need_local_target_p and may_become_dynamic_p to classify the relocation type. Don't check info->symbolic or h->def_regular when deciding whether to record a potential dynamic reloc. Don't treat potential dynamic relocs as PLT references. (elf32_arm_gc_sweep_hook): Update to match. Assert that we don't try to make the PLT reference count go negative. ld/testsuite/ * ld-arm/arm-lib-plt-2a.s, ld-arm/arm-lib-plt-2b.s, ld-arm/arm-lib-plt-2.dd, ld-arm/arm-lib-plt-2.rd: New tests. * ld-arm/arm-elf.exp: Run them.
2011-03-14bfd/Richard Sandiford8-0/+58
* elf32-arm.c (elf32_arm_final_link_relocate): Always fill in the GOT entry here, rather than leaving it to finish_dynamic_symbol. Only create a dynamic relocation for local references if info->shared. (allocate_dynrelocs_for_symbol): Update dynamic relocation allocation accordingly. (elf32_arm_finish_dynamic_symbol): Don't initialise the GOT entry here. ld/testsuite/ * ld-arm/exec-got-1a.s, ld-arm/exec-got-1b.s, ld-arm/exec-got-1.d, ld-arm/unresolved-1.s, ld-arm/unresolved-1.d, ld-arm/unresolved-1-dyn.d: New tests. * ld-arm/arm-elf.exp: Run them.