[haiku-commits] buildtools: btrev43104 - in binutils: bfd gas/testsuite/gas/i386 binutils . opcodes

  • From: jerome.duval@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 24 Jul 2015 21:43:23 +0200 (CEST)

btrev43104 adds 2 changesets to branch 'master'
old head: 148cc99040fabc451e143a5011abee967c9d80f1
new head: e2963a55e6d09d838bd84135091fbc73ffa2c2bf
overview:
http://cgit.haiku-os.org/buildtools/log/?qt=range&q=e2963a55e6d0+%5E148cc99040fa

----------------------------------------------------------------------------

597b3bdc8bbf: import binutils 2.25.1

e2963a55e6d0: Merge binutils 2.25.1

Conflicts:
binutils/gas/configure.tgt

[ Jérôme Duval <jerome.duval@xxxxxxxxx> ]

----------------------------------------------------------------------------

421 files changed, 13151 insertions(+), 8142 deletions(-)
binutils/bfd/ChangeLog | 964 ++++++++++++
binutils/bfd/aoutx.h | 6 +-
binutils/bfd/archive.c | 22 +-
binutils/bfd/archive64.c | 11 +-
binutils/bfd/bfd-in.h | 7 +-
binutils/bfd/bfd-in2.h | 7 +-
binutils/bfd/coff-h8300.c | 2 +-
binutils/bfd/coff-h8500.c | 2 +-
binutils/bfd/coff-i860.c | 5 +-
binutils/bfd/coff-m68k.c | 1 +
binutils/bfd/coff-mcore.c | 16 +-
binutils/bfd/coff-sparc.c | 2 +-
binutils/bfd/coff-tic30.c | 2 +-
binutils/bfd/coff-w65.c | 9 +-
binutils/bfd/coff-we32k.c | 9 +-
binutils/bfd/coff-x86_64.c | 13 +-
binutils/bfd/coff-z80.c | 2 +-
binutils/bfd/coff-z8k.c | 2 +-
binutils/bfd/coffcode.h | 65 +-
binutils/bfd/coffgen.c | 41 +-
binutils/bfd/cofflink.c | 2 +-
binutils/bfd/compress.c | 6 +-
binutils/bfd/configure | 20 +-
binutils/bfd/cpu-ns32k.c | 3 +-
binutils/bfd/doc/ChangeLog | 21 +
binutils/bfd/doc/Makefile.am | 70 +-
binutils/bfd/doc/Makefile.in | 70 +-
binutils/bfd/doc/bfdver.texi | 4 +-
binutils/bfd/dwarf2.c | 704 +++++++--
binutils/bfd/ecoff.c | 49 +-
binutils/bfd/elf-attrs.c | 33 +-
binutils/bfd/elf-bfd.h | 15 +-
binutils/bfd/elf-hppa.h | 2 +-
binutils/bfd/elf-m10200.c | 6 +-
binutils/bfd/elf-m10300.c | 16 +-
binutils/bfd/elf-s390-common.c | 12 +
binutils/bfd/elf.c | 207 +--
binutils/bfd/elf32-arc.c | 12 +-
binutils/bfd/elf32-arm.c | 6 +-
binutils/bfd/elf32-avr.c | 12 +-
binutils/bfd/elf32-bfin.c | 20 +-
binutils/bfd/elf32-cr16.c | 14 +-
binutils/bfd/elf32-cr16c.c | 6 +-
binutils/bfd/elf32-cris.c | 14 +-
binutils/bfd/elf32-crx.c | 12 +-
binutils/bfd/elf32-d10v.c | 10 +-
binutils/bfd/elf32-d30v.c | 18 +-
binutils/bfd/elf32-dlx.c | 8 +-
binutils/bfd/elf32-epiphany.c | 7 +-
binutils/bfd/elf32-fr30.c | 14 +-
binutils/bfd/elf32-frv.c | 11 +-
binutils/bfd/elf32-h8300.c | 2 +-
binutils/bfd/elf32-hppa.c | 2 +-
binutils/bfd/elf32-i370.c | 21 +-
binutils/bfd/elf32-i386.c | 14 +-
binutils/bfd/elf32-i860.c | 6 +-
binutils/bfd/elf32-i960.c | 9 +-
binutils/bfd/elf32-ip2k.c | 7 +-
binutils/bfd/elf32-iq2000.c | 11 +-
binutils/bfd/elf32-lm32.c | 14 +-
binutils/bfd/elf32-m32c.c | 89 +-
binutils/bfd/elf32-m32r.c | 15 +-
binutils/bfd/elf32-m68hc11.c | 10 +-
binutils/bfd/elf32-m68hc12.c | 10 +-
binutils/bfd/elf32-m68k.c | 4 +-
binutils/bfd/elf32-mcore.c | 19 +-
binutils/bfd/elf32-mep.c | 7 +-
binutils/bfd/elf32-metag.c | 10 +-
binutils/bfd/elf32-microblaze.c | 25 +-
binutils/bfd/elf32-mips.c | 11 +-
binutils/bfd/elf32-moxie.c | 14 +-
binutils/bfd/elf32-msp430.c | 24 +-
binutils/bfd/elf32-mt.c | 9 +-
binutils/bfd/elf32-nds32.c | 17 +-
binutils/bfd/elf32-nios2.c | 4 +-
binutils/bfd/elf32-or1k.c | 14 +-
binutils/bfd/elf32-pj.c | 10 +-
binutils/bfd/elf32-ppc.c | 190 ++-
binutils/bfd/elf32-rl78.c | 10 +-
binutils/bfd/elf32-rx.c | 10 +-
binutils/bfd/elf32-s390.c | 5 +-
binutils/bfd/elf32-score.c | 2 +-
binutils/bfd/elf32-score7.c | 2 +-
binutils/bfd/elf32-sh-relocs.h | 2 +-
binutils/bfd/elf32-sh.c | 27 +-
binutils/bfd/elf32-spu.c | 15 +-
binutils/bfd/elf32-tic6x.c | 6 +-
binutils/bfd/elf32-tilepro.c | 8 +-
binutils/bfd/elf32-v850.c | 22 +-
binutils/bfd/elf32-vax.c | 20 +-
binutils/bfd/elf32-xc16x.c | 6 +-
binutils/bfd/elf32-xgate.c | 10 +-
binutils/bfd/elf32-xstormy16.c | 6 +-
binutils/bfd/elf32-xtensa.c | 8 +-
binutils/bfd/elf64-alpha.c | 13 +-
binutils/bfd/elf64-mips.c | 5 +-
binutils/bfd/elf64-mmix.c | 12 +-
binutils/bfd/elf64-ppc.c | 407 ++---
binutils/bfd/elf64-s390.c | 5 +-
[ *** stats truncated: 322 lines dropped *** ]

############################################################################

Commit: 597b3bdc8bbf8f1bd9260a21ce496e020c4679cf
URL: http://cgit.haiku-os.org/buildtools/commit/?id=597b3bdc8bbf
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Thu Jul 23 18:15:18 2015 UTC

import binutils 2.25.1

----------------------------------------------------------------------------

