aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2014-06-18daily updateAlan Modra1-1/+1
2014-06-17daily updateAlan Modra1-1/+1
2014-06-16ld/ARM: Fix IFUNC and TLS descriptors in the same shared objectWill Newton2-3/+14
Combining TLS descriptors and GNU indirect functions in the same object could lead to assertions or multiple dynamic relocations for the same GOT slot. Fix the bookkeeping so this doesn't happen. This allows building and make checking glibc with -mtls-dialect=gnu2. bfd/ChangeLog: 2014-06-16 Will Newton <will.newton@linaro.org> * elf32-arm.c (elf32_arm_allocate_plt_entry): Increment htab->next_tls_desc_index in the non-IPLT case. Calculate GOT offset correctly for the non-IPLT case. (allocate_dynrelocs_for_symbol): Don't increment htab->next_tls_desc_index here. ld/testsuite/ChangeLog: 2014-06-16 Will Newton <will.newton@linaro.org> * ld-arm/arm-elf.exp: Add ifunc-gdesc test. * ld-arm/ifunc-gdesc.r: New file. * ld-arm/ifunc-gdesc.s: Likewise. * ld-arm/ifunc-gdesc.ver: Likewise.
2014-06-16Fix uninitialised VAX .got and .got.plt sectionAlan Modra2-1/+6
Cures these failures with MALLOC_PERTURB_=1 FAIL: GOT test (executable) FAIL: GOT test (shared library) FAIL: VAX export class call relocation test FAIL: VAX export class data relocation test * elf32-vax.c (elf_vax_size_dynamic_sections): Clear linker created sections.
2014-06-16daily updateAlan Modra1-1/+1
2014-06-15daily updateAlan Modra1-1/+1
2014-06-14daily updateAlan Modra1-1/+1
2014-06-13Add support for reading Aarch64 core dumps.Omair Javaid3-2/+100
* elfxx-aarch64.c (stdarg.h): Include. (string.h): Include. (_bfd_aarch64_elf_grok_prstatus): Updated. (_bfd_aarch64_elf_grok_psinfo): New function. (_bfd_aarch64_elf_write_core_note): New function. * elfxx-aarch64.h (elf_backend_grok_psinfo): Define. (elf_backend_write_core_note): Define.
2014-06-13Free linker hash table from bfd_close.Alan Modra33-129/+231
Also tidies numerous error exit paths in various link_hash_table_create functions that failed to free memory. include/ * bfdlink.h (struct bfd_link_hash_table): Add hash_table_free field. bfd/ * archive.c: Include bfdlink.h. (_bfd_archive_close_and_cleanup): Call linker hash_table_free. * bfd.c (struct bfd): Add is_linker_output field. * elf-bfd.h (_bfd_elf_link_hash_table_free): Update prototype. * linker.c (_bfd_link_hash_table_init): Set up hash_table_free, link.hash and is_linker_output. (_bfd_generic_link_hash_table_free): Replace bfd_link_hash_table* param with bfd*. Assert is_linker_output and link.hash, and clear them before exit. * elf-m10300.c (elf32_mn10300_link_hash_table_free): Replace bfd_link_hash_table* param with bfd*. Hack is_linker_output and link.hash so we can free two linker hash tables. (elf32_mn10300_link_hash_table_create): Create static_hash_table first. Clean up on errors. Set hash_table_free pointer. * elf32-arm.c (elf32_arm_link_hash_table_free): Replace bfd_link_hash_table* param with bfd*. (elf32_arm_link_hash_table_create): Clean up on errors. Set hash_table_free pointer. * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, * elf32-xgate.c, * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c, * xcofflink.c: Similarly. * simple.c (bfd_simple_get_relocated_section_contents): Save and clear link.next before creating linker hash table. Clean up on errors, and restore link.next on exit. * elf32-m68hc1x.h (m68hc11_elf_bfd_link_hash_table_free): Delete. * elf32-xgate.h (xgate_elf_bfd_link_hash_table_free): Delete. * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table_free): Delete. * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Delete. * hash.c (bfd_hash_table_init_n): Free table on error. * libbfd-in.h (_bfd_generic_link_hash_table_free): Update proto. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * libcoff.h: Regenerate.
2014-06-13Don't call bfd_link_hash_table_freeAlan Modra51-92/+35
Freeing the linker hash table is a royal pain. It can't be freed before the _bfd_write_contents call in bfd_close, because some target bfd_write_contents functions access the hash table. It can't be freed after bfd_close either, since bfd_alloc memory holding side data structures disappears (PR17047). Clearly the only place it can be freed is actually in bfd_close. This patch doesn't do that, but kills off the existing means of freeing the hash table via a bfd target xvec call. bfd/ PR 17047 * targets.c (BFD_JUMP_TABLE): Delete NAME##_bfd_link_hash_table_free. (struct bfd_target <_bfd_link_hash_table_free>): Delete. * bfd.c (bfd_link_hash_table_free): Don't define. * aout-adobe.c, * aout-target.h, * aout-tic30.c, * binary.c, * bout.c, * coff64-rs6000.c, * coffcode.h, * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, * elf32-sparc.c, * elf32-xgate.c, * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-sparc.c, * elf64-x86-64.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-target.h, * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * libbfd-in.h, * libecoff.h, * mach-o-target.c, * mmo.c, * nlm-target.h, * oasys.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c, * tekhex.c, * verilog.c, * versados.c, * vms-alpha.c, * xsym.c: Don't define various link_hash_table_free defines, and remove from bfd_target vars. Temporarily reference some of the target link_hash_table_free functions to avoid warnings. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. ld/ PR 17047 * ldlang.c (output_bfd_hash_table_free_fn): Delete. (open_output): Don't set it.. * ldmain.c (ld_cleanup): ..or call it.
2014-06-13Move link_hash_table_free functions earlierAlan Modra17-272/+281
Move some code around, in preparation for a followup patch. * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-m68hc1x.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c, * elf64-ia64-vms.c, * elf64-ppc.c, * elf64-x86-64.c, * elfnn-aarch64.c, * elfnn-ia64.c, * elfxx-sparc.c, * xcofflink.c: Move link_hash_table_free functions before their corresponding link_hash_table_create functions.
2014-06-13Make bfd.link_next field a unionAlan Modra52-152/+178
This field of struct bfd is currently only used to chain together linker input files. This patch prepares to use the field to stash the linker hash table, which is always created on the linker output file. bfd/ * bfd.c (struct bfd): Replace link_next with a union. * aoutx.h, * bfd.c, * coff-ppc.c, * coff-rs6000.c, * cofflink.c, * ecoff.c, * elf-m10300.c, * elf32-arm.c, * elf32-avr.c, * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c, * elf32-m32c.c, * elf32-m32r.c, * elf32-m68hc1x.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-nds32.c, * elf32-nios2.c, * elf32-or1k.c, * elf32-ppc.c, * elf32-rl78.c, * elf32-s390.c, * elf32-score.c, * elf32-score7.c, * elf32-sh.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilepro.c, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c, * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mmix.c, * elf64-ppc.c, * elf64-s390.c, * elf64-x86-64.c, * elflink.c, * elfnn-aarch64.c, * elfxx-mips.c, * elfxx-sparc.c, * elfxx-tilegx.c, * linker.c, * pdp11.c, * peXXigen.c, * simple.c, * sunos.c, * vms-alpha.c, * xcofflink.c: Update for above. * bfd-in2.h: Regenerate. include/ * bfdlink.h: Update for bfd.link_next change. ld/ * emultempl/cr16elf.em, * emultempl/elf32.em, * emultempl/genelf.em, * emultempl/m68kcoff.em, * emultempl/m68kelf.em, * emultempl/nds32elf.em, * emultempl/pe.em, * emultempl/pep.em, * ldlang.c, * ldmain.c, * pe-dll.c: Update for bfd.link_next change.
2014-06-13daily updateAlan Modra1-1/+1
2014-06-12daily updateAlan Modra1-1/+1
2014-06-11Fix silly thinkoAlan Modra2-1/+5
* linker.c (unwrap_hash_lookup): Add missing parens.
2014-06-11 * libcoff-in.h (coff_tdata): Make relocbase member unsigned.Kai Tietz1-0/+5
* libcoff.h: Regenerated.
2014-06-11 * libcoff-in.h (coff_tdata): Make relocbase member unsigned.Kai Tietz2-2/+2
* libcoff.h: Regenerated.
2014-06-11daily updateAlan Modra1-1/+1
2014-06-10add pr number to changelogAlan Modra1-0/+1
2014-06-10missing changelog entries for 8a5da09b9Alan Modra1-0/+12
2014-06-10Unwrap symbols for debug informationAlan Modra9-2/+80
Fixes issues with dwz multi-file (-m) and ld's -wrap option. Symbols referenced from DWARF debug info in a separate file, eg. to specify low and high pc, must use the real symbol. The DWARF info is specifying attributes of the real function, not one interposed with --wrap. include/ * bfdlink.h (unwrap_hash_lookup): Declare. bfd/ * linker.c (unwrap_hash_lookup): New function. * elf-bfd (RELOC_FOR_GLOBAL_SYMBOL): Call unwrap_hash_lookup. * elf32-i370.c (i370_elf_relocate_section): Likewise. * elf32-m32c.c (m32c_elf_relocate_section): Likewise. * elf32-m32r.c (m32r_elf_relocate_section): Likewise. * elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise. * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise. * elf32-spu.c (spu_elf_relocate_section): Likewise. * elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
2014-06-10daily updateAlan Modra1-1/+1
2014-06-09daily updateAlan Modra1-1/+1
2014-06-08daily updateAlan Modra1-1/+1
2014-06-07Allow both signed and unsigned fields in PowerPC cmpli insnAlan Modra3-12/+20
There are legitimate reasons to allow a signed value in a cmpli insn field, for example to test for a "stw r1,lock@sdarel(r13)" instruction in user code, a kernel might use subis r3,r3,STW_R1_0R13@ha # subtract off high part cmplwi r3,lock@sdarel # is low part accessing lock? Since the lock@sdarel may take a range of -32768 to 32767, the allowed range of cmpli immediate must be at least [-32768,65535]. bfd/ * elf32-ppc.c (ppc_elf_relocate_section): Treat field of cmpli insn as a bitfield; Use complain_overflow_bitfield. * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. opcodes/ * ppc-opc.c (UISIGNOPT): Define and use with cmpli. gas/ * config/tc-ppc.c (ppc_insert_operand): Handle PPC_OPERAND_SIGNOPT on unsigned fields. Comment on PPC_OPERAND_SIGNOPT signed fields in 64-bit mode. gold/ * powerpc.cc (relocate): Treat field of cmpli insn as a bitfield.
2014-06-07daily updateAlan Modra1-1/+1
2014-06-06daily updateAlan Modra1-1/+1
2014-06-05Make it easy to make --disable-werror the default for both binutils and gdbJoel Brobecker6-6/+42
The goal of this patch is to provide an easy way to make --disable-werror the default when building binutils, or the parts of binutils that need to get built when building GDB. In development mode, we want to continue making -Werror the default with GCC. But, when making releases, I think we want to make it as easy as possible for regular users to successfully build from sources. GDB already has this kind of feature to turn -Werror as well as the use of the libmcheck library. As GDB Release Manager, I take advantage of it to turn those off after having cut the branch. I'd like to be able to do the same for the binutils bits. And perhaps Tristan will want to do the same for his releases too (not sure, binutils builders might be a little savvier than GDB builders). This patch introduces a new file, called development.sh, which just sets a variable called $development. In our development branches (Eg. "master"), it's set to true. But setting it to false would allow us to change the default behavior of various development-related features to be turned off; in this case, it turns off the use of -Werror by default (use --enable-werror to turn it back on). bfd/ChangeLog: * development.sh: New file. * warning.m4 (AM_BINUTILS_WARNINGS): Source bfd/development.sh. Make -Werror the default with GCC only if DEVELOPMENT is true. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add $(srcdir)/development.sh. * Makefile.in, configure: Regenerate. binutils/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gas/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gold/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): New. * Makefile.in, configure: Regenerate. gprof/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. ld/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. opcodes/ChangeLog: * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on bfd's development.sh. * Makefile.in, configure: Regenerate. gdb/ChangeLog: * development.sh: Delete. * Makefile.in (config.status): Adjust dependency on development.sh. * configure.ac: Adjust development.sh source call. * configure: Regenerate. gdb/gdbserver/ChangeLog: * configure.ac: Adjust development.sh source call. * Makefile.in (config.status): Adjust dependency on development.sh. * configure: Regenerate. Tested on x86_64-linux by building two ways: One with DEVELOPMENT set to true, and one with DEVELOPMENT set to false. In the first case, I could see the use of -Werror, while it disappeared in the second case.
2014-06-05daily updateAlan Modra1-1/+1
2014-06-04bfd/elfnn-aarch64.c: Cleanup a couple of TLS functionsWill Newton2-3/+7
Add an assert and remove an unused line of code. bfd/ChangeLog: 2014-06-04 Will Newton <will.newton@linaro.org> * elfnn-aarch64.c (tpoff_base): Make test of tls_sec being non-NULL into an assert. (elfNN_aarch64_tls_relax): Remove unused code.
2014-06-04daily updateAlan Modra1-1/+1
2014-06-03* elf32-rx.c (rx_table_map): Use BFD_VMA_FMT for portability.DJ Delorie2-6/+10
2014-06-03This is to fix a further problem with merging resource sections. It turnsNick Clifton2-2/+36
out that the section is supposed to be page-aligned, but the newly merged section was not being padded out to a page boundary. This meant that when the executable was stripped a badly sized .rsrc section was written out. PR ld/16807 * peXXigen.c (rsrc_process_section): Page align the new contents befgore writing out.
2014-06-03Support fusion for ELFv2 stubsAlan Modra2-6/+21
Power8 fuses addis,addi and addis,ld sequences when the target of the addis is the same as the addi/ld. Thus addis r12,r2,xxx@ha addi r12,r12,xxx@l / ld r12,xxx@l(r12) is faster than addis r11,r2,xxx@ha addi r12,r11,xxx@l / ld r12,xxx@l(r11) So use the form that allows fusion in plt call and branch stubs. bfd/ * elf64-ppc.c (ADDIS_R12_R2): Define. (build_plt_stub): Support fusion on ELFv2 stub. (ppc_build_one_stub): Likewise for plt branch stubs. gold/ * powerpc.cc (addis_12_2): Define. (Stub_table::do_write): Support fusion on ELFv2 stubs. ld/testsuite/ * ld-powerpc/elfv2exe.d: Update for changed plt call stubs. gdb/ * ppc64-tdep.c (ppc64_standard_linkage8): New. (ppc64_skip_trampoline_code): Recognise ELFv2 stub supporting fusion.
2014-06-03daily updateAlan Modra1-1/+1
2014-06-02daily updateAlan Modra1-1/+1
2014-06-01daily updateAlan Modra1-1/+1
2014-05-31daily updateAlan Modra1-1/+1
2014-05-30daily updateAlan Modra1-1/+1
2014-05-29daily updateAlan Modra1-1/+1
2014-05-28Fix rx "set but not used" warningsAlan Modra2-16/+16
* elf32-rx.c (rx_table_map): Delete set but not used variables.
2014-05-28addr2line: fix missing inlined frames.Tristan Gingold2-9/+25
2014-05-28 Tristan Gingold <gingold@adacore.com> * dwarf2.c (lookup_address_in_function_table): Add best_fit_len to keep the length of the best fit range. (lookup_symbol_in_function_table, info_hash_lookup_funcinfo): Likewise.
2014-05-28daily updateAlan Modra1-1/+1
2014-05-27Add new link-map-text hook and RX auto-vector support.DJ Delorie3-0/+434
* bfd/elf32-rx.c (get_symbol_value_maybe): New. (rx_elf_relocate_section): If we find a reloc against $tableentry$default$<name>, redirect it to the appropriate $tableentry$<n>$. (RX_Table_Info): New. (rx_table_find): New. Check all tables and SEC_KEEP all sections with table parts in them. (rx_check_directives): New. (rx_table_map_2): New. (rx_table_map): New. (rx_additional_link_map_text): New. Called to dump tables to the map file. * bfd/elf32-rx.h: New. * ld/ldemul.h (extra_map_file_text): New field. (ldemul_extra_map_file_text): Declare. * ld/ldemul.c (ldemul_extra_map_file_text): Define. * ld/ldlang.c (lang_map): Call it. * ld/emultempl/rxelf.em: Add extra_map_file_text hook. * ld/emultempl/aix.em: Add NULL extra_map_file_text hook. * ld/emultempl/armcoff.em: Likewise. * ld/emultempl/beos.em: Likewise. * ld/emultempl/elf32.em: Likewise. * ld/emultempl/generic.em: Likewise. * ld/emultempl/gld960.em: Likewise. * ld/emultempl/gld960c.em: Likewise. * ld/emultempl/linux.em: Likewise. * ld/emultempl/lnk960.em: Likewise. * ld/emultempl/m68kcoff.em: Likewise. * ld/emultempl/pe.em: Likewise. * ld/emultempl/pep.em: Likewise. * ld/emultempl/sunos.em: Likewise. * ld/emultempl/ticoff.em: Likewise. * ld/emultempl/vanilla.em: Likewise.
2014-05-27daily updateAlan Modra1-1/+1
2014-05-26daily updateAlan Modra1-1/+1
2014-05-25daily updateAlan Modra1-1/+1
2014-05-24daily updateAlan Modra1-1/+1
2014-05-23daily updateAlan Modra1-1/+1
2014-05-22daily updateAlan Modra1-1/+1