aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2013-05-01daily updateAlan Modra1-1/+1
2013-04-30 PR binutils/15417Nick Clifton2-1/+7
* elflink.c (elf_link_add_object_symbols): Initialise 'idx' to zero.
2013-04-30 * elflink.c (bfd_elf_record_link_assignment): Dont makeAlan Modra2-1/+7
STV_INTERNAL symbols STV_HIDDEN.
2013-04-30daily updateAlan Modra1-1/+1
2013-04-29 * elflink.c (_bfd_elf_gc_mark_extra_sections): Remove mark fromNick Clifton2-4/+56
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 Newton2-2/+12
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-29 * elf64-aarch64.c (elf64_aarch64_check_relocs): Move relocationNick Clifton2-6/+13
error check up and add error message.
2013-04-29daily updateAlan Modra1-1/+1
2013-04-28daily updateAlan Modra1-1/+1
2013-04-27daily updateAlan Modra1-1/+1
2013-04-26Remove some dead code from elf64_aarch64_check_relocs.Will Newton2-15/+5
bfd/ChangeLog: 2013-04-25 Will Newton <will.newton@linaro.org> * elf64-aarch64.c (elf64_aarch64_check_relocs): Remove dead code.
2013-04-26daily updateAlan Modra1-1/+1
2013-04-25bfd/Alan Modra2-1/+6
* 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-25daily updateAlan Modra1-1/+1
2013-04-24Enable x32 for x86_64-*-elf*H.J. Lu2-1/+6
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-24bfd/Roland McGrath2-1460/+1503
* elf32-arm.c (elf32_arm_allocate_plt_entry): If HTAB->nacl_p, allocate space for PLT header even if IS_IPLT_ENTRY. (arm_nacl_put_plt0): New function, broken out of ... (elf32_arm_finish_dynamic_sections): ... here. Call it. If HTAB->nacl_p, set up the PLT header in .iplt too. (elf32_arm_output_arch_local_syms): If HTAB->nacl_p, write a mapping symbol for the start of .iplt too.
2013-04-24oops - revert accidental commitNick Clifton1-38/+0
2013-04-24*** empty log message ***Nick Clifton1-4/+7
2013-04-24 * ecoff.c: casting the return value of BFD_ALIGN to intNick Clifton6-13/+51
* elf32-tic6x.c: removing unused variables * elf32-v850.c: redefine the type of a variable (int -> bfd_vma) * vms-alpha.c: initialize a variable
2013-04-24daily updateAlan Modra1-1/+1
2013-04-23daily updateAlan Modra1-1/+1
2013-04-22 PR ld/15382Alan Modra2-4/+10
* elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Don't multiply sh_size or reloc_count adjustment by count.
2013-04-22bfd/Alan Modra3-89/+94
* 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-22daily updateAlan Modra1-1/+1
2013-04-21daily updateAlan Modra1-1/+1
2013-04-20daily updateAlan Modra1-1/+1
2013-04-19 PR binutils/15356Nick Clifton1-0/+6
* compress.c (decompress_contents): Always call inflateEnd, even when another inflation operation fails. [Note - the actual patch to compress.c was accidentally committed previously].
2013-04-19daily updateAlan Modra1-1/+1
2013-04-18daily updateAlan Modra1-1/+1
2013-04-17Update copyright year on elf-ifunc.cH.J. Lu2-1/+5
* elf-ifunc.c: Update copyright year.
2013-04-17 * coffcode.h: Added a cast to void when a bfd_set_section_*()Nick Clifton13-56/+69
macro's return value is ignored. * elf32-hppa.c: Likewise. * elf32-tic6x.c: Likewise. * mach-o.c: Likewise. * mmo.c: Likewise. * opncls.c: Likewise. * peicode.h: Likewise. * elf32-m32r.c: Check return value of bfd_set_section_*(). * elfnn-ia64.c: Likewise. * elfxx-mips.c: Likewise. * vms-alpha.c: Likewise.
2013-04-17daily updateAlan Modra1-1/+1
2013-04-16daily updateAlan Modra1-1/+1
2013-04-15Check regular reference without non-GOT referenceH.J. Lu2-14/+18
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 ($(MKDOC)): Append $(EXEEXT_FOR_BUILD) to temp file.Alan Modra3-6/+11
* Makefile.in: Regenerate.
2013-04-15 * archive.c (_bfd_archive_close_and_cleanup): Clear parentAlan Modra2-5/+10
cache slot for archives.
2013-04-15daily updateAlan Modra1-1/+1
2013-04-14 * mmo.c (mmo_write_chunk): Break out abfd->tdata.mmo_data to newHans-Peter Nilsson2-11/+16
local variable mmop.
2013-04-14daily updateAlan Modra1-1/+1
2013-04-13daily updateAlan Modra1-1/+1
2013-04-12daily updateAlan Modra1-1/+1
2013-04-11daily updateAlan Modra1-1/+1
2013-04-10daily updateAlan Modra1-1/+1
2013-04-09 PR ld/12494Nick Clifton2-74/+83
* bfd/elf32-avr.c: Consider all sections to determine if linker relaxation can safely delete a ret after a call/jmp
2013-04-09 * bfd.c (typedef bfd, Error reporting, Miscellaneous): Add INODEs.Nick Clifton4-13/+30
* bfd.texinfo (typedef bfd, Error reporting, Miscellaneous): Add menu items.
2013-04-09daily updateAlan Modra1-1/+1
2013-04-08 PR symtab/8423:Tom Tromey3-3/+9
* solib-som.c (som_solib_section_offsets): Use BFD section indices. Set offsets for all sections. * somread.c (som_symtab_read): Compute BFD section for symbol. Use prim_record_minimal_symbol_and_info. (som_symfile_read): Fix comment. (struct find_section_offset_arg): New. (find_section_offset, set_section_index): New functions. (som_symfile_offsets): Use set_section_index to compute section indices. bfd/ * som.c (bfd_section_from_som_symbol): No longer static. * som.h (bfd_section_from_som_symbol): Declare.
2013-04-08daily updateAlan Modra1-1/+1
2013-04-07daily updateAlan Modra1-1/+1
2013-04-06 * elf32-ppc.c (ppc_elf_check_relocs): Use SYMBOLIC_BIND.Alan Modra3-3/+8
* elf64-ppc.c (ppc64_elf_check_relocs, dec_dynrel_count): Likewise.