diff --git a/binutils/bfd/ChangeLog b/binutils/bfd/ChangeLog
index f2ee1ba..9615276 100644
--- a/binutils/bfd/ChangeLog
+++ b/binutils/bfd/ChangeLog
@@ -1,3 +1,967 @@
+2015-07-21 Tristan Gingold <gingold@xxxxxxxxxxx>
+
+ * version.m4: Bump version to 2.25.1
+ * configure: Regenerate.
+
+2015-07-10 Alan Modra <amodra@xxxxxxxxx>
+
+ Apply from master
+ 2015-07-05 Richard Sandiford <richard.sandiford@xxxxxxx>
+ * elf64-ppc.c (toc_adjusting_stub_needed): Use the symbol value
+ plus addend rather than the original st_value when looking up
+ entries in opd->adjust.
+
+ 2015-06-16 Alan Modra <amodra@xxxxxxxxx>
+ * elf32-ppc.c (ppc_elf_relocate_section): Correct binary search of
+ dynamic relocs.
+
+ 2015-06-05 Alan Modra <amodra@xxxxxxxxx>
+ * elf64-ppc.c (ppc_elf_relocate_section): Move dynamic text
+ relocs with insns moved by --ppc476-workaround. Correct
+ output of REL16 relocs.
+
+ 2015-04-23 Alan Modra <amodra@xxxxxxxxx>
+ * elf64-ppc.c (TOC_BASE_ALIGN): Define.
+ (ppc64_elf_next_toc_section): Align multi-got toc base.
+ (ppc64_elf_set_toc): Likewise initial toc base and .TOC. symbol.
+
+ 2015-03-24 Alan Modra <amodra@xxxxxxxxx>
+ * elf64-ppc.c (ppc64_elf_relocate_section): Report overflow to
+ stubs, even those for undefined weak symbols. Otherwise, don't
+ report relocation overflow on branches to undefined strong
+ symbols. Fix memory leak.
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't report relocation
+ overflow on branches to undefined strong symbols.
+
+2015-06-23 Jiong Wang <jiong.wang@xxxxxxx>
+
+ Apply from master:
+ 2015-06-23 Jiong. Wang <jiong.wang@xxxxxxx>
+
+ * elfnn-aarch64.c (aarch64_readonly_dynrelocs): New function.
+ (elfNN_aarch64_size_dynamic_sections): Traverse hash table to check
+ relocations against read-only sections.
+
+2015-06-19 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR 18481
+ * elf32-arm.c (R_ARM_TLS_LE32): Set the special function to NULL.
+
+2015-05-05 Jiong Wang <jiong.wang@xxxxxxx>
+
+ Apply from master:
+
+ 2015-04-24 Jiong. Wang <jiong.wang@xxxxxxx>
+
+ PR ld/18270
+ * elfnn-aarch64.c (elfNN_aarch64_size_dynamic): Count local symbol for
+ GOT_NORMAL for both sgot/srelgot section.
+ (elfNN_aarch64_final_link_relocate): Relocate against GOT entry address
+ and generate necessary runtime relocation for GOT entry.
+
+2015-05-05 Jiong Wang <jiong.wang@xxxxxxx>
+
+ Apply from master:
+
+ 2015-04-24 Jiong. Wang <jiong.wang@xxxxxxx>
+
+ * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Reject
+ PC-relative relocation for external symbol.
+
+2015-04-10 Alan Modra <amodra@xxxxxxxxx>
+
+ PR ld/18222
+ * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't report an error
+ on adding a protected visibility variable to .dynbss.
+
+2015-04-10 Alan Modra <amodra@xxxxxxxxx>
+
+ Revert 2015-03-06 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+ PR ld/pr15228
+ PR ld/pr17709
+ * elf-bfd.h (elf_backend_data): Delete extern_protected_data.
+ * elf32-i386.c (elf_backend_extern_protected_data): Delete.
+ * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
+ * elflink.c (_bfd_elf_adjust_dynamic_copy): Remove
+ extern_protected_data test.
+ (_bfd_elf_symbol_refs_local_p): Likewise.
+ * elfxx-target.h (elf_backend_extern_protected_data): Delete.
+ (elfNN_bed): Delete elf_backend_extern_protected_data init.
+
+2015-03-27 Alan Modra <amodra@xxxxxxxxx>
+
+ PR ld/15228
+ PR ld/18167
+ * elflink.c (elf_merge_st_other): Add "sec" parameter. Don't set
+ protected_def when symbol section is read-only. Adjust all calls.
+ * elf-bfd.h (struct elf_link_hash_entry): Update protected_def comment.
+
+2015-03-26 Tejas Belagod <tejas.belagod@xxxxxxx>
+
+ * elfnn-aarch64.c (aarch64_build_one_stub): Replace the call to generic
+ _bfd_final_link_relocate with aarch64_relocate.
+
+2015-03-25 Nick Clifton <nickc@xxxxxxxxxx>
+
+ Apply from master:
+ 2015-02-26 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * elf.c (elf_fake_sections): Handle excessive alignmment powers.
+ (assign_file_positions_for_non_load_sections): Replace assertion
+ with an error message.
+ (rewrite_elf_program_header): Handle excessive segment
+ alignments.
+
+ 2015-02-13 Alan Modra <amodra@xxxxxxxxx>
+
+ PR binutils/17512
+ * elf64-ppc.c (opd_entry_value): Tighten offset check. Remove
+ now redundant assert.
+
+ 2015-02-12 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * dwarf2.c (read_1_byte, read_1_signed_byte, read_2_bytes)
+ (read_4_bytes, read_8_bytes, read_n_bytes, read_string)
+ (read_indirect_string, read_alt_indirect_string)
+ (read_alt_indirect_ref, read_address, read_abbrevs)
+ (read_attribute_value, read_attribute, decode_line_info)
+ (find_abstract_instance_name, read_rangelist)
+ (scan_unit_for_symbols, parse_comp_unit)
+ (_bfd_dwarf2_find_nearest_line): Harden DWARF reading code. Pass
+ end pointers to reading functions and check for offsets taking
+ pointers out of range. Replace calls to read_*_leb128 with calls
+ to safe_read_leb128.
+
+ * elf64-ppc.c (opd_entry_value): Add a check for an overlarge
+ offset.
+
+ 2015-02-03 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * elf-m10300.c (mn10300_info_to_howto): Fix typo in error message.
+ * elf32-arc.c (arc_info_to_howto_rel): Likewise.
+ * elf32-avr.c (avr_info_to_howto_rela): Likewise.
+ * elf32-cr16.c (elf_cr16_info_to_howto): Likewise.
+ * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
+ * elf32-cris.c (cris_info_to_howto_rela): Likewise.
+ * elf32-crx.c (elf_crx_info_to_howto): Likewise.
+ * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
+ * elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
+ * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
+ * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
+ * elf32-frv.c (frv_info_to_howto_rela): Likewise.
+ * elf32-i370.c (i370_elf_info_to_howto): Likewise.
+ * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
+ * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
+ * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
+ * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
+ * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
+ * elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
+ * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
+ * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
+ * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
+ * elf32-mep.c (mep_info_to_howto_rela): Likewise.
+ * elf32-metag.c (metag_info_to_howto_rela): Likewise.
+ * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
+ * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
+ * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
+ * elf32-mt.c (mt_info_to_howto_rela): Likewise.
+ * elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
+ * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
+ * elf32-pj.c (pj_elf_info_to_howto): Likewise.
+ * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
+ * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
+ * elf32-rx.c (rx_info_to_howto_rela): Likewise.
+ * elf32-sh.c (sh_elf_info_to_howto): Likewise.
+ * elf32-spu.c (spu_elf_info_to_howto): Likewise.
+ * elf32-v850.c (v850_elf_perform_relocation): Likewise.
+ * elf32-vax.c (rtype_to_howto): Likewise.
+ * elf32-visium.c (visium_info_to_howto_rela): Likewise.
+ * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
+ * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
+ * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
+ * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
+
+ 2015-01-27 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * dwarf2.c (concat_filename): Check for an empty directory table.
+ (scan_unit_for_symbols): Check for reading off the end of the
+ unit.
+ (parse_comp_unit): Check for a DW_AT_comp_dir attribute with a
+ non-string form.
+
+ 2015-01-15 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * elf-m10300.c (mn10300_info_to_howto): Replace assertion with an
+ error message. Never return an invalid howto pointer.
+ * elf32-cr16.c (cr16_info_to_howto): Likewise.
+ * elf32-crx.c (elf_crx_info_to_howto): Likewise.
+ * elf32-i370.c (i370_elf_info_to_howto): Likewise.
+ * elf32-mcore.c (mcore_elf_info_to_howto): Likewise.
+ * elf32-microblaze.c (microblaze_elf_info_to_howto): Likewise.
+ * elf32-mips.c (mips_elf32_rtype_to_howto): Likewise.
+ * elf32-pj.c (pj_elf_info_to_howto): Likewise.
+ * elf32-ppc.c (ppc_elf_info_to_howto): Likewise.
+ * elf32-spu.c (spu_elf_info_to_howto): Likewise.
+ * elf32-v850.c (v850_elf_info_to_howto_rela): Likewise.
+ * elf32-vax.c (rtype_to_howto): Likewise.
+ * elf64-alpha.c (elf64_alpha_info_to_howto): Likewise.
+ * elf64-mips.c (mips_elf64_rtype_to_howto): Likewise.
+ * elfn32-mips.c (sh_elf_info_to_howto): Likewise.
+ * elf32-sh.c (sh_elf_info_to_howto): Likewise.
+ (sh_elf_reloc): Check that the reloc is in range.
+ * reloc.c (bfd_perform_relocation): Check that the section is big
+ enough for the entire reloc.
+ (bfd_generic_get_relocated_section_contents): Report unexpected
+ return values from perform_reloc.
+
+ 2015-01-08 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * elf.c (_bfd_elf_map_sections_to_segments): Enforce a minimum
+ maxpagesize of 1.
+
+ 2015-01-06 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+
+ PR binutils/17512
+ * elf32-i386.c (elf_i386_get_plt_sym_val): Skip unknown relocation.
+ * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Likewise.
+
+ 2014-12-22 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * elf32-arc.c (arc_info_to_howto_rel): Replace BFD_ASSERT with
+ error message.
+ * elf32-avr.c (avr_info_to_howto_rela): Likewise.
+ * elf32-cr16c.c (elf_cr16c_info_to_howto_rel): Likewise.
+ * elf32-cris.c (cris_info_to_howto_rela): Likewise.
+ * elf32-d10v.c (d10v_info_to_howto_rel): Likewise.
+ * elf32-d30v.c (d30v_info_to_howto_rel): Likewise.
+ * elf32-dlx.c (dlx_rtype_to_howto): Likewise.
+ * elf32-epiphany.c (epiphany_info_to_howto_rela): Likewise.
+ * elf32-fr30.c (fr30_info_to_howto_rela): Likewise.
+ * elf32-frv.c (frv_info_to_howto_rela): Likewise.
+ * elf32-i960.c (elf32_i960_info_to_howto_rel): Likewise.
+ * elf32-ip2k.c (ip2k_info_to_howto_rela): Likewise.
+ * elf32-iq2000.c (iq2000_info_to_howto_rela): Likewise.
+ * elf32-lm32.c (lm32_info_to_howto_rela): Likewise.
+ * elf32-m32c.c (m32c_info_to_howto_rela): Likewise.
+ * elf32-m32r.c (m32r_info_to_howto_rel): Likewise.
+ * elf32-m68hc11.c (m68hc11_info_to_howto_rel): Likewise.
+ * elf32-m68hc12.c (m68hc11_info_to_howto_rel): Likewise.
+ * elf32-mep.c (mep_info_to_howto_rela): Likewise.
+ * elf32-metag.c (metag_info_to_howto_rela): Likewise.
+ * elf32-moxie.c (moxie_info_to_howto_rela): Likewise.
+ * elf32-msp430.c (msp430_info_to_howto_rela): Likewise.
+ * elf32-mt.c (mt_info_to_howto_rela): Likewise.
+ * elf32-nds32.c (nds32_info_to_howto_rel): Likewise.
+ * elf32-or1k.c (or1k_info_to_howto_rela): Likewise.
+ * elf32-rl78.c (rl78_info_to_howto_rela): Likewise.
+ * elf32-rx.c (rx_info_to_howto_rela): Likewise.
+ * elf32-v850.c (v850_elf_info_to_howto_rel): Likewise.
+ * elf32-xgate.c (xgate_info_to_howto_rel): Likewise.
+ * elf32-xtensa.c (elf_xtensa_info_to_howto_rela): Likewise.
+ * elf64-mmix.c (mmix_info_to_howto_rela): Likewise.
+ * elf64-x86-64.c (elf_x86_64_reloc_type_lookup): Likewise.
+ * elfnn-aarch64.c (elfNN_aarch64_bfd_reloc_from_type): Likewise.
+ * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Add range
+ checking of reloc symbol index.
+
+ 2014-12-09 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * elf-attrs.c (_bfd_elf_parse_attributes): Use safe_read_leb128.
+ Check for an over-long subsection length.
+ * elf.c (elf_parse_notes): Check that the namedata is long enough
+ for the string comparison that is about to be performed.
+ (elf_read_notes): Zero-terminate the note buffer.
+
+ 2014-12-01 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * elf-attrs.c (_bfd_elf_parse_attributes): Check for an empty
+ header. Add range checks to avoid running off the end of the
+ section.
+ * elf.c (bfd_elf_get_str_section): Seek before allocating so that
+ if the seek fails, no memory is allocated.
+ (bfd_elf_string_from_elf_section): Do not allocate a string from a
+ non string section. It only leads to trouble later on.
+ (_bfd_elf_print_private_bfd_data): Check for there being too
+ little external dynamic data.
+ (bfd_section_from_shdr): Replace assertion with a failure mode.
+ (bfd_section_from_shdr): When walking a loaded group section use
+ the internal structure size, not the external size. Check for the
+ group section being empty.
+ * elf32-i386.c (elf_i386_rtype_to_howto): Replace assertion with a
+ failure mode.
+ * elfcode.h (elf_slurp_reloc_table): Likewise.
+
+ 2014-11-27 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * elf.c (_bfd_elf_print_private_bfd_data): Fix the range check
+ scanning the external dynamic entries.
+
+2015-03-25 Nick Clifton <nickc@xxxxxxxxxx>
+
+ Apply from master:
+ 2015-02-26 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * mach-o.c (bfd_mach_o_read_section_32): Likewise.
+ (bfd_mach_o_read_section_64): Likewise.
+
+ 2015-02-10 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * versados.c (process_otr): Check the esdid value before using it
+ to access the EDATA.
+
+ 2015-02-03 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * mach-o.c: Use bfd_alloc2 to allocate space for structure arrays.
+ (bfd_mach_o_canonicalize_one_reloc): Fix check on out
+ of range symbol indicies.
+ (bfd_mach_o_canonicalize_relocs): Check for out of range alloc.
+ (bfd_mach_o_canonicalize_dynamic_reloc): Likewise.
+ (bfd_mach_o_build_dysymtab): Likewise.
+ (bfd_mach_o_write_symtab_content): Set the string table size to
+ zero upon error.
+ (bfd_mach_o_read_symtab_symbols): Reset the nsyms value if the
+ read fails.
+ * tekhex.c (first_phase): Check for src pointer reaching end of
+ buffer.
+
+ 2015-01-27 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * pdp11.c (aout_get_external_symbols): Return false if there are
+ no symbols.
+
+ 2015-01-22 DJ Delorie <dj@xxxxxxxxxx>
+
+ * elf32-m32c.c (m32c_apply_reloc_24): New.
+ (m32c_elf_howto_table): Use it for R_M32C_24.
+ (m32c_elf_relocate_section): Handle R_M32C_24 specially.
+
+ 2015-01-21 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * mach-o.c (bfd_mach_o_bfd_copy_private_header_data): Always
+ initialise the fields of the dyld_info structure.
+ (bfd_mach_o_build_exec_seg_command): Replace assertion with an
+ error message and a return value.
+ (bfd_mach_o_layout_commands): Change the function to boolean.
+ Return FALSE if the function fails.
+ (bfd_mach_o_build_commands): Fail if bfd_mach_o_layout_commands
+ fails.
+ (bfd_mach_o_read_command): Fail if an unrecognised command is
+ encountered.
+ * tekhex.c (first_phase): Fail if the section is too big.
+ * versados.c (struct esdid): Add content_size field.
+ (process_otr): Use and check the new field.
+ (versados_get_section_contents): Check that the section exists and
+ that the requested data is available.
+
+ 2015-01-19 Alan Modra <amodra@xxxxxxxxx>
+
+ * bfd-in.h (bfd_get_section_limit_octets): New define, extracted from..
+ (bfd_get_section_limit): ..here.
+ * reloc.c (bfd_perform_relocation): Correct bfd_reloc_outofrange check.
+ (bfd_install_relocation, _bfd_final_link_relocate): Add same check here.
+ * bfd-in2.h: Regenerate.
+
+ * cpu-ns32k.c (_bfd_do_ns32k_reloc_contents): Return bfd_reloc_ok
+ on zero size relocs.
+ * ecoff.c (ecoff_reloc_link_order): Likewise.
+ * elf32-nds32.c (nds32_relocate_contents): Likewise.
+ * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
+
+ * reloc.c (_bfd_relocate_contents): Don't bomb on zero size relocs.
+ (_bfd_clear_contents): Likewise.
+ * elfxx-mips.c (mips_elf_obtain_contents): Likewise.
+ (mips_elf_perform_relocation): Likewise.
+
+ * aoutx.h (aout_link_reloc_link_order): Allow for NULL return
+ from malloc on zero size alloc.
+ * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
+ * elflink.c (elf_reloc_link_order): Likewise.
+ * linker.c (_bfd_generic_reloc_link_order): Likewise.
+ * pdp11.c (aout_link_reloc_link_order): Likewise.
+ * xcofflink.c (xcoff_reloc_link_order): Likewise.
+
+ * aoutx.h (howto_table_ext): Ensure NONE relocs have size 3,
+ bitsize 0, and complain_overflow_dont.
+ * coff-sparc.c (coff_sparc_howto_table): Likewise.
+ * elf-hppa.h (elf_hppa_howto_table): Likewise.
+ * elf-m10200.c (elf_mn10200_howto_table): Likewise.
+ * elf-m10300.c (elf_mn10300_howto_table): Likewise.
+ * elf32-arc.c (elf_arc_howto_table): Likewise.
+ * elf32-arm.c (elf32_arm_howto_table_1): Likewise.
+ * elf32-avr.c (elf_avr_howto_table): Likewise.
+ * elf32-bfin.c (bfin_howto_table): Likewise.
+ * elf32-cr16.c (cr16_elf_howto_table): Likewise.
+ * elf32-cris.c (cris_elf_howto_table): Likewise.
+ * elf32-crx.c (crx_elf_howto_table): Likewise.
+ * elf32-d10v.c (elf_d10v_howto_table): Likewise.
+ * elf32-d30v.c (elf_d30v_howto_table): Likewise.
+ * elf32-dlx.c (dlx_elf_howto_table): Likewise.
+ * elf32-epiphany.c (epiphany_elf_howto_table): Likewise.
+ * elf32-fr30.c (fr30_elf_howto_table): Likewise.
+ * elf32-frv.c (elf32_frv_howto_table): Likewise.
+ * elf32-h8300.c (h8_elf_howto_table): Likewise.
+ * elf32-i370.c (i370_elf_howto_raw): Likewise.
+ * elf32-i386.c (elf_howto_table): Likewise.
+ * elf32-i860.c (elf32_i860_howto_table): Likewise.
+ * elf32-i960.c (elf32_i960_relocate): Likewise.
+ * elf32-ip2k.c (ip2k_elf_howto_table): Likewise.
+ * elf32-iq2000.c (iq2000_elf_howto_table): Likewise.
+ * elf32-lm32.c (lm32_elf_howto_table): Likewise.
+ * elf32-m32c.c (m32c_elf_howto_table): Likewise.
+ * elf32-m32r.c (m32r_elf_howto_table): Likewise.
+ * elf32-m68hc11.c (elf_m68hc11_howto_table): Likewise.
+ * elf32-m68hc12.c (elf_m68hc11_howto_table): Likewise.
+ * elf32-m68k.c (howto_table): Likewise.
+ * elf32-mcore.c (mcore_elf_howto_raw): Likewise.
+ * elf32-mep.c (mep_elf_howto_table): Likewise.
+ * elf32-metag.c (elf_metag_howto_table): Likewise.
+ * elf32-microblaze.c (microblaze_elf_howto_raw): Likewise.
+ * elf32-mips.c (elf_mips_howto_table_rel): Likewise.
+ * elf32-moxie.c (moxie_elf_howto_table): Likewise.
+ * elf32-msp430.c (elf_msp430_howto_table): Likewise.
+ * elf32-mt.c (mt_elf_howto_table): Likewise.
+ * elf32-nds32.c (nds32_elf_howto_table): Likewise.
+ * elf32-nios2.c (elf_nios2_howto_table_rel): Likewise.
+ * elf32-or1k.c (or1k_elf_howto_table): Likewise.
+ * elf32-pj.c (pj_elf_howto_table): Likewise.
+ * elf32-ppc.c (ppc_elf_howto_raw): Likewise.
+ * elf32-rl78.c (rl78_elf_howto_table): Likewise.
+ * elf32-rx.c (rx_elf_howto_table): Likewise.
+ * elf32-s390.c (elf_howto_table): Likewise.
+ * elf32-score.c (elf32_score_howto_table): Likewise.
+ * elf32-score7.c (elf32_score_howto_table): Likewise.
+ * elf32-sh-relocs.h (R_SH_NONE): Likewise.
+ * elf32-spu.c (elf_howto_table): Likewise.
+ * elf32-tic6x.c (elf32_tic6x_howto_table): Likewise.
+ * elf32-tilepro.c (tilepro_elf_howto_table): Likewise.
+ * elf32-v850.c (v850_elf_howto_table): Likewise.
+ * elf32-vax.c (howto_table): Likewise.
+ * elf32-xc16x.c (xc16x_elf_howto_table): Likewise.
+ * elf32-xgate.c (elf_xgate_howto_table): Likewise.
+ * elf32-xstormy16.c (xstormy16_elf_howto_table): Likewise.
+ * elf32-xtensa.c (elf_howto_table): Likewise.
+ * elf64-alpha.c (elf64_alpha_howto_table): Likewise.
+ * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
+ * elf64-mmix.c (elf_mmix_howto_table): Likewise.
+ * elf64-ppc.c (ppc64_elf_howto_raw): Likewise.
+ * elf64-s390.c (elf_howto_table): Likewise.
+ * elf64-sh64.c (sh_elf64_howto_table): Likewise.
+ * elf64-x86-64.c (x86_64_elf_howto_table): Likewise.
+ * elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
+ * elfnn-aarch64.c (elfNN_aarch64_howto_table): Likewise.
+ (elfNN_aarch64_howto_none): Likewise.
+ * elfxx-ia64.c (ia64_howto_table): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_howto_table): Likewise.
+ * elfxx-tilegx.c (tilegx_elf_howto_table): Likewise.
+ * nlm32-sparc.c (nlm32_sparc_howto_table): Likewise.
+
+ 2015-01-06 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * mach-o.c (bfd_mach_o_read_symtab_strtab): Zero terminate the
+ string table.
+
+ * reloc.c (bfd_get_reloc_size): Handle a reloc size of -1.
+ (bfd_perform_relocation): Include the size of the reloc in the
+ test for an out of range relocation.
+ (bfd_generic_get_relocated_section_contents): Remove reloc range
+ test.
+
+ * tekhex.c (getvalue): Add an end pointer parameter. Use it to
+ avoid reading off the end of the buffer.
+ (getsym): Likewise.
+ (first_phase): Likewise.
+ (pass_over): Pass an end pointer to the invoked function.
+
+ 2015-01-05 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * archive.c (do_slurp_bsd_armap): Make sure that the parsed sized
+ is at least big enough for the header to be read.
+ * mach-o.c (bfd_mach_o_get_synthetic_symtab): Add range checks.
+ (bfd_mach_o_read_command): Prevetn duplicate error messages about
+ unrecognized commands.
+ * syms.c (_bfd_stab_section_find_nearest_line): Add range checks
+ when indexing into the string table.
+
+ 2014-12-22 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * archive.c (do_slurp_bsd_armap): Return if the parsed_size is
+ zero.
+ (bfd_slurp_armap): Zero terminate the name.
+ (bfd_generic_stat_arch_elt): If there is no header, fail.
+ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): If no symbols have
+ been provided then set the reloc's symbol to undefined.
+ * reloc.c (bfd_generic_get_relocated_section_contents): Add range
+ checking of the reloc to be applied.
+ * versados.c (process_otr): Add more range checks.
+ (versados_canonicalize_reloc): If the section is unknown, set the
+ symbol to undefined.
+ * vms-alpha.c (_bfd_vms_slurp_eisd): Add range checks.
+ (alpha_vms_object_p): Likewise.
+
+ 2014-12-16 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * format.c (bfd_check_format_matches): Check for a matching vector
+ before using match priorities.
+ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Fix off-by-one
+ errors with previous delta.
+
+ 2014-12-09 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * archive64.c (bfd_elf64_archive_slurp_armap): Add range checks.
+ * libbfd.c (safe_read_leb128): New function.
+ * libbfd-in.h (safe_read_leb128): Add prototype.
+ * libbfd.h: Regenerate.
+
+ 2014-12-03 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * compress.c (bfd_get_full_section_contents): Fail if there are no
+ section contents available when the compress_status is
+ COMPRESS_SECTION_DONE.
+ * libbfd.c (bfd_malloc): Refuse to allocate a negative size.
+ (bfd_malloc2): Use bfd_malloc.
+ (bfd_realloc): Refuse to reallocate a negative size.
+ (bfd_realloc2): Use bfd_realloc.
+ (bfd_realloc_or_free): Use bfd_realloc.
+ (bfd_zmalloc): Use bfd_malloc.
+ (bfd_zmalloc): Use bfd_malloc2.
+ * opncls.c (bfd_alloc): Refuse to allocate a negative size.
+
+ 2014-12-01 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * archive.c (do_slurp_coff_armap): Add range checks to prevent
+ running off the end of the string table.
+ * compress.c (bfd_get_full_section_contents): Return a NULL
+ pointer for zero sized sections. Do not attempt to copy a buffer
+ onto itself.
+ * reloc.c (bfd_perform_relocation): Avoid seg-fault if the howto
+ parameter is NULL.
+
+ 2014-11-26 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Likewise.
+ (bfd_mach_o_mangle_sections): Move test for too many sections to
+ before the allocation of the section table.
+ (bfd_mach_o_read_symtab_strtab): If the read fails, free the
+ memory and nullify the symbol pointer.
+ * reloc.c (bfd_generic_get_relocated_section_contents): Add
+ handling of a bfd_reloc_notsupported return value.
+ * versados.c (EDATA): Add range checking.
+ (get_record): Likewise.
+ (process_otr): Check for contents being available before updating
+ them.
+ (versados_canonicalize_reloc): Add range check.
+
+ 2014-11-21 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * ieee.c (next_byte): Convert to a function. Return FALSE if the
+ next byte is beyond the end of the buffer.
+ (parse_int): Test the return value of next_byte.
+ (parse_expression): Convert to boolean. Return FALSE if the
+ parsing failed. Test the return value of next_byte.
+ (ieee_seek): Convert to a function. Return FALSE if the seek goes
+ beyond the end of the buffer.
+ (ieee_slurp_external_symbols): Test the return value of ieee_seek
+ and next_byte.
+ (ieee_slurp_sections): Convert to boolean. Return FALSE if the
+ operation failed. Test the return value of ieee_seek and
+ next_byte.
+ (ieee_archive_p): Test the return value of ieee_seek and
+ next_byte.
+ (do_one): Likewise.
+ (ieee_slurp_section_data): Likewise.
+ (ieee_object_p): Likewise. Store the size of the buffer in the
+ total_amt field in the header.
+ * libieee.h (common_header_type): Add amt field.
+ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Check that the
+ reloc's value is within range.
+ (bfd_mach_o_read_symtab_symbols): Nullify the symbols field if the
+ operation fails.
+ * versados.c (process_otr): Check that the section exists before
+ taking its size.
+ (versados_object_p): Make sure that enough data was read for the
+ header to be checked.
+ * vms-alpha.c (vms_get_remaining_object_record): Change
+ read_so_far parameter to an unsigned int. Check that the amount
+ read is in range.
+
+2015-03-24 Nick Clifton <nickc@xxxxxxxxxx>
+
+ Apply from master:
+ 2015-02-26 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * coffcode.h (coff_compute_section_file_positions): Report
+ negative page sizes.
+
+ 2015-02-10 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * coffcode.h (styp_to_sec_flags): Use an unsigned long type to
+ hold the flag bits.
+
+ 2015-02-06 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * peXXigen.c (rsrc_print_resource_entries): Add range check for
+ addresses that wrap around the address space.
+ (rsrc_parse_entry): Likewise.
+
+ 2015-02-03 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * ecoff.c: Use bfd_alloc2 to allocate space for structure arrays.
+ (_bfd_ecoff_slurp_symbol_table): Check for a negative symbol
+ index or an out of range fdr index.
+ * peXXigen.c (pe_print_edata): Check for numeric overflow in edt
+ fields.
+
+ 2015-01-22 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * coffcode.h (handle_COMDAT): When searching for the section
+ symbol, make sure that there is space left in the symbol table.
+
+ 2015-01-21 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * coffcode.h (coff_set_arch_mach_hook): Check return value from
+ bfd_malloc.
+ (coff_slurp_line_table): Return FALSE if the line number
+ information was corrupt.
+ (coff_slurp_symbol_table): Return FALSE if the symbol information
+ was corrupt.
+ * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Set bfd_error if the
+ read fails.
+ (slurp_symtab): Check the return from bfd_malloc.
+ (_bfd_XX_bfd_copy_private_bfd_data_common): Fail if the copy
+ encountered an error.
+ (_bfd_XXi_final_link_postscript): Fail if a section could not be
+ copied.
+ * peicode.h (pe_bfd_object_p): Fail if the header could not be
+ swapped in.
+
+ 2015-01-08 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * coffcode.h (coff_slurp_symbol_table): Return false if we failed
+ to load the line table.
+
+ 2015-01-06 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * coff-i860.c (CALC_ADDEND): Always set an addend value.
+
+ 2014-11-27 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * ecoff.c (_bfd_ecoff_slurp_symbol_table): Warn about and correct
+ a discrepancy between the isymMax and ifdMax values in the
+ symbolic header.
+
+ 2014-11-26 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * coff-h8300.c (rtype2howto): Replace abort with returning a NULL
+ value.
+ * coff-h8500.c (rtype2howto): Likewise.
+ * coff-tic30.c (rtype2howto): Likewise.
+ * coff-z80.c (rtype2howto): Likewise.
+ * coff-z8k.c (rtype2howto): Likewise.
+ * coff-ia64.c (RTYPE2HOWTO): Always return a valid howto.
+ * coff-m68k.c (m68k_rtype2howto): Return a NULL howto if none
+ could be found.
+ * coff-mcore.c (RTYPE2HOWTO): Add range checking.
+ * coff-w65.c (rtype2howto): Likewise.
+ * coff-we32k.c (RTYPE2HOWTO): Likewise.
+ * pe-mips.c (RTYPE2HOWTO): Likewise.
+ * coff-x86_64.c (coff_amd64_reloc): Likewise. Replace abort with
+ an error return.
+ * coffcode.h (coff_slurp_reloc_table): Allow the rel parameter to
+ be unused.
+ * coffgen.c (make_a_section_from_file): Check the length of a
+ section name before testing to see if it is a debug section name.
+ (coff_object_p): Zero out any uninitialised bytes in the opt
+ header.
+ * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Test for the raw
+ source being empty when there are values to be processed.
+ (_bfd_ecoff_slurp_symbol_table): Add range check.
+
+ 2014-11-21 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * coffgen.c (coff_get_normalized_symtab): Check for an excessive
+ number of auxillary entries.
+
+ 2014-11-21 Alexander Cherepanov <cherepan@xxxxxxxx>
+
+ PR binutils/17512
+ * coffgen.c (_bfd_coff_read_string_table): Test allocation of
+ string table before clearing the first few bytes.
+
+2014-11-18 Nick Clifton <nickc@xxxxxxxxxx>
+
+ PR binutils/17512
+ * peXXigen.c (pe_print_pdata): Fail if the section's virtual size
+ is larger than its real size.
+ (rsrc_print_section): Fix off-by-one error checking for overflow.
+ * pei-x86_64.c (pex64_bfd_print_pdata): Handle empty unwind
+ sections.
+
+2015-03-18 Alan Modra <amodra@xxxxxxxxx>
+
+ Apply from master
+ 2015-03-14 Andreas Krebbel <krebbel@xxxxxxxxxxxxxxxxxx>
+ * elf-s390-common.c (elf_s390_elf_sort_relocs_p): Don't sort
+ relocs against code sections.
+ * elf32-s390.c: Define elf_backend_sort_relocs_p.
+ * elf64-s390.c: Likewise.
+
+ 2015-03-11 Alan Modra <amodra@xxxxxxxxx>
+ * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Examine stubs in
+ reverse order. Account for larger size of __tls_get_addr_opt stub.
+
+ 2015-02-28 Alan Modra <amodra@xxxxxxxxx>
+ * elf32-ppc.c (ppc_elf_tls_setup): Set no_tls_get_addr_opt if
+ not PLT_NEW.
+
+ 2015-02-26 Alan Modra <amodra@xxxxxxxxx>
+ * elf64-ppc.c (plt_stub_size, build_plt_stub): Don't build
+ thread-safe stubs for iplt.
+ (build_tls_get_addr_stub): Restore r2 immediately after call.
+
+ 2015-02-26 Alan Modra <amodra@xxxxxxxxx>
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Heed -z nocopyreloc.
+ Use text relocs rather than giving an error on trying to use
+ .dynbss for protected shared lib vars.
+ * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
+
+2015-03-06 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+
+ Backport from master
+ 2015-03-05 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+
+ PR ld/pr15228
+ PR ld/pr17709
+ * elf-bfd.h (elf_backend_data): Add extern_protected_data.
+ * elf32-i386.c (elf_backend_extern_protected_data): New.
+ Defined to 1.
+ * elf64-x86-64.c (elf_backend_extern_protected_data): Likewise.
+ * elflink.c (_bfd_elf_adjust_dynamic_copy): Don't error on
+ copy relocs against protected symbols if extern_protected_data
+ is true.
+ (_bfd_elf_symbol_refs_local_p): Don't return true on protected
+ non-function symbols if extern_protected_data is true.
+ * elfxx-target.h (elf_backend_extern_protected_data): New.
+ Default to 0.
+ (elfNN_bed): Initialize extern_protected_data with
+ elf_backend_extern_protected_data.
+
+2015-02-11 Alan Modra <amodra@xxxxxxxxx>
+
+ Apply from master.
+ 2015-02-09 Alan Modra <amodra@xxxxxxxxx>
+ * elf32-ppc.c (ppc_elf_relocate_section): Don't segfault on NULL
+ tls_sec.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+ * elflink.c (elf_link_output_extsym): Don't assert on NULL tls_sec.
+
+ 2015-01-29 Alan Modra <amodra@xxxxxxxxx>
+ * elf64-ppc.c (ppc64_elf_relocate_section): Correct GOT_TLSLD
+ optimization. Tidy mask for GOT_TLSGD optimization.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise. Correct
+ location of nop zapping high insn too.
+
+ 2015-01-20 Alan Modra <amodra@xxxxxxxxx>
+ PR ld/17615
+ * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Don't drop
+ ELF_COMMON_DEF syms.
+
+ 2015-01-19 Alan Modra <amodra@xxxxxxxxx>
+ PR 17165
+ * elf-bfd.h (ELF_COMMON_DEF_P): Note that this might be true for
+ linker script assignments too.
+ * elflink.c (elf_gc_sweep_symbol): Don't drop ELF_COMMON_DEF syms.
+ (bfd_elf_gc_mark_dynamic_ref_symbol): Similarly.
+
+ 2015-01-15 Alan Modra <amodra@xxxxxxxxx>
+ * elflink.c (_bfd_elf_link_omit_section_dynsym): Return true for
+ any output section matching a linker created dynobj section.
+
+ 2015-01-15 Alan Modra <amodra@xxxxxxxxx>
+ PR 17842
+ * elflink.c (elf_link_output_sym): Assert elf_onesymtab set.
+ (bfd_elf_final_link): Always create a symbol table when emit_relocs.
+ Don't assign symtab file position unless symbols will be output.
+ Merge blocks with condition in common. Don't call
+ elf_backend_output_arch_local_syms or elf_backend_output_arch_syms
+ unless other symbols are output. Move assignment of symtab_shndx
+ file position. Localize variable.
+
+ 2014-12-26 Alan Modra <amodra@xxxxxxxxx>
+ PR 17755
+ * elf64-sh64.c (sh_elf64_copy_private_data_internal): Delete code
+ copying SHF_SH5_ISA32.
+
+ 2014-12-23 Alan Modra <amodra@xxxxxxxxx>
+ * elflink.c (_bfd_elf_define_linkage_sym): Set linker_def.
+ * linker.c (_bfd_generic_link_add_one_symbol): Clear linker_def
+ for CDEF, DEF, DEFW, COM.
+
+ 2014-12-18 Richard Henderson <rth@xxxxxxxxxx>
+ * elf32-ppc.c (ELF_COMMONPAGESIZE): Set to 64k.
+ * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.
+
+ 2014-12-12 Alan Modra <amodra@xxxxxxxxx>
+ PR 15228
+ * elflink.c (_bfd_elf_adjust_dynamic_copy): Call bfd_set_error.
+
+ 2014-12-12 Alan Modra <amodra@xxxxxxxxx>
+ PR 15228
+ * elflink.c (_bfd_elf_adjust_dynamic_copy): Add "info" param.
+ Error on copy relocs against protected symbols.
+ (elf_merge_st_other): Set h->protected_def.
+ * elf-bfd.h (struct elf_link_hash_entry): Add "protected_def".
+ (_bfd_elf_adjust_dynamic_copy): Update prototype.
+ * elf-m10300.c (_bfd_mn10300_elf_adjust_dynamic_symbol): Update
+ _bfd_elf_adjust_dynamic_copy call.
+ * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Likewise.
+ * elf32-cr16.c (_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-cris.c (elf_cris_adjust_dynamic_symbol): Likewise.
+ * elf32-hppa.c (elf32_hppa_adjust_dynamic_symbol): Likewise.
+ * elf32-i370.c (i370_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Likewise.
+ * elf32-lm32.c (lm32_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-m32r.c (m32r_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Likewise.
+ * elf32-metag.c (elf_metag_adjust_dynamic_symbol): Likewise.
+ * elf32-or1k.c (or1k_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
+ * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-tic6x.c (elf32_tic6x_adjust_dynamic_symbol): Likewise.
+ * elf32-tilepro.c (tilepro_elf_adjust_dynamic_symbol): Likewise.
+ * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Likewise.
+ * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
+ * elf64-s390.c (elf_s390_adjust_dynamic_symbol): Likewise.
+ * elf64-sh64.c (sh64_elf64_adjust_dynamic_symbol): Likewise.
+ * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
+ * elfnn-aarch64.c (elfNN_aarch64_adjust_dynamic_symbol): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
+ * elfxx-sparc.c (_bfd_sparc_elf_adjust_dynamic_symbol): Likewise.
+ * elfxx-tilegx.c (tilegx_elf_adjust_dynamic_symbol): Likewise.
+
+ 2014-12-10 Alan Modra <amodra@xxxxxxxxx>
+ PR 17541
+ * dwarf2.c (struct comp_unit): Add "lang".
+ (non_mangled): New function.
+ (struct funcinfo): Add "is_linkage". Reorder for better packing.
+ Make "name" a const char*.
+ (lookup_address_in_function_table): Delete functionname_ptr param.
+ (find_abstract_instance_name): Add is_linkage param. Set if we
+ have DW_AT_linkage_name or non_mangled DW_AT_name.
+ (scan_unit_for_symbols): Similarly set func->is_linkage.
+ (parse_comp_unit): Stash DW_AT_language.
+ (comp_unit_find_nearest_line): Replace functionname_ptr param
+ with function_ptr param.
+ (_bfd_dwarf2_find_nearest_line): Adjust above calls. Set
+ functionname_ptr from function->name. Call _bfd_elf_find_function
+ to retrieve symbol for function if not linkage name.
+ (_bfd_elf_find_function): Add bfd_target_elf_flavour test, moved from..
+ * elf.c (elf_find_function): ..here.
+ (_bfd_elf_find_nearest_line): Adjust calls.
+ * elf-bfd.h (_bfd_elf_find_function): Declare.
+
+ 2014-12-10 Alan Modra <amodra@xxxxxxxxx>
+ PR 17666
+ * elf-bfd.h (struct elf_backend_data): Add sort_relocs_p.
+ * elfxx-target.h (elf_backend_sort_relocs_p): Define.
+ (elfNN_bed): Init new field.
+ * elflink.c (elf_link_adjust_relocs): Conditionally sort.
+ (bfd_elf_final_link): Control sorting of relocs.
+ * elfxx-mips.c (_bfd_mips_elf_sort_relocs_p): New function.
+ * elfxx-mips.h (_bfd_mips_elf_sort_relocs_p): Declare.
+ * elf32-mips.c (elf_backend_sort_relocs_p): Define.
+ * elf64-mips.c (elf_backend_sort_relocs_p): Define.
+
+ 2014-12-09 Alan Modra <amodra@xxxxxxxxx>
+ * elf64-ppc.c (sort_r_offset): Delete.
+ (ppc64_elf_edit_opd): Don't sort input relocs.
+
+ 2014-12-04 Alan Modra <amodra@xxxxxxxxx>
+ PR 17666
+ * elflink.c: Include bfd_stdint.h.
+ (cmp_ext32l_r_offset, cmp_ext32b_r_offset)
+ (cmp_ext64l_r_offset, cmp_ext64b_r_offset): New functions.
+ (elf_link_adjust_relocs): Sort relocs. Free rel hashes after
+ sorting invalidates.
+
+ 2014-12-02 Alan Modra <amodra@xxxxxxxxx>
+ * elf64-ppc.c (OPD_NDX): Define. Use throughout for sizing/indexing
+ _opd_sec_data array, halving required memory.
+ (sort_r_offset): New function.
+ (ppc64_elf_edit_opd): Sort incoming relocs. Accept .opd
+ sections with a mix of 16 and 24 byte OPD entries. Don't
+ attempt to honour --non-overlapping-opd for .opd sections with
+ unexpected relocs. Simplify opd entry size calculations by
+ first finding the reloc for the next entry. Make edit loop
+ handle one opd entry per iteration, with an inner loop
+ handling relocs per entry.
+
+2015-01-22 Thomas Preud'homme <thomas.preudhomme@xxxxxxx>
+
+ Backport from mainline
+ 2015-01-13 Thomas Preud'homme <thomas.preudhomme@xxxxxxx>
+
+ * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use SYMBOLIC_BIND
+ to check if a symbol should be bound symbolically.
+
+2015-01-20 Chung-Lin Tang <cltang@xxxxxxxxxxxxxxxx>
+
+ Backport from master
+ * elf32-nios2.c (elf_backend_default_execstack): Define as 0.
+
+2015-01-11 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+
+ PR ld/17827
+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): For PIE,
+ only discard space for pc-relative relocs symbols which turn
+ out to need copy relocs.
+
+2015-01-05 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+
+ PR ld/17773
+ * elflink.c (bfd_elf_final_link): Assign the file position for
+ the symbol string table only there are symbols to be emitted.
+
+2014-12-23 Tristan Gingold <gingold@xxxxxxxxxxx>
+
+ * version.m4: Bump version to 2.25.0
+ * configure: Regenerate.
+
2014-12-23 Tristan Gingold <gingold@xxxxxxxxxxx>

* version.m4: Bump version to 2.25
diff --git a/binutils/bfd/aoutx.h b/binutils/bfd/aoutx.h
index 9385a98..764d163 100644
--- a/binutils/bfd/aoutx.h
+++ b/binutils/bfd/aoutx.h
@@ -203,8 +203,8 @@ reloc_howto_type howto_table_ext[] =
HOWTO (RELOC_GLOB_DAT,0, 2, 0, FALSE, 0, complain_overflow_bitfield, 0,
"GLOB_DAT", FALSE, 0, 0x00000000, FALSE),
HOWTO (RELOC_JMP_SLOT,0, 2, 0, FALSE, 0, complain_overflow_bitfield, 0,
"JMP_SLOT", FALSE, 0, 0x00000000, FALSE),
HOWTO (RELOC_RELATIVE,0, 2, 0, FALSE, 0, complain_overflow_bitfield, 0,
"RELATIVE", FALSE, 0, 0x00000000, FALSE),
- HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, 0,
"R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
- HOWTO (0, 0, 0, 0, FALSE, 0, complain_overflow_dont, 0,
"R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
+ HOWTO (0, 0, 3, 0, FALSE, 0, complain_overflow_dont, 0,
"R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
+ HOWTO (0, 0, 3, 0, FALSE, 0, complain_overflow_dont, 0,
"R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
#define RELOC_SPARC_REV32 RELOC_WDISP19
HOWTO (RELOC_SPARC_REV32, 0, 2, 32, FALSE, 0, complain_overflow_dont,
0,"R_SPARC_REV32",FALSE, 0, 0xffffffff, FALSE),
};
@@ -3816,7 +3816,7 @@ aout_link_reloc_link_order (struct aout_final_link_info
*flaginfo,

size = bfd_get_reloc_size (howto);
buf = (bfd_byte *) bfd_zmalloc (size);
- if (buf == NULL)
+ if (buf == NULL && size != 0)
return FALSE;
r = MY_relocate_contents (howto, flaginfo->output_bfd,
(bfd_vma) pr->addend, buf);
diff --git a/binutils/bfd/archive.c b/binutils/bfd/archive.c
index df37996..34a9830 100644
--- a/binutils/bfd/archive.c
+++ b/binutils/bfd/archive.c
@@ -311,8 +311,7 @@ _bfd_look_for_bfd_in_cache (bfd *arch_bfd, file_ptr filepos)
struct ar_cache *entry = (struct ar_cache *) htab_find (hash_table, &m);
if (!entry)
return NULL;
- else
- return entry->arbfd;
+ return entry->arbfd;
}
else
return NULL;
@@ -902,6 +901,10 @@ do_slurp_bsd_armap (bfd *abfd)
return FALSE;
parsed_size = mapdata->parsed_size;
free (mapdata);
+ /* PR 17512: file: 883ff754. */
+ /* PR 17512: file: 0458885f. */
+ if (parsed_size < 4)
+ return FALSE;

raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size);
if (raw_armap == NULL)
@@ -1038,12 +1041,19 @@ do_slurp_coff_armap (bfd *abfd)
}

/* OK, build the carsyms. */
- for (i = 0; i < nsymz; i++)
+ for (i = 0; i < nsymz && stringsize > 0; i++)
{
+ bfd_size_type len;
+
rawptr = raw_armap + i;
carsyms->file_offset = swap ((bfd_byte *) rawptr);
carsyms->name = stringbase;
- stringbase += strlen (stringbase) + 1;
+ /* PR 17512: file: 4a1d50c1. */
+ len = strnlen (stringbase, stringsize);
+ if (len < stringsize)
+ len ++;
+ stringbase += len;
+ stringsize -= len;
carsyms++;
}
*stringbase = 0;
@@ -1131,6 +1141,7 @@ bfd_slurp_armap (bfd *abfd)
return FALSE;
if (bfd_seek (abfd, -(file_ptr) (sizeof (hdr) + 20), SEEK_CUR) != 0)
return FALSE;
+ extname[20] = 0;
if (CONST_STRNEQ (extname, "__.SYMDEF SORTED")
|| CONST_STRNEQ (extname, "__.SYMDEF"))
return do_slurp_bsd_armap (abfd);
@@ -1964,6 +1975,9 @@ bfd_generic_stat_arch_elt (bfd *abfd, struct stat *buf)
}

hdr = arch_hdr (abfd);
+ /* PR 17512: file: 3d9e9fe9. */
+ if (hdr == NULL)
+ return -1;

#define foo(arelt, stelt, size) \
buf->stelt = strtol (hdr->arelt, &aloser, size); \
diff --git a/binutils/bfd/archive64.c b/binutils/bfd/archive64.c
index 6b87ec5..9d29b90 100644
--- a/binutils/bfd/archive64.c
+++ b/binutils/bfd/archive64.c
@@ -46,6 +46,7 @@ bfd_elf64_archive_slurp_armap (bfd *abfd)
struct areltdata *mapdata;
bfd_byte int_buf[8];
char *stringbase;
+ char *stringend;
bfd_byte *raw_armap = NULL;
carsym *carsyms;
bfd_size_type amt;
@@ -92,11 +93,18 @@ bfd_elf64_archive_slurp_armap (bfd *abfd)
ptrsize = 8 * nsymz;

amt = carsym_size + stringsize + 1;
+ if (carsym_size < nsymz || ptrsize < nsymz || amt < nsymz)
+ {
+ bfd_set_error (bfd_error_malformed_archive);
+ return FALSE;
+ }
ardata->symdefs = (struct carsym *) bfd_zalloc (abfd, amt);
if (ardata->symdefs == NULL)
return FALSE;
carsyms = ardata->symdefs;
stringbase = ((char *) ardata->symdefs) + carsym_size;
+ stringbase[stringsize] = 0;
+ stringend = stringbase + stringsize;

raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize);
if (raw_armap == NULL)
@@ -114,7 +122,8 @@ bfd_elf64_archive_slurp_armap (bfd *abfd)
{
carsyms->file_offset = bfd_getb64 (raw_armap + i * 8);
carsyms->name = stringbase;
- stringbase += strlen (stringbase) + 1;
+ if (stringbase < stringend)
+ stringbase += strlen (stringbase) + 1;
++carsyms;
}
*stringbase = '\0';
diff --git a/binutils/bfd/bfd-in.h b/binutils/bfd/bfd-in.h
index 1f80a76..1607872 100644
--- a/binutils/bfd/bfd-in.h
+++ b/binutils/bfd/bfd-in.h
@@ -292,10 +292,13 @@ typedef struct bfd_section *sec_ptr;

#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)

+#define bfd_get_section_limit_octets(bfd, sec) \
+ ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
+ ? (sec)->rawsize : (sec)->size)
+
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
- (((bfd)->direction != write_direction && (sec)->rawsize != 0 \
- ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd))
+ (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))

