aboutsummaryrefslogtreecommitdiff
path: root/ld
AgeCommit message (Collapse)AuthorFilesLines
2013-04-29 * elflink.c (_bfd_elf_gc_mark_extra_sections): Remove mark fromNick Clifton2-1/+6
fragmented .debug_line sections associated with unmarked code sections. * dwarf.c (read_debug_line_header): New function. Reads in a header in a .debug_line section. (display_debug_lines_raw): Use new function. Handle fragmentary .debug_line sections. (display_debug_lines_decoded): Likewise. * readelf.c (process_section_headers): Handle fragmenatry .debug_line sections. (display_debug_section): Likewise. * as.c (Options): Add -gdwarf-sections. (parse_args): Likewise. * as.h (flag_dwarf_sections): Declare. * dwarf2dbg.c (emit_fixed_inc_line_addr): Skip section changes. (process_entries): When -gdwarf-sections is enabled generate fragmentary .debug_line sections. (out_debug_line): Set the section for the .debug_line section end symbol. * doc/as.texinfo: Document -gdwarf-sections. * NEWS: Mention -gdwarf-sections. * gas/elf/dwarf2-3.d: Fix expected readelf output. * scripttempl/DWARF.sc: Add support for .debug_line.* and .debug_line_end.
2013-04-29bfd/efl32-arm.c: Fix handling of IRELATIVE relocs.Will Newton10-6/+87
bfd/ChangeLog: 2013-04-24 Will Newton <will.newton@linaro.org> * elf32-arm.c (elf32_arm_populate_plt_entry): Call elf32_arm_add_dynreloc when emitting R_ARM_IRELATIVE relocs. ld/testsuite/ChangeLog: 2013-04-24 Will Newton <will.newton@linaro.org> * ld-arm/arm-elf.exp: Add IFUNC test 17. * ld-arm/ifunc-17.dd: New file. * ld-arm/ifunc-17.gd: Likewise. * ld-arm/ifunc-17.rd: Likewise. * ld-arm/ifunc-17.s: Likweise. * ld-arm/ifunc-1.rd: Reorder relocs to match linker output. * ld-arm/ifunc-2.rd: Likewise. * ld-arm/ifunc-5.rd: Likewise. * ld-arm/ifunc-6.rd: Likewise.
2013-04-29ld-plugin/lto.exp: Disable ld/12942 test for gcc < 4.7.0.Will Newton2-19/+35
The test for ld/12942 fails with gcc versions before 4.7.0. This patch disables this test with these versions of gcc. ld/testsuite/ChangeLog: 2013-04-29 Will Newton <will.newton@linaro.org> * ld-plugin/lto.exp: Disable ld/12942 test for gcc < 4.7.0.
2013-04-29 * emultempl/pe.em [cygwin]: Do not merge rdata with v2Nick Clifton2-6/+13
psuedo-relocs.
2013-04-28ld/Thomas Schwinge29-28/+59
* scripttempl/armbpabi.sc: Replace "source" usage with ".". * scripttempl/avr.sc: Likewise. * scripttempl/elf.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/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/xstormy16.sc: Likewise.
2013-04-26 * scripttempl/avr.sc: Add ALIGN directive after *(.progmem*).Nick Clifton2-0/+6
2013-04-26 * emultempl/elf32.em (gld${EMULATION_NAME}_after_open): TestAlan Modra2-6/+15
unresolved_syms_in_shared_libs rather than !executable to determine whether to load DT_NEEDED libraries.
2013-04-25bfd/Alan Modra6-37/+58
* config.bfd: Add powerpc64le-linux. gas/ * configure.in: Allow little-endian linux. * configure: Regenerate. gold/ * configure.tgt: Add powerpcle and powerpc64le. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Add eelf32lppclinux.c. (eelf32lppclinux.c): New rule. * Makefile.in: Regenerate. * configure.tgt: Merge powerpc-linux and other powerpc-elf targets with corresponding little-endian targets. * emulparams/elf32lppc.sh: Update comment. * emulparams/elf32lppclinux.sh: New.
2013-04-24Enable x32 for x86_64-*-elf*H.J. Lu2-1/+10
This patch enables x32 for x86_64-*-elf* for embedded target and disables rex tests since it uses '/' as prefix separator which is `\' for x86_64-*-elf*. bfd/ * config.bfd (targ_selvecs): Add bfd_elf32_x86_64_vec for x86_64-*-elf*. gas/testsuite/ * gas/i386/rex.d: Skip x86_64-*-elf*. * gas/i386/ilp32/rex.d: Likewise. ld/ * configure.tgt (targ_extra_emuls): Adds elf32_x86_64 for x86_64-*-elf*. (targ_extra_libpath): Likewise. (tdir_elf_i386): Replace x86_64 with i386 for x86_64-*-elf*.
2013-04-24ld/Yufeng Zhang4-10/+24
* emulparams/aarch64elf.sh: Define ELFSIZE=64. * emulparams/aarch64linux.sh: Ditto. * emultempl/aarch64elf.em (aarch64_elf_before_allocation): Replace elf64 with elf${ELFSIZE}. (elf64_aarch64_add_stub_section): Likewise. (build_section_lists): Likewise. (gld${EMULATION_NAME}_after_allocation): Likewise. (gld${EMULATION_NAME}_finish): Likewise. (aarch64_elf_create_output_section_statements): Likewise.
2013-04-24 PR ld/15389Nick Clifton2-0/+6
* scripttempl/avr.sc: Add .note.gnu.build-id section.
2013-04-22bfd/Alan Modra11-13/+30
* elf64-ppc.c (ppc64_elf_check_relocs): Don't call create_linkage_sections here.. (ppc64_elf_init_stub_bfd): ..do so here. Return status. (create_linkage_sections): Move earlier in file. (ppc64_elf_setup_section_lists): Remove now useless htab->brlt test. * elf64-ppc.h (ppc64_elf_init_stub_bfd): Update proto. ld/ * emultempl/ppc64elf.em (ppc_create_output_section_statements): Check return from ppc64_elf_init_stub_bfd. ld/testsuite/ * ld-powerpc/tlsexe.d: Adjust. * ld-powerpc/tlsexe.r: Adjust. * ld-powerpc/tlsexetoc.d: Adjust. * ld-powerpc/tlsexetoc.r: Adjust. * ld-powerpc/tlsso.d: Adjust. * ld-powerpc/tlsso.r: Adjust. * ld-powerpc/tlstocso.d: Adjust. * ld-powerpc/tlstocso.r: Adjust.
2013-04-16 * Makefile.am (emmo.c): Add a dependency upon scripttempl/DWARF.sc.Nick Clifton3-2/+3
2013-04-15Check regular reference without non-GOT referenceH.J. Lu4-0/+49
non_got_ref may not be set when building shared library. We need to set non_got_ref if there are any non-PIC relocations. But we only did this when there were no PLT/GOT relocations. It failed when there is a PLT relocation. This checkin moves the non_got_ref check out. bfd/ 2013-04-15 H.J. Lu <hongjiu.lu@intel.com> PR ld/15371 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Check regular reference without non-GOT reference when building shared library. ld/testsuite/ 2013-04-15 H.J. Lu <hongjiu.lu@intel.com> PR ld/15371 * ld-ifunc/ifunc-20-i386.d: New file. * ld-ifunc/ifunc-20-x86-64.d: Likewise. * ld-ifunc/ifunc-20.s: Likewise. diff --git a/bfd/elf-ifunc.c b/bfd/elf-ifunc.c index e56427d..7e7ec36 100644 --- a/bfd/elf-ifunc.c +++ b/bfd/elf-ifunc.c @@ -187,23 +187,20 @@ _bfd_elf_allocate_ifunc_dyn_relocs (struct bfd_link_info *info, htab = elf_hash_table (info); + /* When building shared library, we need to handle the case where it is + marked with regular reference, but not non-GOT reference since the + non-GOT reference bit may not be set here. */ + if (info->shared && !h->non_got_ref && h->ref_regular) + for (p = *head; p != NULL; p = p->next) + if (p->count) + { + h->non_got_ref = 1; + goto keep; + } + /* Support garbage collection against STT_GNU_IFUNC symbols. */ if (h->plt.refcount <= 0 && h->got.refcount <= 0) { - /* When building shared library, we need to handle the case - where it is marked with regular reference, but not non-GOT - reference. It may happen if we didn't see STT_GNU_IFUNC - symbol at the time when checking relocations. */ - if (info->shared - && !h->non_got_ref - && h->ref_regular) - for (p = *head; p != NULL; p = p->next) - if (p->count) - { - h->non_got_ref = 1; - goto keep; - } - h->got = htab->init_got_offset; h->plt = htab->init_plt_offset; *head = NULL; diff --git a/ld/testsuite/ld-ifunc/ifunc-20-i386.d b/ld/testsuite/ld-ifunc/ifunc-20-i386.d new file mode 100644 index 0000000..9373fcf --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-20-i386.d @@ -0,0 +1,13 @@ +#source: ifunc-20.s +#ld: -shared -m elf_i386 -z nocombreloc +#as: --32 +#readelf: -r --wide +#target: x86_64-*-* i?86-*-* + +Relocation section '.rel.ifunc' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_32[ ]+ifunc\(\)[ ]+ifunc + +Relocation section '.rel.plt' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_386_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc diff --git a/ld/testsuite/ld-ifunc/ifunc-20-x86-64.d b/ld/testsuite/ld-ifunc/ifunc-20-x86-64.d new file mode 100644 index 0000000..39492d4 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-20-x86-64.d @@ -0,0 +1,13 @@ +#source: ifunc-20.s +#ld: -shared -m elf_x86_64 -z nocombreloc +#as: --64 +#readelf: -r --wide +#target: x86_64-*-* + +Relocation section '.rela.ifunc' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_64[ ]+ifunc\(\)[ ]+ifunc \+ 0 + +Relocation section '.rela.plt' at offset 0x[0-9a-f]+ contains 1 entries: +[ ]+Offset[ ]+Info[ ]+Type[ ]+.* +[0-9a-f]+[ ]+[0-9a-f]+[ ]+R_X86_64_JUMP_SLOT[ ]+ifunc\(\)[ ]+ifunc \+ 0 diff --git a/ld/testsuite/ld-ifunc/ifunc-20.s b/ld/testsuite/ld-ifunc/ifunc-20.s new file mode 100644 index 0000000..9d45455 --- /dev/null +++ b/ld/testsuite/ld-ifunc/ifunc-20.s @@ -0,0 +1,16 @@ + .section .data.rel,"aw",@progbits + .globl ifunc_ptrt + .type ifunc_ptr, @object +ifunc_ptr: + .dc.a ifunc + .text + .type ifunc, @gnu_indirect_function + .globl ifunc +ifunc: + ret + .size ifunc, .-ifunc + .type bar, @function + .globl bar +bar: + call ifunc@PLT + .size bar, .-bar
2013-04-15 * Makefile.am (ELF_DEPS): Add a dependency uponNick Clifton3-4/+9
scripttempl/DWARF.sc. (ELF_GEN_DEPS): Likewise. * Makefile.in: Regenerate.
2013-04-15 * scripttempl/armbpabi.sc: Replace DWARF sections with anNick Clifton30-887/+187
inclusion of DWARF.sc. * scripttempl/avr.sc: Likewise. * scripttempl/elf.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/elfxgate.sc: Likewise. * scripttempl/elfxtensa.sc: Likewise. * scripttempl/epiphany_4x4.sc: Likewise. * scripttempl/i386beos.sc: Likewise. * scripttempl/i386go32.sc: Likewise. * scripttempl/ia64vms.sc: Likewise. * scripttempl/ip2k.sc: Likewise. * scripttempl/iq2000.sc: Likewise. * scripttempl/mep.sc: Likewise. * scripttempl/mmo.sc: Likewise. * scripttempl/v850.sc: Likewise. * scripttempl/v850_rh850.sc: Likewise. * scripttempl/xstormy16.sc: Likewise. * scripttempl/DWARF.sc: New.
2013-04-102013-04-10 Venkataramanan Kumar <venkataramanan.kumar@linaro.org>Marcus Shawcroft10-0/+138
* ld-aarch64/gc-plt1.s: New file. * ld-aarch64/gc-plt2.s: Likewise. * ld-aarch64/gc-plt-hidden.s: Likewise. * ld-aarch64/gc-plt-main.s: Likewise. * ld-aarch64/gc-relocs-257.s: Likewise. * ld-aarch64/gc-plt-relocs.d: Update expected objdump. * ld-aarch64/gc-relocs-257.d: Likewise. * ld-aarch64/gc-relocs-257-dyn.d: Likewise. * ld-aarch64/aarch64-elf.exp: Add test.
2013-04-08Handle big-endian for some aarch64 testsRamana Radhakrishnan3-2/+7
2013-04-08 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> * ld-aarch64/gc-tls-relocs.d: Handle big endian format. * ld-aarch64/gc-got-relocs.d: Likewise.
2013-04-04 * ld-elf/shared.exp: Update regexp on --no-add-needed andAlan Modra2-2/+7
--no-copy-dt-needed-entries tests.
2013-04-04 * ldlang.c (load_symbols): Report "error adding symbols" onAlan Modra4-5/+13
bfd_link_add_symbols failure. * emultempl/elf32.em (gld${EMULATION_NAME}_try_needed): Likewise. * emultempl/sunos.em (gld${EMULATION_NAME}_after_open): Likewise. (gld${EMULATION_NAME}_try_needed): Likewise.
2013-04-03 * elf64-aarch64.c (elf64_aarch64_gc_sweep_hook): UseNick Clifton11-1/+225
elf64_aarch64_locals to get local GOT reference counts. * ld-aarch64/gc-relocs-tlsle.s: New gc section test. * ld-aarch64/gc-relocs-tlsle.s: Likewise * ld-aarch64/gc-relocs-tlsgd.s: Likewise * ld-aarch64/gc-relocs-tlsdesc.s: Likewise * ld-aarch64/gc-relocs-312.s: Likewise * ld-aarch64/gc-relocs-311.s: Likewise * ld-aarch64/gc-relocs-309.s: Likewise * ld-aarch64/gc-start.s: Likewise * ld-aarch64/gc-got-relocs.d: Update expected objdump * ld-aarch64/gc-tls-relocs.d: Likewise * ld-aarch64/aarch64-elf.exp: add test
2013-04-03 PR ld/15227Alan Modra3-5/+11
* ld-plugin/lto.exp (PR ld/12942 (3)): Remove file name and line number from regexp. (PR ld/15146 (2)): Similarly. * ld-plugin/pr12942a.cc (main): Use __builtin_abort.
2013-03-30 PR ld/15323Alan Modra2-3/+9
bfd/ * elf-m10300.c (mn10300_elf_check_relocs): Set non_ir_ref for global symbols referenced by relocs. * elf32-arm.c (elf32_arm_check_relocs): Likewise. * elf32-bfin.c (bfin_check_relocs): Likewise. * elf32-cr16.c (cr16_elf_check_relocs): Likewise. * elf32-cris.c (cris_elf_check_relocs): Likewise. * elf32-d10v.c (elf32_d10v_check_relocs): Likewise. * elf32-dlx.c (elf32_dlx_check_relocs): Likewise. * elf32-fr30.c (fr30_elf_check_relocs): Likewise. * elf32-frv.c (elf32_frv_check_relocs): Likewise. * elf32-hppa.c (elf32_hppa_check_relocs): Likewise. * elf32-i370.c (i370_elf_check_relocs): Likewise. * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise. * elf32-lm32.c (lm32_elf_check_relocs): Likewise. * elf32-m32c.c (m32c_elf_check_relocs): Likewise. * elf32-m32r.c (m32r_elf_check_relocs): Likewise. * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise. * elf32-m68k.c (elf_m68k_check_relocs): Likewise. * elf32-mcore.c (mcore_elf_check_relocs): Likewise. * elf32-metag.c (elf_metag_check_relocs): Likewise. * elf32-microblaze.c (microblaze_elf_check_relocs): Likewise. * elf32-moxie.c (moxie_elf_check_relocs): Likewise. * elf32-msp430.c (elf32_msp430_check_relocs): Likewise. * elf32-mt.c (mt_elf_check_relocs): Likewise. * elf32-nios2.c (nios2_elf32_check_relocs): Likewise. * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise. * elf32-ppc.c (ppc_elf_check_relocs): Likewise. * elf32-rl78.c (rl78_elf_check_relocs): Likewise. * elf32-s390.c (elf_s390_check_relocs): Likewise. * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise. * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise. * elf32-sh.c (sh_elf_check_relocs): Likewise. * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise. * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise. * elf32-v850.c (v850_elf_check_relocs): Likewise. * elf32-vax.c (elf_vax_check_relocs): Likewise. * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise. * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise. * elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise. * elf64-alpha.c (elf64_alpha_check_relocs): Likewise. * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. * elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise. * elf64-mmix.c (mmix_elf_check_relocs): Likewise. * elf64-ppc.c (ppc64_elf_check_relocs): Likewise. * elf64-s390.c (elf_s390_check_relocs): Likewise. * elf64-sh64.c (sh_elf64_check_relocs): Likewise. * elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise. * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise. * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise. * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise. Don't test indirect/warning links for NULL. ld/testsuite/ * ld-plugin/lto.exp (pr15323a.c): Compile without -flto rather than using -r to effectively strip out lto info.
2013-03-30Set non_ir_ref if a symbol is referenced by a non-shared objectH.J. Lu5-1/+35
bfd/ PR ld/15323 * elf32-i386.c (elf_i386_check_relocs): Set non_ir_ref if a symbol is referenced by a non-shared object. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. ld/testsuite/ PR ld/15323 * ld-plugin/lto.exp (lto_link_tests): Add pr15323a-r.o. (lto_run_tests): Add a test for PR ld/15323. * ld-plugin/pr15323.out: New file. * ld-plugin/pr15323a.c: Likewise. * ld-plugin/pr15323b.c: Likewise.
2013-03-27 PR ld/13812Nick Clifton2-2/+10
* scripttempl/avr.sc: Place trampolines before .progmem section.
2013-03-25 * ld.texinfo (--disable-runtime-pseudo-reloc): Adjust default.Kai Tietz2-1/+5
2013-03-22 * ld-elf/init0.s: Add alloc attribute to .section directive.Nick Clifton11-10/+23
* ld-elf/fini1.s: Likewise. * ld-elf/fini2.s: Likewise. * ld-elf/fini3.s: Likewise. * ld-elf/finin.s: Likewise. * ld-elf/init0.s: Likewise. * ld-elf/init1.s: Likewise. * ld-elf/init2.s: Likewise. * ld-elf/init3.s: Likewise. * ld-elf/initn.s: Likewise.
2013-03-21 * elf32-h8300 (h8_relax_section): Add new relaxation of movNick Clifton9-6/+219
@(disp:32,ERx) to mov @(disp:16,ERx). (R_H8_DISP32A16): New reloc. Comments added and corrected. * reloc.c (BFD_RELOC_H8_DISP32A16): New reloc. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * ld.texinfo (H8/300): Add description of relaxation of mov @(disp:32,ERx) to mov @(disp:16,ERx). * ld-h8300/h8300.exp: Add new relax-7 test on ELF. * ld-h8300/relax-2.s: Add other direction and .w/.l variants of mov insns. * ld-h8300/relax-2.d: Update expected disassembly. * ld-h8300/relax-7a.s: New: tests for mov @(disp:32,ERx) -> mov @(disp:16,ERx). * ld-h8300/relax-7b.s: New: Likewise. * ld-h8300/relax-7.d: New: expected disassembly. * config/tc-h8300.c (do_a_fix_imm): Add relaxation of mov @(disp:32,ERx) to mov @(disp:16,ERx) insns by new reloc R_H8_DISP32A16. * config/tc-h8300.h: Remove duplicated defines.
2013-03-21 * pe-dll.c (process_def_file_and_drectve): Don't handle VCKai Tietz2-2/+10
generated C++-symbols as stdcall/fastcall.
2013-03-20Enable --gc-sections test cases for aarch64*-*-*Marcus Shawcroft9-8/+19
2013-03-20ld/testsuite/ChangeLog:Will Newton7-7/+17
2013-03-20 Will Newton <will.newton@linaro.org> * ld-elfvers/vers.exp (objdump_symstuff): Sort objdump output based on the symbol name rather than address. * ld-elfvers/vers1.sym: Reorder contents to match changes to vers.exp. * ld-elfvers/vers15.sym: Likewise. * ld-elfvers/vers18.sym: Likewise. * ld-elfvers/vers21.sym: Likewise. * ld-elfvers/vers9.sym: Likewise.
2013-03-20bfd/Alan Modra5-0/+27
* elflink.c (_bfd_elf_make_dynamic_reloc_section): Override sh_type according to is_rela. ld/testsuite/ * ld-elf/rel.c, ld-elf/relmain.c, ld-elf/relmain.out: New test. * ld-elf/shared.exp: Build and run it.
2013-03-20 * ld-elfvers/vers.exp: Add -Wl,--no-as-needed to all testsAlan Modra3-16/+24
linking against shared libraries. * ld-elfweak/elfweak.exp: Likewise. Enable for x86_64-linux. Build main1.o using $picflag.
2013-03-18 PR ld/12549Alan Modra4-6/+16
bfd/ * elflink.c (elf_link_add_object_symbols): Exclude weak refs when considering whether an --as-needed library is needed. ld/ * ld.texinfo (--as-needed): Update. ld/testsuite/ * ld-elf/pr14862.out: Expect no output.
2013-03-15gas/testsuite/ChangeLog:Will Newton5-6/+13
2013-03-15 Will Newton <will.newton@linaro.org> * gas/arm/any-idiv.d: Expand *-*eabi test to cover *-*eabi*. * gas/arm/arch4t-eabi.d: Likewise. * gas/arm/arch4t.d: Likewise. * gas/arm/attr-any-armv4t.d: Likewise. * gas/arm/attr-any-thumbv6.d: Likewise. * gas/arm/attr-cpu-directive.d: Likewise. * gas/arm/attr-default.d: Likewise. * gas/arm/attr-march-all.d: Likewise. * gas/arm/attr-march-armv1.d: Likewise. * gas/arm/attr-march-armv2.d: Likewise. * gas/arm/attr-march-armv2a.d: Likewise. * gas/arm/attr-march-armv2s.d: Likewise. * gas/arm/attr-march-armv3.d: Likewise. * gas/arm/attr-march-armv3m.d: Likewise. * gas/arm/attr-march-armv4.d: Likewise. * gas/arm/attr-march-armv4t.d: Likewise. * gas/arm/attr-march-armv4txm.d: Likewise. * gas/arm/attr-march-armv4xm.d: Likewise. * gas/arm/attr-march-armv5.d: Likewise. * gas/arm/attr-march-armv5t.d: Likewise. * gas/arm/attr-march-armv5te.d: Likewise. * gas/arm/attr-march-armv5tej.d: Likewise. * gas/arm/attr-march-armv5texp.d: Likewise. * gas/arm/attr-march-armv5txm.d: Likewise. * gas/arm/attr-march-armv6-m+os.d: Likewise. * gas/arm/attr-march-armv6-m.d: Likewise. * gas/arm/attr-march-armv6.d: Likewise. * gas/arm/attr-march-armv6j.d: Likewise. * gas/arm/attr-march-armv6k+sec.d: Likewise. * gas/arm/attr-march-armv6k.d: Likewise. * gas/arm/attr-march-armv6kt2.d: Likewise. * gas/arm/attr-march-armv6s-m.d: Likewise. * gas/arm/attr-march-armv6t2.d: Likewise. * gas/arm/attr-march-armv6z.d: Likewise. * gas/arm/attr-march-armv6zk.d: Likewise. * gas/arm/attr-march-armv6zkt2.d: Likewise. * gas/arm/attr-march-armv6zt2.d: Likewise. * gas/arm/attr-march-armv7-a+idiv.d: Likewise. * gas/arm/attr-march-armv7-a+mp.d: Likewise. * gas/arm/attr-march-armv7-a+sec+virt.d: Likewise. * gas/arm/attr-march-armv7-a+sec.d: Likewise. * gas/arm/attr-march-armv7-a+virt.d: Likewise. * gas/arm/attr-march-armv7-a.d: Likewise. * gas/arm/attr-march-armv7-m.d: Likewise. * gas/arm/attr-march-armv7-r+mp.d: Likewise. * gas/arm/attr-march-armv7-r.d: Likewise. * gas/arm/attr-march-armv7.d: Likewise. * gas/arm/attr-march-armv7a.d: Likewise. * gas/arm/attr-march-armv7em.d: Likewise. * gas/arm/attr-march-armv7m.d: Likewise. * gas/arm/attr-march-armv7r.d: Likewise. * gas/arm/attr-march-armv8-a+crypto.d: Likewise. * gas/arm/attr-march-armv8-a+fp.d: Likewise. * gas/arm/attr-march-armv8-a+simd.d: Likewise. * gas/arm/attr-march-armv8-a.d: Likewise. * gas/arm/attr-march-iwmmxt.d: Likewise. * gas/arm/attr-march-iwmmxt2.d: Likewise. * gas/arm/attr-march-xscale.d: Likewise. * gas/arm/attr-mcpu.d: Likewise. * gas/arm/attr-mfpu-arm1020e.d: Likewise. * gas/arm/attr-mfpu-arm1020t.d: Likewise. * gas/arm/attr-mfpu-arm1136jf-s.d: Likewise. * gas/arm/attr-mfpu-arm1136jfs.d: Likewise. * gas/arm/attr-mfpu-arm7500fe.d: Likewise. * gas/arm/attr-mfpu-fpa.d: Likewise. * gas/arm/attr-mfpu-fpa10.d: Likewise. * gas/arm/attr-mfpu-fpa11.d: Likewise. * gas/arm/attr-mfpu-fpe.d: Likewise. * gas/arm/attr-mfpu-fpe2.d: Likewise. * gas/arm/attr-mfpu-fpe3.d: Likewise. * gas/arm/attr-mfpu-maverick.d: Likewise. * gas/arm/attr-mfpu-neon-fp16.d: Likewise. * gas/arm/attr-mfpu-neon.d: Likewise. * gas/arm/attr-mfpu-softfpa.d: Likewise. * gas/arm/attr-mfpu-softvfp+vfp.d: Likewise. * gas/arm/attr-mfpu-softvfp.d: Likewise. * gas/arm/attr-mfpu-vfp.d: Likewise. * gas/arm/attr-mfpu-vfp10-r0.d: Likewise. * gas/arm/attr-mfpu-vfp10.d: Likewise. * gas/arm/attr-mfpu-vfp3.d: Likewise. * gas/arm/attr-mfpu-vfp9.d: Likewise. * gas/arm/attr-mfpu-vfpv2.d: Likewise. * gas/arm/attr-mfpu-vfpv3-d16.d: Likewise. * gas/arm/attr-mfpu-vfpv3.d: Likewise. * gas/arm/attr-mfpu-vfpv4-d16.d: Likewise. * gas/arm/attr-mfpu-vfpv4.d: Likewise. * gas/arm/attr-mfpu-vfpxd.d: Likewise. * gas/arm/attr-names.d: Likewise. * gas/arm/attr-order.d: Likewise. * gas/arm/attr-override-cpu-directive.d: Likewise. * gas/arm/attr-override-mcpu.d: Likewise. * gas/arm/got_prel.d: Likewise. * gas/arm/mapdir.d: Likewise. * gas/arm/mapmisc.d: Likewise. * gas/arm/mapsecs.d: Likewise. * gas/arm/mapshort-eabi.d: Likewise. * gas/arm/mapshort-elf.d: Likewise. * gas/arm/mov-highregs-any.d: Likewise. * gas/arm/mov-lowregs-any.d: Likewise. * gas/arm/pr12198-1.d: Likewise. * gas/arm/pr12198-2.d: Likewise. * gas/arm/thumb-eabi.d: Likewise. * gas/arm/thumb.d: Likewise. * gas/arm/thumbrel.d: Likewise. ld/testsuite/ChangeLog: 2013-03-15 Will Newton <will.newton@linaro.org> * ld-arm/arm-elf.exp: Expand *-*eabi test to cover *-*eabi*. * ld-arm/gc-hidden-1.d: Likewise. * ld-elfvsb/elfvsb.exp: Likewise. * ld-shared/shared.exp: Likewise.
2013-03-14 * emulparams/aarch64linux.sh (LIBPATH_SUFFIX): Set to 64 forJakub Jelinek2-0/+15
aarch64linux* emulations.
2013-03-08 * elf64-aarch64.c (elf_backend_can_gc_sections): EnableNick Clifton2-19/+21
gc-section support. (elf64_aarch64_gc_sweep_hook): Handle GOT, TLS and PLT related relocs. * lib/ld-lib.exp (check_gc_sections_available): Remove aarch64 from list of targets that don't support gc-section.
2013-03-06 * ldfile.c (ldfile_open_command_file_1): Return after einfoAlan Modra2-0/+6
to avoid warning.
2013-03-05 * configure.host: Add x86_64-*-cygwin* as valid host.Corinna Vinschen4-4/+56
* configure.tgt: Add x86_64-*-cygwin* as valid target. * emultempl/pep.em: Handle different requirements for Cygwin in terms of start addresses for executables and DLLs, based on memory model in http://cygwin.com/ml/cygwin-developers/2013-02/msg00027.html
2013-03-05 PR ld/15222Alan Modra8-0/+65
ld/ * ldlang.c (lang_size_sections_1): When given an lma_region align LMA as per VMA only if lma_region is the same as region. ld/testsuite/ * ld-scripts/rgn-at6.s, * ld-scripts/rgn-at6.t, * ld-scripts/rgn-at6.d, * ld-scripts/rgn-at7.t, * ld-scripts/rgn-at7.d: New tests.
2013-02-28 bfd/Julian Brown4-1/+36
* elf32-arm.c (elf32_arm_size_dynamic_sections): Don't call elf32_arm_allocate_dynrelocs for source reloc for non-dynamic link. ld/testsuite/ * ld-arm/tls-local-static.s: New test. * ld-arm/tls-local-static.d: New. * ld-arm/arm-elf.exp (tls-local-static): Add test.
2013-02-27 * scripttempl/elf32msp430.sc: Add placement of .data.* sections.Nick Clifton3-1/+11
Add alignment of .bss section. * scripttempl/elf32msp430_3.sc: Likewise.
2013-02-26 PR ld/15188Nick Clifton2-16/+14
* ld.texinfo: Fix typos.
2013-02-22Set unique_global only for definitionH.J. Lu2-0/+24
bfd/ PR ld/15167 * elf64-ia64-vms.c (elf64_vms_link_add_object_symbols): Set unique_global only for definition. * elflink.c (_bfd_elf_merge_symbol): Don't set unique_global here. (elf_link_add_object_symbols): Set unique_global only for definition. ld/testsuite/ PR ld/15167 * ld-unique/unique.exp: Add a test for shared library with reference.
2013-02-21 * scripttempl/elf.sc (.init_array, .fini_array): Don't sort allAlan Modra2-6/+11
.init_array/.fini_array input sections before .ctors/.dtors input sections. (CTORS_IN_INIT_ARRAY, DTORS_IN_INIT_ARRAY): Adjust to suit.
2013-02-21bfd/Alan Modra2-13/+13
* elf-bfd.h (struct elf_build_id): Extracted from.. (struct elf_build_id_info): ..here. Delete. (struct output_elf_obj_tdata): New, extracted from.. (struct elf_obj_tdata): ..here. Reorganize for better packing. Add "o" field. (elf_program_header_size): Reference tdata->o. (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker, elf_stack_flags, elf_shstrtab, elf_strtab_sec, elf_shstrtab_sec, elf_section_syms, elf_num_section_syms, elf_flags_init): Likewise. * elf.c (bfd_elf_allocate_object): Allocate output_elf_obj_tdata when opening bfd in any mode that might write. (_bfd_elf_write_object_contents): Use build_id field in output_elf_obj_tdata. (_bfd_elf_close_and_cleanup): Tweak elf_shstrtab test. (elfobj_grok_gnu_build_id): Adjust for elf_tdata changes. gdb/ * elfread.c (build_id_bfd_get): Adjust for elf_tdata changes. ld/ * emultempl/elf32.em (write_build_id, setup_build_id): Adjust for elf_tdata changes.
2013-02-21bfd/Alan Modra2-7/+10
* elf-bfd.h (struct elf_obj_tdata): Rename segment_map to seg_map. Delete num_locals and num_globals. (elf_num_locals, elf_num_globals): Don't define. (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker, elf_stack_flags, elf_strtab_sec, elf_shstrtab_sec): Define. * bfd.c, * elf-eh-frame.c, * elf-nacl.c, * elf-vxworks.c, * elf.c, * elf32-arm.c, * elf32-lm32.c, * elf32-ppc.c, * elf32-rx.c, * elf32-spu.c, * elf64-hppa.c, * elfcode.h, * elflink.c, * elfnn-ia64.c, * elfxx-mips.c: Use newly defined elf_obj_tdata accessor macros. * elf.c (elf_map_symbols): Add pnum_locals param. Return number of locals syms via new param. (swap_out_syms): Adjust to suit elf_map_symbols change. ld/ * emultempl/elf-generic.em: Use newly defined elf_obj_tdata accessor macros.
2013-02-20 * Makefile.am: Use $(ELF_DEPS) on a number of eelf*.c rules.Alan Modra3-40/+43
* Makefile.in: Regenerate.
2013-02-192013-02-19 Sandra Loosemore <sandra@codesourcery.com>Sandra Loosemore2-1/+8
PR ld/15146 ld/ * plugin.c (plugin_notice): Add null check before dereferencing pointer.
2013-02-19 * lib/ld-lib.exp (run_ld_link_tests): Add another argument, passMaciej W. Rozycki43-560/+613
its contents to ar_simple_create and ld_simple_link after objfiles. * ld-aarch64/aarch64-elf.exp: Adjust accordingly. * ld-alpha/alpha.exp: Likewise. * ld-arm/arm-elf.exp: Likewise. * ld-arm/export-class.exp: Likewise. * ld-elf/comm-data.exp: Likewise. * ld-elf/eh-group.exp: Likewise. * ld-elf/elf.exp: Likewise. * ld-elf/export-class.exp: Likewise. * ld-elfvers/vers.exp: Likewise. * ld-frv/tls.exp: Likewise. * ld-i386/export-class.exp: Likewise. * ld-i386/i386.exp: Likewise. * ld-ia64/ia64.exp: Likewise. * ld-libs/libs.exp: Likewise. * ld-m68k/m68k.exp: Likewise. * ld-metag/metag.exp: Likewise. * ld-mips-elf/comm-data.exp: Likewise. * ld-mips-elf/export-class.exp: Likewise. * ld-mips-elf/mips-elf.exp: Likewise. * ld-mn10300/mn10300.exp: Likewise. * ld-pe/pe-compile.exp: Likewise. * ld-pe/pe.exp: Likewise. * ld-plugin/plugin.exp: Likewise. * ld-powerpc/aix52.exp: Likewise. * ld-powerpc/export-class.exp: Likewise. * ld-powerpc/powerpc.exp: Likewise. * ld-s390/s390.exp: Likewise. * ld-sh/sh-vxworks.exp: Likewise. * ld-sh/sh64/sh64.exp: Likewise. * ld-sparc/sparc.exp: Likewise. * ld-tic6x/tic6x.exp: Likewise. * ld-tilegx/tilegx.exp: Likewise. * ld-tilepro/tilepro.exp: Likewise. * ld-undefined/entry.exp: Likewise. * ld-vax-elf/vax-elf.exp: Likewise. * ld-x86-64/dwarfreloc.exp: Likewise. * ld-x86-64/export-class.exp: Likewise. * ld-x86-64/x86-64.exp: Likewise. * ld-xc16x/xc16x.exp: Likewise. * ld-xstormy16/xstormy16.exp: Likewise. * ld-xtensa/xtensa.exp: Likewise.