/* Return TRUE if input section SEC has been discarded. */
#define discarded_section(sec) \
diff --git a/binutils/bfd/bfd-in2.h b/binutils/bfd/bfd-in2.h
index c7a2bb5..bca5181 100644
--- a/binutils/bfd/bfd-in2.h
+++ b/binutils/bfd/bfd-in2.h
@@ -299,10 +299,13 @@ typedef struct bfd_section *sec_ptr;

#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)

+#define bfd_get_section_limit_octets(bfd, sec) \
+ ((bfd)->direction != write_direction && (sec)->rawsize != 0 \
+ ? (sec)->rawsize : (sec)->size)
+
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
- (((bfd)->direction != write_direction && (sec)->rawsize != 0 \
- ? (sec)->rawsize : (sec)->size) / bfd_octets_per_byte (bfd))
+ (bfd_get_section_limit_octets(bfd, sec) / bfd_octets_per_byte (bfd))

/* Return TRUE if input section SEC has been discarded. */
#define discarded_section(sec) \
diff --git a/binutils/bfd/coff-h8300.c b/binutils/bfd/coff-h8300.c
index 5ec48c9..10123d3 100644
--- a/binutils/bfd/coff-h8300.c
+++ b/binutils/bfd/coff-h8300.c
@@ -337,7 +337,7 @@ rtype2howto (arelent *internal, struct internal_reloc *dst)
internal->howto = howto_table + 19;
break;
default:
- abort ();
+ internal->howto = NULL;
break;
}
}
diff --git a/binutils/bfd/coff-h8500.c b/binutils/bfd/coff-h8500.c
index 574f956..b6a996e 100644
--- a/binutils/bfd/coff-h8500.c
+++ b/binutils/bfd/coff-h8500.c
@@ -95,7 +95,7 @@ rtype2howto (arelent * internal, struct internal_reloc *dst)
switch (dst->r_type)
{
default:
- abort ();
+ internal->howto = NULL;
break;
case R_H8500_IMM8:
internal->howto = &r_imm8;
diff --git a/binutils/bfd/coff-i860.c b/binutils/bfd/coff-i860.c
index 341183f..338ec75 100644
--- a/binutils/bfd/coff-i860.c
+++ b/binutils/bfd/coff-i860.c
@@ -467,7 +467,10 @@ static reloc_howto_type howto_table[] =
FIXME: This macro refers to symbols and asect; these are from the
calling function, not the macro arguments. */

-#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr)
+/* PR 17512: file: 0a38fb7c
+ Set an addend value, even if it is not going to be used. A tool
+ like coffdump might be used to print out the contents of the reloc. */
+#define CALC_ADDEND(abfd, ptr, reloc, cache_ptr) (cache_ptr)->addend = 0

/* We use the special COFF backend linker. */
#define coff_relocate_section _bfd_coff_generic_relocate_section
diff --git a/binutils/bfd/coff-m68k.c b/binutils/bfd/coff-m68k.c
index f7089a6..5ebf52c 100644
--- a/binutils/bfd/coff-m68k.c
+++ b/binutils/bfd/coff-m68k.c
@@ -143,6 +143,7 @@ m68k_rtype2howto (arelent *internal, int relocentry)
case R_PCRWORD: internal->howto = m68kcoff_howto_table + 4; break;
case R_PCRLONG: internal->howto = m68kcoff_howto_table + 5; break;
case R_RELLONG_NEG: internal->howto = m68kcoff_howto_table + 6;
break;
+ default: internal->howto = NULL; break;
}
}

diff --git a/binutils/bfd/coff-mcore.c b/binutils/bfd/coff-mcore.c
index 7dad44f..9f30cfc 100644
--- a/binutils/bfd/coff-mcore.c
+++ b/binutils/bfd/coff-mcore.c
@@ -273,16 +273,15 @@ mcore_coff_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
}
#undef HOW2MAP

+#define NUM_HOWTOS NUM_ELEM (mcore_coff_howto_table)
+
static reloc_howto_type *
mcore_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
const char *r_name)
{
unsigned int i;

- for (i = 0;
- i < (sizeof (mcore_coff_howto_table)
- / sizeof (mcore_coff_howto_table[0]));
- i++)
+ for (i = 0; i < NUM_HOWTOS; i++)
if (mcore_coff_howto_table[i].name != NULL
&& strcasecmp (mcore_coff_howto_table[i].name, r_name) == 0)
return &mcore_coff_howto_table[i];
@@ -290,8 +289,11 @@ mcore_coff_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
return NULL;
}

-#define RTYPE2HOWTO(cache_ptr, dst) \
- (cache_ptr)->howto = mcore_coff_howto_table + (dst)->r_type;
+#define RTYPE2HOWTO(cache_ptr, dst) \
+ ((cache_ptr)->howto = \
+ ((dst)->r_type < NUM_HOWTOS \
+ ? mcore_coff_howto_table + (dst)->r_type \
+ : NULL))

static reloc_howto_type *
coff_mcore_rtype_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
@@ -303,7 +305,7 @@ coff_mcore_rtype_to_howto (bfd * abfd ATTRIBUTE_UNUSED,
{
reloc_howto_type * howto;

- if (rel->r_type >= NUM_ELEM (mcore_coff_howto_table))
+ if (rel->r_type >= NUM_HOWTOS)
return NULL;

howto = mcore_coff_howto_table + rel->r_type;
diff --git a/binutils/bfd/coff-sparc.c b/binutils/bfd/coff-sparc.c
index 031dcd0..21d9933 100644
--- a/binutils/bfd/coff-sparc.c
+++ b/binutils/bfd/coff-sparc.c
@@ -74,7 +74,7 @@ bfd_coff_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED,

static reloc_howto_type coff_sparc_howto_table[] =
{
- HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont,
bfd_coff_generic_reloc,"R_SPARC_NONE", FALSE,0,0x00000000,TRUE),
+ HOWTO(R_SPARC_NONE, 0,3, 0,FALSE,0,complain_overflow_dont,
bfd_coff_generic_reloc,"R_SPARC_NONE", FALSE,0,0x00000000,TRUE),
HOWTO(R_SPARC_8, 0,0,
8,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8",
FALSE,0,0x000000ff,TRUE),
HOWTO(R_SPARC_16,
0,1,16,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_16",
FALSE,0,0x0000ffff,TRUE),
HOWTO(R_SPARC_32,
0,2,32,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_32",
FALSE,0,0xffffffff,TRUE),
diff --git a/binutils/bfd/coff-tic30.c b/binutils/bfd/coff-tic30.c
index 740c82c..ab95308 100644
--- a/binutils/bfd/coff-tic30.c
+++ b/binutils/bfd/coff-tic30.c
@@ -136,7 +136,7 @@ rtype2howto (arelent *internal, struct internal_reloc *dst)
internal->howto = &tic30_coff_howto_table[4];
break;
default:
- abort ();
+ internal->howto = NULL;
break;
}
}
diff --git a/binutils/bfd/coff-w65.c b/binutils/bfd/coff-w65.c
index f208730..d575f58 100644
--- a/binutils/bfd/coff-w65.c
+++ b/binutils/bfd/coff-w65.c
@@ -42,6 +42,8 @@ static reloc_howto_type howto_table[] =
HOWTO (R_W65_DP, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0,
"dp", TRUE, 0x000000ff, 0x000000ff, FALSE),
};

+#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0]))
+
/* Turn a howto into a reloc number. */

#define SELECT_RELOC(x,howto) \
@@ -61,7 +63,7 @@ static reloc_howto_type howto_table[] =
static int
select_reloc (reloc_howto_type *howto)
{
- return howto->type ;
+ return howto->type;
}

/* Code to turn a r_type into a howto ptr, uses the above howto table. */
@@ -70,7 +72,10 @@ static void
rtype2howto (arelent *internal,
struct internal_reloc *dst)
{
- internal->howto = howto_table + dst->r_type - 1;
+ if (dst->r_type > 0 && dst->r_type <= NUM_HOWTOS)
+ internal->howto = howto_table + dst->r_type - 1;
+ else
+ internal->howto = NULL;
}

#define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry)
diff --git a/binutils/bfd/coff-we32k.c b/binutils/bfd/coff-we32k.c
index d5481b8..b754815 100644
--- a/binutils/bfd/coff-we32k.c
+++ b/binutils/bfd/coff-we32k.c
@@ -53,14 +53,19 @@ static reloc_howto_type howto_table[] =
HOWTO(R_PCRLONG, 0, 2, 32, TRUE, 0, complain_overflow_signed,
0, "DISP32", TRUE, 0xffffffff,0xffffffff, FALSE),
};

+#define NUM_HOWTOS (sizeof (howto_table) / sizeof (howto_table[0]))
+
/* Turn a howto into a reloc nunmber */

#define SELECT_RELOC(x,howto) { x.r_type = howto->type; }
#define BADMAG(x) WE32KBADMAG(x)
#define WE32K 1

-#define RTYPE2HOWTO(cache_ptr, dst) \
- (cache_ptr)->howto = howto_table + (dst)->r_type;
+#define RTYPE2HOWTO(cache_ptr, dst) \
+ ((cache_ptr)->howto = \
+ ((dst)->r_type < NUM_HOWTOS \
+ ? howto_table + (dst)->r_type \
+ : NULL))

#ifndef bfd_pe_print_pdata
#define bfd_pe_print_pdata NULL
diff --git a/binutils/bfd/coff-x86_64.c b/binutils/bfd/coff-x86_64.c
index 2a21bb8..742adc2 100644
--- a/binutils/bfd/coff-x86_64.c
+++ b/binutils/bfd/coff-x86_64.c
@@ -143,6 +143,16 @@ coff_amd64_reloc (bfd *abfd,
reloc_howto_type *howto = reloc_entry->howto;
unsigned char *addr = (unsigned char *) data + reloc_entry->address;

+ /* FIXME: We do not have an end address for data, so we cannot
+ accurately range check any addresses computed against it.
+ cf: PR binutils/17512: file: 1085-1761-0.004.
+ For now we do the best that we can. */
+ if (addr < (unsigned char *) data || addr > ((unsigned char *) data) +
input_section->size)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return bfd_reloc_notsupported;
+ }
+
switch (howto->size)
{
case 0:
@@ -177,7 +187,8 @@ coff_amd64_reloc (bfd *abfd,
break;

default:
- abort ();
+ bfd_set_error (bfd_error_bad_value);
+ return bfd_reloc_notsupported;
}
}

diff --git a/binutils/bfd/coff-z80.c b/binutils/bfd/coff-z80.c
index 7b62cdf..fd68b12 100644
--- a/binutils/bfd/coff-z80.c
+++ b/binutils/bfd/coff-z80.c
@@ -81,7 +81,7 @@ rtype2howto (arelent *internal, struct internal_reloc *dst)
switch (dst->r_type)
{
default:
- abort ();
+ internal->howto = NULL;
break;
case R_IMM8:
internal->howto = &r_imm8;
diff --git a/binutils/bfd/coff-z8k.c b/binutils/bfd/coff-z8k.c
index c85713f..7f67ee8 100644
--- a/binutils/bfd/coff-z8k.c
+++ b/binutils/bfd/coff-z8k.c
@@ -85,7 +85,7 @@ rtype2howto (arelent *internal, struct internal_reloc *dst)
switch (dst->r_type)
{
default:
- abort ();
+ internal->howto = NULL;
break;
case R_IMM8:
internal->howto = &r_imm8;
diff --git a/binutils/bfd/coffcode.h b/binutils/bfd/coffcode.h
index 9990b16..2b1c3d0 100644
--- a/binutils/bfd/coffcode.h
+++ b/binutils/bfd/coffcode.h
@@ -1009,6 +1009,13 @@ handle_COMDAT (bfd * abfd,

seen_state = 1;

+ /* PR 17512: file: e2cfe54f. */
+ if (esym + bfd_coff_symesz (abfd) >= esymend)
+ {
+ _bfd_error_handler (_("%B: warning: No symbol for section
'%s' found"),
+ abfd, symname);
+ break;
+ }
/* This is the section symbol. */
bfd_coff_swap_aux_in (abfd, (esym + bfd_coff_symesz (abfd)),
isym.n_type, isym.n_sclass,
@@ -1162,7 +1169,7 @@ styp_to_sec_flags (bfd *abfd,
flagword *flags_ptr)
{
struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
- long styp_flags = internal_s->s_flags;
+ unsigned long styp_flags = internal_s->s_flags;
flagword sec_flags;
bfd_boolean result = TRUE;
bfd_boolean is_dbg = FALSE;
@@ -1185,7 +1192,7 @@ styp_to_sec_flags (bfd *abfd,
/* Process each flag bit in styp_flags in turn. */
while (styp_flags)
{
- long flag = styp_flags & - styp_flags;
+ unsigned long flag = styp_flags & - styp_flags;
char * unhandled = NULL;

styp_flags &= ~ flag;
@@ -2073,7 +2080,11 @@ coff_mkobject_hook (bfd * abfd,
#endif

if ((internal_f->f_flags & F_GO32STUB) != 0)
- coff->go32stub = (char *) bfd_alloc (abfd, (bfd_size_type) GO32_STUBSIZE);
+ {
+ coff->go32stub = (char *) bfd_alloc (abfd, (bfd_size_type)
GO32_STUBSIZE);
+ if (coff->go32stub == NULL)
+ return NULL;
+ }
if (coff->go32stub != NULL)
memcpy (coff->go32stub, internal_f->go32stub, GO32_STUBSIZE);

@@ -2278,6 +2289,8 @@ coff_set_arch_mach_hook (bfd *abfd, void * filehdr)
bfd_size_type amt = bfd_coff_symesz (abfd);

buf = bfd_malloc (amt);
+ if (buf == NULL)
+ return FALSE;
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
|| bfd_bread (buf, amt, abfd) != amt)
{
@@ -2666,10 +2679,16 @@ coff_write_relocs (bfd * abfd, int first_undef)
amt = s->reloc_count;
amt *= sizeof (arelent *);
p = bfd_malloc (amt);
- if (p == NULL && s->reloc_count > 0)
- return FALSE;
- memcpy (p, s->orelocation, (size_t) amt);
- qsort (p, s->reloc_count, sizeof (arelent *), compare_arelent_ptr);
+ if (p == NULL)
+ {
+ if (s->reloc_count > 0)
+ return FALSE;
+ }
+ else
+ {
+ memcpy (p, s->orelocation, (size_t) amt);
+ qsort (p, s->reloc_count, sizeof (arelent *), compare_arelent_ptr);
+ }
}
#endif

@@ -3151,6 +3170,15 @@ coff_compute_section_file_positions (bfd * abfd)
This repairs 'ld -r' for arm-wince-pe target. */
if (page_size == 0)
page_size = 1;
+
+ /* PR 17512: file: 0ac816d3. */
+ if (page_size < 0)
+ {
+ bfd_set_error (bfd_error_file_too_big);
+ (*_bfd_error_handler)
+ (_("%B: page size is too large (0x%x)"), abfd, page_size);
+ return FALSE;
+ }
}
else
page_size = PE_DEF_FILE_ALIGNMENT;
@@ -4526,6 +4554,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
unsigned int nbr_func;
LINENO *src;
bfd_boolean have_func;
+ bfd_boolean ret = TRUE;

BFD_ASSERT (asect->lineno == NULL);

@@ -4575,6 +4604,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
(_("%B: warning: illegal symbol index 0x%lx in line number
entry %d"),
abfd, (long) symndx, counter);
cache_ptr->line_number = -1;
+ ret = FALSE;
continue;
}

@@ -4587,6 +4617,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
(_("%B: warning: illegal symbol index 0x%lx in line number
entry %d"),
abfd, (long) symndx, counter);
cache_ptr->line_number = -1;
+ ret = FALSE;
continue;
}
sym = (coff_symbol_type *) (ent->u.syment._n._n_n._n_zeroes);
@@ -4599,6 +4630,7 @@ coff_slurp_line_table (bfd *abfd, asection *asect)
(_("%B: warning: illegal symbol in line number entry %d"),
abfd, counter);
cache_ptr->line_number = -1;
+ ret = FALSE;
continue;
}

@@ -4678,11 +4710,15 @@ coff_slurp_line_table (bfd *abfd, asection *asect)

memcpy (lineno_cache, n_lineno_cache, amt);
}
+ else
+ ret = FALSE;
bfd_release (abfd, func_table);
}
+ else
+ ret = FALSE;
}

- return TRUE;
+ return ret;
}

/* Slurp in the symbol table, converting it to generic form. Note
@@ -4697,6 +4733,7 @@ coff_slurp_symbol_table (bfd * abfd)
unsigned int *table_ptr;
bfd_size_type amt;
unsigned int number_of_symbols = 0;
+ bfd_boolean ret = TRUE;

if (obj_symbols (abfd))
return TRUE;
@@ -5012,13 +5049,14 @@ coff_slurp_symbol_table (bfd * abfd)
#if defined(TIC80COFF) || defined(TICOFF)
case C_UEXT: /* Tentative external definition. */
#endif
- case C_EXTLAB: /* External load time label. */
- case C_HIDDEN: /* Ext symbol in dmert public lib. */
default:
(*_bfd_error_handler)
(_("%B: Unrecognized storage class %d for %s symbol `%s'"),
abfd, src->u.syment.n_sclass,
dst->symbol.section->name, dst->symbol.name);
+ ret = FALSE;
+ case C_EXTLAB: /* External load time label. */
+ case C_HIDDEN: /* Ext symbol in dmert public lib. */
dst->symbol.flags = BSF_DEBUGGING;
dst->symbol.value = (src->u.syment.n_value);
break;
@@ -5046,12 +5084,13 @@ coff_slurp_symbol_table (bfd * abfd)
p = abfd->sections;
while (p)
{
- coff_slurp_line_table (abfd, p);
+ if (! coff_slurp_line_table (abfd, p))
+ return FALSE;
p = p->next;
}
}

- return TRUE;
+ return ret;
}

/* Classify a COFF symbol. A couple of targets have globally visible
@@ -5310,7 +5349,7 @@ coff_slurp_reloc_table (bfd * abfd, sec_ptr asect,
asymbol ** symbols)
static reloc_howto_type *
coff_rtype_to_howto (bfd *abfd ATTRIBUTE_UNUSED,
asection *sec ATTRIBUTE_UNUSED,
- struct internal_reloc *rel,
+ struct internal_reloc *rel ATTRIBUTE_UNUSED,
struct coff_link_hash_entry *h ATTRIBUTE_UNUSED,
struct internal_syment *sym ATTRIBUTE_UNUSED,
bfd_vma *addendp ATTRIBUTE_UNUSED)
diff --git a/binutils/bfd/coffgen.c b/binutils/bfd/coffgen.c
index a22f67a..d071d8a 100644
--- a/binutils/bfd/coffgen.c
+++ b/binutils/bfd/coffgen.c
@@ -146,8 +146,9 @@ make_a_section_from_file (bfd *abfd,
/* Compress/decompress DWARF debug sections with names: .debug_* and
.zdebug_*, after the section flags is set. */
if ((flags & SEC_DEBUGGING)
+ && strlen (name) > 7
&& ((name[1] == 'd' && name[6] == '_')
- || (name[1] == 'z' && name[7] == '_')))
+ || (strlen (name) > 8 && name[1] == 'z' && name[7] == '_')))
{
enum { nothing, compress, decompress } action = nothing;
char *new_name = NULL;
@@ -365,6 +366,10 @@ coff_object_p (bfd *abfd)
bfd_release (abfd, opthdr);
return NULL;
}
+ /* PR 17512: file: 11056-1136-0.004. */
+ if (internal_f.f_opthdr < aoutsz)
+ memset (((char *) opthdr) + internal_f.f_opthdr, 0, aoutsz -
internal_f.f_opthdr);
+
bfd_coff_swap_aouthdr_in (abfd, opthdr, (void *) &internal_a);
bfd_release (abfd, opthdr);
}
@@ -463,7 +468,10 @@ _bfd_coff_internal_syment_name (bfd *abfd,
if (strings == NULL)
return NULL;
}
- if (sym->_n._n_n._n_offset >= obj_coff_strings_len (abfd))
+ /* PR 17910: Only check for string overflow if the length has been set.
+ Some DLLs, eg those produced by Visual Studio, may not set the length
field. */
+ if (obj_coff_strings_len (abfd) > 0
+ && sym->_n._n_n._n_offset >= obj_coff_strings_len (abfd))
return NULL;
return strings + sym->_n._n_n._n_offset;
}
@@ -760,8 +768,9 @@ coff_renumber_symbols (bfd *bfd_ptr, int *first_undef)

for (symbol_index = 0; symbol_index < symbol_count; symbol_index++)
{
- coff_symbol_type *coff_symbol_ptr = coff_symbol_from (bfd_ptr,
symbol_ptr_ptr[symbol_index]);
+ coff_symbol_type *coff_symbol_ptr;

+ coff_symbol_ptr = coff_symbol_from (bfd_ptr,
symbol_ptr_ptr[symbol_index]);
symbol_ptr_ptr[symbol_index]->udata.i = symbol_index;
if (coff_symbol_ptr && coff_symbol_ptr->native)
{
@@ -805,9 +814,9 @@ coff_mangle_symbols (bfd *bfd_ptr)

for (symbol_index = 0; symbol_index < symbol_count; symbol_index++)
{
- coff_symbol_type *coff_symbol_ptr =
- coff_symbol_from (bfd_ptr, symbol_ptr_ptr[symbol_index]);
+ coff_symbol_type *coff_symbol_ptr;

+ coff_symbol_ptr = coff_symbol_from (bfd_ptr,
symbol_ptr_ptr[symbol_index]);
if (coff_symbol_ptr && coff_symbol_ptr->native)
{
int i;
@@ -1711,15 +1720,15 @@ _bfd_coff_read_string_table (bfd *abfd)
}

strings = (char *) bfd_malloc (strsize + 1);
+ if (strings == NULL)
+ return NULL;
+
/* PR 17521 file: 079-54929-0.004.
A corrupt file could contain an index that points into the first
STRING_SIZE_SIZE bytes of the string table, so make sure that
they are zero. */
memset (strings, 0, STRING_SIZE_SIZE);

- if (strings == NULL)
- return NULL;
-
if (bfd_bread (strings + STRING_SIZE_SIZE, strsize - STRING_SIZE_SIZE, abfd)
!= strsize - STRING_SIZE_SIZE)
{
@@ -1808,6 +1817,16 @@ coff_get_normalized_symtab (bfd *abfd)
symbol_ptr = internal_ptr;
internal_ptr->is_sym = TRUE;

+ /* PR 17512: file: 1353-1166-0.004. */
+ if (symbol_ptr->u.syment.n_sclass == C_FILE
+ && symbol_ptr->u.syment.n_numaux > 0
+ && raw_src + symesz + symbol_ptr->u.syment.n_numaux
+ * symesz > raw_end)
+ {
+ bfd_release (abfd, internal);
+ return NULL;
+ }
+
for (i = 0;
i < symbol_ptr->u.syment.n_numaux;
i++)
@@ -1815,7 +1834,10 @@ coff_get_normalized_symtab (bfd *abfd)
internal_ptr++;
/* PR 17512: Prevent buffer overrun. */
if (internal_ptr >= internal_end)
- return NULL;
+ {
+ bfd_release (abfd, internal);
+ return NULL;
+ }

raw_src += symesz;
bfd_coff_swap_aux_in (abfd, (void *) raw_src,
@@ -1823,6 +1845,7 @@ coff_get_normalized_symtab (bfd *abfd)
symbol_ptr->u.syment.n_sclass,
(int) i, symbol_ptr->u.syment.n_numaux,
&(internal_ptr->u.auxent));
+
internal_ptr->is_sym = FALSE;
coff_pointerize_aux (abfd, internal, symbol_ptr, i,
internal_ptr);
diff --git a/binutils/bfd/cofflink.c b/binutils/bfd/cofflink.c
index 2782795..ef9e362 100644
--- a/binutils/bfd/cofflink.c
+++ b/binutils/bfd/cofflink.c
@@ -2789,7 +2789,7 @@ _bfd_coff_reloc_link_order (bfd *output_bfd,

size = bfd_get_reloc_size (howto);
buf = (bfd_byte *) bfd_zmalloc (size);
- if (buf == NULL)
+ if (buf == NULL && size != 0)
return FALSE;

rstat = _bfd_relocate_contents (howto, output_bfd,
diff --git a/binutils/bfd/compress.c b/binutils/bfd/compress.c
index 20eef95..6a87258 100644
--- a/binutils/bfd/compress.c
+++ b/binutils/bfd/compress.c
@@ -239,6 +239,8 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec,
bfd_byte **ptr)
#endif

case COMPRESS_SECTION_DONE:
+ if (sec->contents == NULL)
+ return FALSE;
if (p == NULL)
{
p = (bfd_byte *) bfd_malloc (sz);
@@ -246,7 +248,9 @@ bfd_get_full_section_contents (bfd *abfd, sec_ptr sec,
bfd_byte **ptr)
return FALSE;
*ptr = p;
}
- memcpy (p, sec->contents, sz);
+ /* PR 17512; file: 5bc29788. */
+ if (p != sec->contents)
+ memcpy (p, sec->contents, sz);
return TRUE;

default:
diff --git a/binutils/bfd/configure b/binutils/bfd/configure
index 7016194..872dd81 100755
--- a/binutils/bfd/configure
+++ b/binutils/bfd/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.64 for bfd 2.25.
+# Generated by GNU Autoconf 2.64 for bfd 2.25.1.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software
@@ -556,8 +556,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='bfd'
PACKAGE_TARNAME='bfd'
-PACKAGE_VERSION='2.25'
-PACKAGE_STRING='bfd 2.25'
+PACKAGE_VERSION='2.25.1'
+PACKAGE_STRING='bfd 2.25.1'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

@@ -1349,7 +1349,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures bfd 2.25 to adapt to many kinds of systems.
+\`configure' configures bfd 2.25.1 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

@@ -1420,7 +1420,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of bfd 2.25:";;
+ short | recursive ) echo "Configuration of bfd 2.25.1:";;
esac
cat <<\_ACEOF

@@ -1541,7 +1541,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-bfd configure 2.25
+bfd configure 2.25.1
generated by GNU Autoconf 2.64

Copyright (C) 2009 Free Software Foundation, Inc.
@@ -2183,7 +2183,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

-It was created by bfd $as_me 2.25, which was
+It was created by bfd $as_me 2.25.1, which was
generated by GNU Autoconf 2.64. Invocation command line was

$ $0 $@
@@ -3991,7 +3991,7 @@ fi

# Define the identity of the package.
PACKAGE='bfd'
- VERSION='2.25'
+ VERSION='2.25.1'


cat >>confdefs.h <<_ACEOF
@@ -16567,7 +16567,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by bfd $as_me 2.25, which was
+This file was extended by bfd $as_me 2.25.1, which was
generated by GNU Autoconf 2.64. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
@@ -16631,7 +16631,7 @@ Report bugs to the package provider."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-bfd config.status 2.25
+bfd config.status 2.25.1
configured by $0, generated by GNU Autoconf 2.64,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //;
s/[\\""\`\$]/\\\\&/g'`\\"

diff --git a/binutils/bfd/cpu-ns32k.c b/binutils/bfd/cpu-ns32k.c
index 55ee030..cee72b3 100644
--- a/binutils/bfd/cpu-ns32k.c
+++ b/binutils/bfd/cpu-ns32k.c
@@ -585,8 +585,9 @@ _bfd_do_ns32k_reloc_contents (reloc_howto_type *howto,
switch (size)
{
default:
- case 0:
abort ();
+ case 0:
+ return bfd_reloc_ok;
case 1:
case 2:
case 4:
diff --git a/binutils/bfd/doc/ChangeLog b/binutils/bfd/doc/ChangeLog
index e2987ed..396cee4 100644
--- a/binutils/bfd/doc/ChangeLog
+++ b/binutils/bfd/doc/ChangeLog
@@ -1,3 +1,24 @@
+2015-06-21 Alan Modra <amodra@xxxxxxxxx>
+
+ * Makefile.am: Expand $<.
+ * Makefile.in: Regenerate.
+
+2015-02-11 Alan Modra <amodra@xxxxxxxxx>
+
+ Apply from master.
+ 2015-01-12 Bernd Edlinger <bernd.edlinger@xxxxxxxxxx>
+ Alan Modra <amodra@xxxxxxxxx>
+ PR 17817
+ * Makefile.am (aoutx.stamp): cp -p $srcdir/aoutx.texi to keep
+ timestamps so that makeinfo need not be installed.
+ (archive.stamp, archures.stamp, bfdt.stamp, cache.stamp,
+ coffcode.stamp, core.stamp, elf.stamp, elfcode.stamp, mmo.stamp,
+ format.stamp, libbfd.stamp, bfdio.stamp, bfdwin.stamp,
+ opncls.stamp, reloc.stamp, section.stamp, syms.stamp, targets.stamp,
+ init.stamp, hash.stamp, linker.stamp): Similarly.
+ (bfdver.texi): Use test rather than [ ] in commands.
+ * Makefile.in: Regenerate.
+
2014-08-05 Doug Evans <dje@xxxxxxxxxx>

* chew.c (skip_past_newline_1): New function.
diff --git a/binutils/bfd/doc/Makefile.am b/binutils/bfd/doc/Makefile.am
index 3f69859..c4f9d61 100644
--- a/binutils/bfd/doc/Makefile.am
+++ b/binutils/bfd/doc/Makefile.am
@@ -96,19 +96,22 @@ protos: libbfd.h libcoff.h bfd.h

aoutx.texi: aoutx.stamp ; @true
aoutx.stamp: $(srcdir)/../aoutx.h $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >aoutx.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../aoutx.h >aoutx.tmp
+ test -e aoutx.texi || test ! -f $(srcdir)/aoutx.texi || cp -p
$(srcdir)/aoutx.texi .
$(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
touch $@

archive.texi: archive.stamp ; @true
archive.stamp: $(srcdir)/../archive.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >archive.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archive.c >archive.tmp
+ test -e archive.texi || test ! -f $(srcdir)/archive.texi || cp -p
$(srcdir)/archive.texi .
$(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi
touch $@

archures.texi: archures.stamp ; @true
archures.stamp: $(srcdir)/../archures.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >archures.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
+ test -e archures.texi || test ! -f $(srcdir)/archures.texi || cp -p
$(srcdir)/archures.texi .
$(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi
touch $@

@@ -116,115 +119,134 @@ archures.stamp: $(srcdir)/../archures.c
$(srcdir)/doc.str $(MKDOC)
# bfd.texinfo on an 8.3 filesystem.
bfdt.texi: bfdt.stamp ; @true
bfdt.stamp: $(srcdir)/../bfd.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfd.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
+ test -e bfdt.texi || test ! -f $(srcdir)/bfdt.texi || cp -p
$(srcdir)/bfdt.texi .
$(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
touch $@

cache.texi: cache.stamp ; @true
cache.stamp: $(srcdir)/../cache.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >cache.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
+ test -e cache.texi || test ! -f $(srcdir)/cache.texi || cp -p
$(srcdir)/cache.texi .
$(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi
touch $@

coffcode.texi: coffcode.stamp ; @true
coffcode.stamp: $(srcdir)/../coffcode.h $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >coffcode.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../coffcode.h >coffcode.tmp
+ test -e coffcode.texi || test ! -f $(srcdir)/coffcode.texi || cp -p
$(srcdir)/coffcode.texi .
$(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
touch $@

core.texi: core.stamp ; @true
core.stamp: $(srcdir)/../corefile.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >core.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../corefile.c >core.tmp
+ test -e core.texi || test ! -f $(srcdir)/core.texi || cp -p
$(srcdir)/core.texi .
$(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi
touch $@

elf.texi: elf.stamp ; @true
elf.stamp: $(srcdir)/../elf.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >elf.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../elf.c >elf.tmp
+ test -e elf.texi || test ! -f $(srcdir)/elf.texi || cp -p
$(srcdir)/elf.texi .
$(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi
touch $@

elfcode.texi: elfcode.stamp ; @true
elfcode.stamp: $(srcdir)/../elfcode.h $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >elfcode.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../elfcode.h >elfcode.tmp
+ test -e elfcode.texi || test ! -f $(srcdir)/elfcode.texi || cp -p
$(srcdir)/elfcode.texi .
$(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
touch $@

mmo.texi: mmo.stamp ; @true
mmo.stamp: $(srcdir)/../mmo.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >mmo.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../mmo.c >mmo.tmp
+ test -e mmo.texi || test ! -f $(srcdir)/mmo.texi || cp -p
$(srcdir)/mmo.texi .
$(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi
touch $@

format.texi: format.stamp ; @true
format.stamp: $(srcdir)/../format.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >format.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../format.c >format.tmp
+ test -e format.texi || test ! -f $(srcdir)/format.texi || cp -p
$(srcdir)/format.texi .
$(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi
touch $@

libbfd.texi: libbfd.stamp ; @true
libbfd.stamp: $(srcdir)/../libbfd.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >libbfd.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
+ test -e libbfd.texi || test ! -f $(srcdir)/libbfd.texi || cp -p
$(srcdir)/libbfd.texi .
$(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
touch $@

bfdio.texi: bfdio.stamp ; @true
bfdio.stamp: $(srcdir)/../bfdio.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdio.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp
+ test -e bfdio.texi || test ! -f $(srcdir)/bfdio.texi || cp -p
$(srcdir)/bfdio.texi .
$(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi
touch $@

bfdwin.texi: bfdwin.stamp ; @true
bfdwin.stamp: $(srcdir)/../bfdwin.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdwin.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp
+ test -e bfdwin.texi || test ! -f $(srcdir)/bfdwin.texi || cp -p
$(srcdir)/bfdwin.texi .
$(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi
touch $@

opncls.texi: opncls.stamp ; @true
opncls.stamp: $(srcdir)/../opncls.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >opncls.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../opncls.c >opncls.tmp
+ test -e opncls.texi || test ! -f $(srcdir)/opncls.texi || cp -p
$(srcdir)/opncls.texi .
$(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi
touch $@

reloc.texi: reloc.stamp ; @true
reloc.stamp: $(srcdir)/../reloc.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >reloc.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../reloc.c >reloc.tmp
+ test -e reloc.texi || test ! -f $(srcdir)/reloc.texi || cp -p
$(srcdir)/reloc.texi .
$(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi
touch $@

section.texi: section.stamp ; @true
section.stamp: $(srcdir)/../section.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >section.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../section.c >section.tmp
+ test -e section.texi || test ! -f $(srcdir)/section.texi || cp -p
$(srcdir)/section.texi .
$(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi
touch $@

syms.texi: syms.stamp ; @true
syms.stamp: $(srcdir)/../syms.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >syms.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../syms.c >syms.tmp
+ test -e syms.texi || test ! -f $(srcdir)/syms.texi || cp -p
$(srcdir)/syms.texi .
$(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi
touch $@

targets.texi: targets.stamp ; @true
targets.stamp: $(srcdir)/../targets.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >targets.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../targets.c >targets.tmp
+ test -e targets.texi || test ! -f $(srcdir)/targets.texi || cp -p
$(srcdir)/targets.texi .
$(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi
touch $@

init.texi: init.stamp ; @true
init.stamp: $(srcdir)/../init.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >init.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../init.c >init.tmp
+ test -e init.texi || test ! -f $(srcdir)/init.texi || cp -p
$(srcdir)/init.texi .
$(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi
touch $@

hash.texi: hash.stamp ; @true
hash.stamp: $(srcdir)/../hash.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >hash.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../hash.c >hash.tmp
+ test -e hash.texi || test ! -f $(srcdir)/hash.texi || cp -p
$(srcdir)/hash.texi .
$(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi
touch $@

linker.texi: linker.stamp ; @true
linker.stamp: $(srcdir)/../linker.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >linker.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../linker.c >linker.tmp
+ test -e linker.texi || test ! -f $(srcdir)/linker.texi || cp -p
$(srcdir)/linker.texi .
$(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi
touch $@

@@ -316,11 +338,11 @@ bfd.h: $(BFD_H_DEP)
bfdver.texi: $(srcdir)/Makefile.in
@echo "creating $@"; \
echo "@set VERSION $(VERSION)" > bfdver.texi; \
- if [ -n "$(PKGVERSION)" ]; then \
+ if test -n "$(PKGVERSION)"; then \
echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \
fi; \
echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \
- if [ -n "$(REPORT_BUGS_TEXI)" ]; then \
+ if test -n "$(REPORT_BUGS_TEXI)"; then \
echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \
fi

diff --git a/binutils/bfd/doc/Makefile.in b/binutils/bfd/doc/Makefile.in
index 65ad42d..d194d3e 100644
--- a/binutils/bfd/doc/Makefile.in
+++ b/binutils/bfd/doc/Makefile.in
@@ -795,19 +795,22 @@ protos: libbfd.h libcoff.h bfd.h

aoutx.texi: aoutx.stamp ; @true
aoutx.stamp: $(srcdir)/../aoutx.h $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >aoutx.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../aoutx.h >aoutx.tmp
+ test -e aoutx.texi || test ! -f $(srcdir)/aoutx.texi || cp -p
$(srcdir)/aoutx.texi .
$(SHELL) $(srcdir)/../../move-if-change aoutx.tmp aoutx.texi
touch $@

archive.texi: archive.stamp ; @true
archive.stamp: $(srcdir)/../archive.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >archive.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archive.c >archive.tmp
+ test -e archive.texi || test ! -f $(srcdir)/archive.texi || cp -p
$(srcdir)/archive.texi .
$(SHELL) $(srcdir)/../../move-if-change archive.tmp archive.texi
touch $@

archures.texi: archures.stamp ; @true
archures.stamp: $(srcdir)/../archures.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >archures.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../archures.c >archures.tmp
+ test -e archures.texi || test ! -f $(srcdir)/archures.texi || cp -p
$(srcdir)/archures.texi .
$(SHELL) $(srcdir)/../../move-if-change archures.tmp archures.texi
touch $@

@@ -815,115 +818,134 @@ archures.stamp: $(srcdir)/../archures.c
$(srcdir)/doc.str $(MKDOC)
# bfd.texinfo on an 8.3 filesystem.
bfdt.texi: bfdt.stamp ; @true
bfdt.stamp: $(srcdir)/../bfd.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfd.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfd.c >bfd.tmp
+ test -e bfdt.texi || test ! -f $(srcdir)/bfdt.texi || cp -p
$(srcdir)/bfdt.texi .
$(SHELL) $(srcdir)/../../move-if-change bfd.tmp bfdt.texi
touch $@

cache.texi: cache.stamp ; @true
cache.stamp: $(srcdir)/../cache.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >cache.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../cache.c >cache.tmp
+ test -e cache.texi || test ! -f $(srcdir)/cache.texi || cp -p
$(srcdir)/cache.texi .
$(SHELL) $(srcdir)/../../move-if-change cache.tmp cache.texi
touch $@

coffcode.texi: coffcode.stamp ; @true
coffcode.stamp: $(srcdir)/../coffcode.h $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >coffcode.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../coffcode.h >coffcode.tmp
+ test -e coffcode.texi || test ! -f $(srcdir)/coffcode.texi || cp -p
$(srcdir)/coffcode.texi .
$(SHELL) $(srcdir)/../../move-if-change coffcode.tmp coffcode.texi
touch $@

core.texi: core.stamp ; @true
core.stamp: $(srcdir)/../corefile.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >core.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../corefile.c >core.tmp
+ test -e core.texi || test ! -f $(srcdir)/core.texi || cp -p
$(srcdir)/core.texi .
$(SHELL) $(srcdir)/../../move-if-change core.tmp core.texi
touch $@

elf.texi: elf.stamp ; @true
elf.stamp: $(srcdir)/../elf.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >elf.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../elf.c >elf.tmp
+ test -e elf.texi || test ! -f $(srcdir)/elf.texi || cp -p
$(srcdir)/elf.texi .
$(SHELL) $(srcdir)/../../move-if-change elf.tmp elf.texi
touch $@

elfcode.texi: elfcode.stamp ; @true
elfcode.stamp: $(srcdir)/../elfcode.h $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >elfcode.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../elfcode.h >elfcode.tmp
+ test -e elfcode.texi || test ! -f $(srcdir)/elfcode.texi || cp -p
$(srcdir)/elfcode.texi .
$(SHELL) $(srcdir)/../../move-if-change elfcode.tmp elfcode.texi
touch $@

mmo.texi: mmo.stamp ; @true
mmo.stamp: $(srcdir)/../mmo.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >mmo.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../mmo.c >mmo.tmp
+ test -e mmo.texi || test ! -f $(srcdir)/mmo.texi || cp -p
$(srcdir)/mmo.texi .
$(SHELL) $(srcdir)/../../move-if-change mmo.tmp mmo.texi
touch $@

format.texi: format.stamp ; @true
format.stamp: $(srcdir)/../format.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >format.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../format.c >format.tmp
+ test -e format.texi || test ! -f $(srcdir)/format.texi || cp -p
$(srcdir)/format.texi .
$(SHELL) $(srcdir)/../../move-if-change format.tmp format.texi
touch $@

libbfd.texi: libbfd.stamp ; @true
libbfd.stamp: $(srcdir)/../libbfd.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >libbfd.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../libbfd.c >libbfd.tmp
+ test -e libbfd.texi || test ! -f $(srcdir)/libbfd.texi || cp -p
$(srcdir)/libbfd.texi .
$(SHELL) $(srcdir)/../../move-if-change libbfd.tmp libbfd.texi
touch $@

bfdio.texi: bfdio.stamp ; @true
bfdio.stamp: $(srcdir)/../bfdio.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdio.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp
+ test -e bfdio.texi || test ! -f $(srcdir)/bfdio.texi || cp -p
$(srcdir)/bfdio.texi .
$(SHELL) $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi
touch $@

bfdwin.texi: bfdwin.stamp ; @true
bfdwin.stamp: $(srcdir)/../bfdwin.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >bfdwin.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp
+ test -e bfdwin.texi || test ! -f $(srcdir)/bfdwin.texi || cp -p
$(srcdir)/bfdwin.texi .
$(SHELL) $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi
touch $@

opncls.texi: opncls.stamp ; @true
opncls.stamp: $(srcdir)/../opncls.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >opncls.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../opncls.c >opncls.tmp
+ test -e opncls.texi || test ! -f $(srcdir)/opncls.texi || cp -p
$(srcdir)/opncls.texi .
$(SHELL) $(srcdir)/../../move-if-change opncls.tmp opncls.texi
touch $@

reloc.texi: reloc.stamp ; @true
reloc.stamp: $(srcdir)/../reloc.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >reloc.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../reloc.c >reloc.tmp
+ test -e reloc.texi || test ! -f $(srcdir)/reloc.texi || cp -p
$(srcdir)/reloc.texi .
$(SHELL) $(srcdir)/../../move-if-change reloc.tmp reloc.texi
touch $@

section.texi: section.stamp ; @true
section.stamp: $(srcdir)/../section.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >section.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../section.c >section.tmp
+ test -e section.texi || test ! -f $(srcdir)/section.texi || cp -p
$(srcdir)/section.texi .
$(SHELL) $(srcdir)/../../move-if-change section.tmp section.texi
touch $@

syms.texi: syms.stamp ; @true
syms.stamp: $(srcdir)/../syms.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >syms.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../syms.c >syms.tmp
+ test -e syms.texi || test ! -f $(srcdir)/syms.texi || cp -p
$(srcdir)/syms.texi .
$(SHELL) $(srcdir)/../../move-if-change syms.tmp syms.texi
touch $@

targets.texi: targets.stamp ; @true
targets.stamp: $(srcdir)/../targets.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >targets.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../targets.c >targets.tmp
+ test -e targets.texi || test ! -f $(srcdir)/targets.texi || cp -p
$(srcdir)/targets.texi .
$(SHELL) $(srcdir)/../../move-if-change targets.tmp targets.texi
touch $@

init.texi: init.stamp ; @true
init.stamp: $(srcdir)/../init.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >init.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../init.c >init.tmp
+ test -e init.texi || test ! -f $(srcdir)/init.texi || cp -p
$(srcdir)/init.texi .
$(SHELL) $(srcdir)/../../move-if-change init.tmp init.texi
touch $@

hash.texi: hash.stamp ; @true
hash.stamp: $(srcdir)/../hash.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >hash.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../hash.c >hash.tmp
+ test -e hash.texi || test ! -f $(srcdir)/hash.texi || cp -p
$(srcdir)/hash.texi .
$(SHELL) $(srcdir)/../../move-if-change hash.tmp hash.texi
touch $@

linker.texi: linker.stamp ; @true
linker.stamp: $(srcdir)/../linker.c $(srcdir)/doc.str $(MKDOC)
- ./$(MKDOC) -f $(srcdir)/doc.str < $< >linker.tmp
+ ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../linker.c >linker.tmp
+ test -e linker.texi || test ! -f $(srcdir)/linker.texi || cp -p
$(srcdir)/linker.texi .
$(SHELL) $(srcdir)/../../move-if-change linker.tmp linker.texi
touch $@

@@ -970,11 +992,11 @@ bfd.h: $(BFD_H_DEP)
bfdver.texi: $(srcdir)/Makefile.in
@echo "creating $@"; \
echo "@set VERSION $(VERSION)" > bfdver.texi; \
- if [ -n "$(PKGVERSION)" ]; then \
+ if test -n "$(PKGVERSION)"; then \
echo "@set VERSION_PACKAGE $(PKGVERSION)" >> bfdver.texi; \
fi; \
echo "@set UPDATED `date '+%B %Y'`" >> bfdver.texi; \
- if [ -n "$(REPORT_BUGS_TEXI)" ]; then \
+ if test -n "$(REPORT_BUGS_TEXI)"; then \
echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> bfdver.texi; \
fi

diff --git a/binutils/bfd/doc/bfdver.texi b/binutils/bfd/doc/bfdver.texi
index e854b40..2bc0516 100644
--- a/binutils/bfd/doc/bfdver.texi
+++ b/binutils/bfd/doc/bfdver.texi
@@ -1,4 +1,4 @@
-@set VERSION 2.25
+@set VERSION 2.25.1
@set VERSION_PACKAGE (GNU Binutils)
-@set UPDATED December 2014
+@set UPDATED July 2015
@set BUGURL @uref{http://www.sourceware.org/bugzilla/}
diff --git a/binutils/bfd/dwarf2.c b/binutils/bfd/dwarf2.c
index 93236a6..2ba36fd 100644
--- a/binutils/bfd/dwarf2.c
+++ b/binutils/bfd/dwarf2.c
@@ -222,6 +222,9 @@ struct comp_unit
/* The abbrev hash table. */
struct abbrev_info **abbrevs;

+ /* DW_AT_language. */
+ int lang;
+
/* Note that an error was found by comp_unit_find_nearest_line. */
int error;

@@ -553,83 +556,124 @@ read_section (bfd * abfd,
return TRUE;
}

-/* VERBATIM
- The following function up to the END VERBATIM mark are
- copied directly from dwarf2read.c. */
-
/* Read dwarf information from a buffer. */

static unsigned int
-read_1_byte (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *buf)
+read_1_byte (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *buf, bfd_byte *end)
{
+ if (buf + 1 > end)
+ return 0;
return bfd_get_8 (abfd, buf);
}

static int
-read_1_signed_byte (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *buf)
+read_1_signed_byte (bfd *abfd ATTRIBUTE_UNUSED, bfd_byte *buf, bfd_byte *end)
{
+ if (buf + 1 > end)
+ return 0;
return bfd_get_signed_8 (abfd, buf);
}

static unsigned int
-read_2_bytes (bfd *abfd, bfd_byte *buf)
+read_2_bytes (bfd *abfd, bfd_byte *buf, bfd_byte *end)
{
+ if (buf + 2 > end)
+ return 0;
return bfd_get_16 (abfd, buf);
}

static unsigned int
-read_4_bytes (bfd *abfd, bfd_byte *buf)
+read_4_bytes (bfd *abfd, bfd_byte *buf, bfd_byte *end)
{
+ if (buf + 4 > end)
+ return 0;
return bfd_get_32 (abfd, buf);
}

static bfd_uint64_t
-read_8_bytes (bfd *abfd, bfd_byte *buf)
+read_8_bytes (bfd *abfd, bfd_byte *buf, bfd_byte *end)
{
+ if (buf + 8 > end)
+ return 0;
return bfd_get_64 (abfd, buf);
}

static bfd_byte *
read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED,
bfd_byte *buf,
+ bfd_byte *end,
unsigned int size ATTRIBUTE_UNUSED)
{
+ if (buf + size > end)
+ return NULL;
return buf;
}

+/* Scans a NUL terminated string starting at BUF, returning a pointer to it.
+ Returns the number of characters in the string, *including* the NUL byte,
+ in BYTES_READ_PTR. This value is set even if the function fails. Bytes
+ at or beyond BUF_END will not be read. Returns NULL if there was a
+ problem, or if the string is empty. */
+
static char *
-read_string (bfd *abfd ATTRIBUTE_UNUSED,
- bfd_byte *buf,
- unsigned int *bytes_read_ptr)
+read_string (bfd * abfd ATTRIBUTE_UNUSED,
+ bfd_byte * buf,
+ bfd_byte * buf_end,
+ unsigned int * bytes_read_ptr)
{
- /* Return a pointer to the embedded string. */
- char *str = (char *) buf;
+ bfd_byte *str = buf;
+
+ if (buf >= buf_end)
+ {
+ * bytes_read_ptr = 0;
+ return NULL;
+ }

if (*str == '\0')
{
- *bytes_read_ptr = 1;
+ * bytes_read_ptr = 1;
return NULL;
}

- *bytes_read_ptr = strlen (str) + 1;
- return str;
+ while (buf < buf_end)
+ if (* buf ++ == 0)
+ {
+ * bytes_read_ptr = buf - str;
+ return (char *) str;
+ }
+
+ * bytes_read_ptr = buf - str;
+ return NULL;
}

-/* END VERBATIM */
+/* Reads an offset from BUF and then locates the string at this offset
+ inside the debug string section. Returns a pointer to the string.
+ Returns the number of bytes read from BUF, *not* the length of the string,
+ in BYTES_READ_PTR. This value is set even if the function fails. Bytes
+ at or beyond BUF_END will not be read from BUF. Returns NULL if there was
+ a problem, or if the string is empty. Does not check for NUL termination
+ of the string. */

static char *
read_indirect_string (struct comp_unit * unit,
bfd_byte * buf,
+ bfd_byte * buf_end,
unsigned int * bytes_read_ptr)
{
bfd_uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
char *str;

+ if (buf + unit->offset_size > buf_end)
+ {
+ * bytes_read_ptr = 0;
+ return NULL;
+ }
+
if (unit->offset_size == 4)
- offset = read_4_bytes (unit->abfd, buf);
+ offset = read_4_bytes (unit->abfd, buf, buf_end);
else
- offset = read_8_bytes (unit->abfd, buf);
+ offset = read_8_bytes (unit->abfd, buf, buf_end);

*bytes_read_ptr = unit->offset_size;

@@ -638,6 +682,8 @@ read_indirect_string (struct comp_unit * unit,
&stash->dwarf_str_buffer, &stash->dwarf_str_size))
return NULL;

+ if (offset >= stash->dwarf_str_size)
+ return NULL;
str = (char *) stash->dwarf_str_buffer + offset;
if (*str == '\0')
return NULL;
@@ -651,16 +697,23 @@ read_indirect_string (struct comp_unit * unit,
static char *
read_alt_indirect_string (struct comp_unit * unit,
bfd_byte * buf,
+ bfd_byte * buf_end,
unsigned int * bytes_read_ptr)
{
bfd_uint64_t offset;
struct dwarf2_debug *stash = unit->stash;
char *str;

+ if (buf + unit->offset_size > buf_end)
+ {
+ * bytes_read_ptr = 0;
+ return NULL;
+ }
+
if (unit->offset_size == 4)
- offset = read_4_bytes (unit->abfd, buf);
+ offset = read_4_bytes (unit->abfd, buf, buf_end);
else
- offset = read_8_bytes (unit->abfd, buf);
+ offset = read_8_bytes (unit->abfd, buf, buf_end);

*bytes_read_ptr = unit->offset_size;

@@ -684,7 +737,7 @@ read_alt_indirect_string (struct comp_unit * unit,
}
stash->alt_bfd_ptr = debug_bfd;
}
-
+
if (! read_section (unit->stash->alt_bfd_ptr,
stash->debug_sections + debug_str_alt,
NULL, /* FIXME: Do we need to load alternate symbols ? */
@@ -693,6 +746,8 @@ read_alt_indirect_string (struct comp_unit * unit,
&stash->alt_dwarf_str_size))
return NULL;

+ if (offset >= stash->alt_dwarf_str_size)
+ return NULL;
str = (char *) stash->alt_dwarf_str_buffer + offset;
if (*str == '\0')
return NULL;
@@ -730,7 +785,7 @@ read_alt_indirect_ref (struct comp_unit * unit,
}
stash->alt_bfd_ptr = debug_bfd;
}
-
+
if (! read_section (unit->stash->alt_bfd_ptr,
stash->debug_sections + debug_info_alt,
NULL, /* FIXME: Do we need to load alternate symbols ? */
@@ -739,17 +794,22 @@ read_alt_indirect_ref (struct comp_unit * unit,
&stash->alt_dwarf_info_size))
return NULL;

+ if (offset >= stash->alt_dwarf_info_size)
+ return NULL;
return stash->alt_dwarf_info_buffer + offset;
}

[ *** diff truncated: 36383 lines dropped *** ]


############################################################################

Revision: btrev43104
Commit: e2963a55e6d09d838bd84135091fbc73ffa2c2bf
URL: http://cgit.haiku-os.org/buildtools/commit/?id=e2963a55e6d0
Author: Jérôme Duval <jerome.duval@xxxxxxxxx>
Date: Fri Jul 24 19:31:12 2015 UTC

Merge binutils 2.25.1

Conflicts:
binutils/gas/configure.tgt

----------------------------------------------------------------------------


Other related posts:

  • » [haiku-commits] buildtools: btrev43104 - in binutils: bfd gas/testsuite/gas/i386 binutils . opcodes - jerome . duval