aboutsummaryrefslogtreecommitdiff
path: root/binutils
AgeCommit message (Collapse)AuthorFilesLines
2015-03-31Revert the AM_ZLIB change in binutilsH.J. Lu5-17/+24
* configure.ac: Revert the AM_ZLIB change. * Makefile.in: Regenerated. * aclocal.m4: Likewise. * configure: Likewise.
2015-03-31Add --with-system-zlib in binutilsH.J. Lu8-106/+59
This patch adds --with-system-zlib and remove --with-zlib in binutils. * Makefile.am (ZLIB): New. (ZLIBINC): Likewise. (AM_CFLAGS): Add $(ZLIBINC). (readelf_LDADD): Add $(ZLIB). * configure.ac (AM_ZLIB): Removed. (zlibdir): New. AC_SUBST. (zlibinc): Likewise. Add --with-system-zlib. * readelf.c: Don't check HAVE_ZLIB_H to include <zlib.h>. (uncompress_section_contents): Don't check HAVE_ZLIB_H. * Makefile.in: Regenerated. * config.in: Likewise. * configure: Likewise.
2015-03-27[Patch ]Fix bintest.s failure after previous AArch64 map symbol commitRenlin Li3-3/+11
2015-03-26 Renlin Li <renlin.li@arm.com> binutils/testsuite/ * binutils-all/readelf.s-64: Support aarch64 case. * binutils-all/readelf.ss-64: Likewise.
2015-03-19Add support for G13 and G14 flag bits in RL78 ELF binaries.Nick Clifton2-2/+11
inc * rl78.h (E_FLAG_RL78_G10): Redefine. (E_FLAG_RL78_CPU_MASK, E_FLAG_RL78_ANY_CPU, E_FLAG_RL78_G13 E_FLAG_RL78_G14): New flags. bin * readelf.c (get_machine_flags): Decode RL78's G13 and G14 flags. gas * config/tc-rl78.c (enum options): Add G13 and G14. (md_longopts): Add -mg13 and -mg14. (md_parse_option): Handle -mg13 and -mg14. (md_show_usage): List -mg13 and -mg14. * doc/c-rl78.texi: Add description of -mg13 and -mg14 options. bfd * elf32-rl78.c (rl78_cpu_name): New function. Prints the name of the RL78 core based upon the flags. (rl78_elf_merge_private_bfd_data): Handle merging of G13 and G14 flags. (rl78_elf_print_private_bfd_data): Use rl78_cpu_name. (elf32_rl78_machine): Always return bfd_mach_rl78.
2015-03-18Add a testcase for PR gas/18087H.J. Lu1-1/+1
PR gas/18087 * gas/i386/dw2-compress-1.d: Revert the last change. * gas/i386/dw2-compress-3.d: New. * gas/i386/dw2-compress-3.s: Likewise. * gas/i386/i386.exp: Run dw2-compress-3 for ELF targets.
2015-03-18Fix debug section compression so that it is only performed if it would make ↵Jon Turney2-2/+14
the section smaller. PR binutils/18087 gas * doc/as.texinfo: Note that when gas compresses debug sections the compression is only performed if it makes the section smaller. * write.c (compress_debug): Do not compress a debug section if doing so would make it larger. tests * gas/i386/dw2-compress-1.d: Do not expect the .debug_abbrev or .debug_info sections to be compressed. binu * doc/binutils.texi: Note that when objcopy compresses debug sections the compression is only performed if it makes the section smaller. bfd * coffgen.c (make_a_section_from_file): Only prepend a z to a debug section's name if the section was actually compressed. * elf.c (_bfd_elf_make_section_from_shdr): Likewise. * compress.c (bfd_init_section_compress_status): Do not compress the section if doing so would make it bigger. In such cases leave the section alone and return COMPRESS_SECTION_NONE.
2015-03-11Run objcopy --update-section test only on ELF targetsAlan Modra2-0/+9
* binutils-all/update-section.exp: Only run on ELF targets.
2015-03-10Move nothing to do warning to mainH.J. Lu2-5/+11
PR binutils/18101 * readelf.c (parse_args): Move nothing to do warning to ... (main): Here.
2015-03-10Fixes "readelf -s --wide" not returning an error status or help message.Nick Clifton2-1/+5
PR binutils/18101 * readelf.c (parse_args): Enhance check for nothing to do by accounting for the --wide option.
2015-03-10Fixes a problem with objcopy leaving temporary files and directories around ↵Nick Clifton2-6/+24
if it encounters a problem during a copy. PR binutils/17636 * objcopy.c (copy_object): Avoid calling fatal as that does not allow the parent to clean up temporary files.
2015-03-10[ARM] PR ld/16572: Remove EF_ARM_HASENTRY flagJiong Wang2-6/+5
bfd/ 2015-03-10 Yuri Gribov <y.gribov@samsung.arm> PR ld/16572 * elf32-arm.c (elf32_arm_final_link_relocate): Remove support for ELF_ARM_HASENTRY. (elf32_arm_print_private_bfd_data): Likewise. binutils/ 2015-03-10 Yuri Gribov <y.gribov@samsung.arm> PR ld/16572 * readelf.c: Remove support for ELF_ARM_HASENTRY. include/ 2015-03-10 Matthew Wahab <matthew.wahab@arm.com> PR ld/16572 * elf/arm.h (EF_ARM_HASENTRY): Remove.
2015-03-05Extend description of --add-gnu-debuglink option to explain why the file ↵Nick Clifton2-2/+45
must exist. PR binutils/18064 * doc/binutils.texi (objcopy): Extend description of --add-gnu-debuglink option to explain that the separate debug info file must exist. Add a description of what to do if the debug info file is built in one place but then installed into a separate location.
2015-03-05Fixes PR 17994 - which reported that dlltool was not deleting temporary ↵Nick Clifton2-9/+55
files if it encounters a fatal error. PR binutils/17994 * dlltool.c (temp_file_to_remove): New local array. (unlink_temp_files): New functions - unlinks any file in the temp_file_to_remove array, unless dotdeltemps is set. (gen_exp_file): Add temp files to array. (make_head): Likewise. (make_delay_head): Likewise. (make_tail): Likewise. (gen_lib_file): Call unlink_temp_files.
2015-03-03[ARM] Skip private symbol when doing objdumpJiong Wang3-0/+42
2015-03-03 Jiong Wang <jiong.wang@arm.com> opcode/ * arm-dis.c (arm_symbol_is_valid): Skip ARM private symbols. binutils/testsuite/ * binutils-all/arm/rvct_symbol.s: New testcase. * binutils-all/arm/objdump.exp: Run it.
2015-02-28objcopy: Add --update-section option.Andrew Burgess10-0/+249
New option for objcopy --update-section allows the contents of a section to be updated while maintaining the section flags, and, for ELF files, the section to segment mapping. New test uses --dump-section and --update-section to check that a section can be made larger and smaller with an update. binutils/ChangeLog: * objcopy.c (update_sections): New list. (command_line_switch): Add OPTION_UPDATE_SECTION. (copy_options): Add update-section. (copy_usage): Document new option. (is_update_section): New function. (is_strip_section_1): Add check for attempt to update and remove the same section. (copy_object): Update size and content of requested sections. (skip_section): Don't copy for updated sections. (copy_main): Handle --update-section. * doc/binutils.texi (objcopy): Add description of --update-section option. * NEWS: Mention --update-section option. binutils/testsuite/ChangeLog: * binutils-all/update-1.s: New file. * binutils-all/update-2.s: New file. * binutils-all/update-3.s: New file. * binutils-all/update-4.s: New file. * binutils-all/update-section.exp: New file.
2015-02-26Fix arithmetic overflows running srconv on fuzzed binaries.Nick Clifton2-3/+41
PR binutils/17512 * coffgrok.c (do_type): Check for an out of range tag index. Check for integer overflow computing array dimension. (do_define): Likewise.
2015-02-26objcopy: Avoid shadowing optarg.Andrew Burgess2-4/+9
In commit 7173b38a442c007a554ea200817a0eadce89c87b I used optarg as the name for a function parameter, shadowing the global of that name. This commit changes the function parameter to be called arg. binutils/ChangeLog: * objcopy.c (init_section_add): Rename optarg to arg in order to avoid shadowing a global variable.
2015-02-26Fix undefined arithmetic operations detected by -fsanitize=undefined when ↵Nick Clifton3-21/+55
running readelf on fuzzed binaries. PR binutils/17512 * dwarf.c (display_debug_loc): Pacify the undefined behaviour sanitizer by simplifying address difference calculation. (struct Frame_Chunk): Change type of cfa_offset to dwarf_vma in order to avoid arithmetic overflows. (frame_display_row): Cast cfa_offset before printing it. (display_debug_frames): Likewise. Check for an unexpected segment size. Chnage type of 'l' local to dwarf_vma and cast it back to an int when printing. (process_cu_tu_index): Tighten check for an invalid ncols value. * readelf.c (process_corefile_note_segment): Check for inote.descdata extending beyond the end of the section. (process_v850_notes): Likewise.
2015-02-26Fixes a resource exhaustion problem when running windres on a corrupt binary.Nick Clifton2-6/+18
PR binutils/17512 * resrc.c (write_rc_messagetable): Tighten check for invalid message lengths.
2015-02-26[ARM]Update for Tag_ABI_HardFP_use per EABI docTerry Guo2-1/+6
Updated how we merge and display this attribute per the latest EABI documents. bfd/ChangeLog * elf32-arm.c (elf32_arm_merge_eabi_attributes): Update how we merge Tag_ABI_HardFP_use. binutils/ChangeLog * readelf.c (arm_attr_tag_ABI_HardFP_use): Update how we display it. ld/testsuite/ChangeLog * ld-arm/attr-merge-3.attr: Remove Tag_ABI_HardFP_use. * ld-arm/attr-merge-vfp-10.d: Likewise. * ld-arm/attr-merge-vfp-10r.d: Likewise. * ld-arm/attr-merge-vfp-12.d: Likewise. * ld-arm/attr-merge-vfp-12r.d: Likewise. * ld-arm/attr-merge-vfp-13.d: Likewise. * ld-arm/attr-merge-vfp-13r.d: Likewise. * ld-arm/attr-merge-vfp-14.d: Likewise. * ld-arm/attr-merge-vfp-14r.d: Likewise. * ld-arm/attr-merge-vfp-6.d: Likewise. * ld-arm/attr-merge-vfp-6r.d: Likewise. * ld-arm/attr-merge-vfp-7.d: Likewise. * ld-arm/attr-merge-vfp-7r.d: Likewise. * ld-arm/attr-merge-vfp-8.d: Likewise. * ld-arm/attr-merge-vfp-8r.d: Likewise.
2015-02-25objcopy: Factor out some of the option parsing code.Andrew Burgess2-67/+84
This patch splits out some of the option parsing code, increasing code reuse. binutils/ChangeLog: * objcopy.c (init_section_add): New function. (section_add_load_file): New function. (copy_main): Make use of new functions.
2015-02-25avr/objdump: Support dumping .avr.prop section.Andrew Burgess2-0/+63
Add support to objdump for dumping the .avr.prop section in a structured way. binutils/ChangeLog: * od-elf32_avr.c: Add elf32-avr.h include. (OPT_AVRPROP): Define. (options[]): Add 'avr-prop' entry. (elf32_avr_help): Add avr-prop help text. (elf32_avr_dump_avr_prop): New function. (elf32_avr_dump): Add check for avr-prop. bfd/ChangeLog: * elf32-avr.h (struct avr_property_header): New strucure. (avr_elf32_load_property_records): Declare. (avr_elf32_property_record_name): Declare. * elf32-avr.c: Add bfd_stdint.h include. (retrieve_local_syms): New function. (get_elf_r_symndx_section): New function. (get_elf_r_symndx_offset): New function. (internal_reloc_compare): New function. (struct avr_find_section_data): New structure. (avr_is_section_for_address): New function. (avr_find_section_for_address): New function. (avr_elf32_load_records_from_section): New function. (avr_elf32_load_property_records): New function. (avr_elf32_property_record_name): New function. gas/testsuite/ChangeLog: * gas/avr/avr-prop-1.d: New file. * gas/avr/avr-prop-1.s: New file.
2015-02-24Adds support for generating notes in V850 binaries.Nick Clifton4-12/+222
bfd * elf32-v850.c (v850_set_note): New function. Creates a Renesas style note entry. (v850_elf_make_note_section): New function. Creates a note section. (v850_elf_create_sections): New function. Create a note section if one is not already present. (v850_elf_set_note): New function. Adds a note to a bfd. (v850_elf_copy_private_bfd_data): New function. Copies V850 notes. (v850_elf_merge_notes): New function. Merges V850 notes. (print_v850_note): New function. Displays a V850 note. (v850_elf_print_notes): New function. Displays all notes attached to a bfd. (v850_elf_merge_private_bfd_data): Call v850_elf_merge_notes. (v850_elf_print_private_bfd_data): Call v850_elf_print_notes. (v850_elf_fake_sections): Set the type of the V850 note section. * bfd-in.h (v850_elf_create_sections): Add prototype. (v850_elf_set_note): Add prototype. * bfd-in2.h: Regenerate. binutils* readelf.c (get_machine_flags): Remove deprecated V850 machine flags. (get_v850_section_type_name): New function. Handles V850 special sections. (get_section_type_name): Add support for V850. (get_v850_elf_note_type): New function. Returns the name of a V850 note. (print_v850_note): New function. Prints a V850 note. (process_v850_notes): New function. Prints V850 notes. (process_note_sections): Add support for V850. binutils/testsute * binutils-all/objcopy.exp: Skip the strip-10 test for the V850. gas * config/tc-v850.c (soft_float): New variable. (v850_data_8): New variable. (md_show_usage): Add -msoft-float/-mhard-float. (md_parse_option): Likewise. (md_begin): Set the default value of soft_float. (v850_md_end): New function. Creates a note section. * config/tc-v850.h (md_end): Define. * doc/c-v850.texi: Document -msoft-float/-mhard-float. gas/testsuite * gas/elf/elf.exp: Add special version of the section2 test for the V850. * gas/elf/section2.e-v850: New file. include/elf * v850.h (EF_RH850_SIMD): Delete deprecated flag. (EF_RH850_CACHE): Likewise. (EF_RH850_MMU): Likewise. (EF_RH850_DATA_ALIGN8): Likewise. (SHT_RENESAS_IOP): Fix typo in name. (SHT_RENESAS_INFO): Define. (V850_NOTE_SECNAME): Define. (SIZEOF_V850_NOTE): Define. (V850_NOTE_NAME): Define. (enum v850_notes): New enum. (NUM_V850_NOTES): Define. ld/ChangeLog 2015-02-24 Nick Clifton <nickc@redhat.com> * Makefile.am (ev850.c): Add dependency upon $(srcdir)/emultempl/v850elf.em. (ev850_rh850.c): Likewise. * Makefile.in: Regenerate. * emultempl/v850elf.em: New file. * emulparams/v850.sh (EXTRA_EM_FILE): Define. * emulparams/v850_rh850.sh (EXTRA_EM_FILE): Define. * scripttempl/v850.sc: Add .note.renesas section. * scripttempl/v850_rh850.sc: Likewise. ld/testsuite * ld-elf/extract-symbol-1sec.d: Expect to fail on the V850.
2015-02-24readelf: handle corrupted chains betterMike Frysinger2-10/+20
The current chain walker tries to protect itself against loops, by only works with loops of length 1: a chain that points to itself. If you have a chain longer than that (3->4->3->4->...), readelf will still hang. Since we know the max length of the chain, simply abort when we've walked more times than that. The only way that could have happened is if there was a loop.
2015-02-24Speed up the display of unwind tables by using a binary chop search to ↵Dmitry Antipov2-86/+159
locate function symbols. * readelf.c (find_symbol_for_address): Use a binary search to speed up symbol location. Skip check for function symbol type. (*_unw_aux_info): Add funtab and nfuns fields contains a sorted list of function symbols. (dump_ia64_unwind): Initialise the funtab and nfuns fields and pass them to find_symbol_for_address. (dump_hppa_unwind): Likewise. (arm_print_vma_and_name): Pass funtab to find_symbol_for_address. (dump_arm_unwind): Initialise the funtab and nfuns fields.
2015-02-24Improves the warning message produyced by objdump when it cannot load a section.Nick Clifton2-1/+7
* objdump.c (dump_section): Extend the warning message displayed when a section cannot be loaded.
2015-02-21binutils: readelf: add missing newline to warning messageMike Frysinger2-1/+6
2015-02-20S390: Support new vector register sectionsAndreas Arnez2-0/+9
The IBM z13 has new 128-bit wide vector registers v0-v31, where v0-v15 include the existing 64-bit wide floating point registers. The Linux kernel presents the vector registers as two additional register sets, one for the right halves of v0-v15 and another one for the full registers v16-v31. Thus a new core file may contain two new register note sections, and this patch adds support to binutils for them. bfd/ * elf-bfd.h (elfcore_write_s390_vxrs_low): Add prototype. (elfcore_write_s390_vxrs_high): Likewise. * elf.c (elfcore_grok_s390_vxrs_low): New function. (elfcore_grok_s390_vxrs_high): New function. (elfcore_grok_note): Call them. (elfcore_write_s390_vxrs_low): New function. (elfcore_write_s390_vxrs_high): New function. (elfcore_write_register_note): Call them. binutils/ * readelf.c (get_note_type): Add NT_S390_VXRS_LOW and NT_S390_VXRS_HIGH. include/elf/ * common.h (NT_S390_VXRS_LOW): New macro. (NT_S390_VXRS_HIGH): Likewise.
2015-02-13Fixes for memory access violations triggered by running readelf on fuzzed ↵Nick Clifton2-2/+21
binaries. PR binutils/17531 * dwarf.c (display_debug_aranges): Add check for an excessive ar_length value. (process_cu_tu_index): Check for a row * columns sum being too large.
2015-02-13Fix illegal memory access errors triggered by running srconv on fuzzed binaries.Nick Clifton3-5/+17
PR binutils/17512 * dwarf.c (read_leb128): Fix test for shift becoming too large. * coffgrok.c (do_define): Add check for type size overflow. * srconv.c (walk_tree_sfile): Check that enough sections are available before parsing. (prescan): Likewise.
2015-02-13Fix mistake in recent code to check for an unterminated leb128 number.Nick Clifton2-2/+7
* dwarf.c (read_leb128): Fix test for shift becoming too large.
2015-02-13binutils/dwarf.c white spaceAlan Modra2-305/+311
The style fix here is for num_units * sizeof * debug_information. * dwarf.c: Formatting, whitespace. (process_debug_info): Style fix.
2015-02-12oops - changelog entry accidentally omitted from previous delta.Nick Clifton1-0/+8
2015-02-11Fixes for invalid memory accesses triggered by running readelf on fuzzed ↵Nick Clifton2-15/+38
binaries. PR binutils/17531 * dwarf.c (display_debug_pubnames_worker): Work around compiler bug checking address ranges. (display_debug_frames): Likewise. (display_gdb_index): Likewise. (process_cu_tu_index): Add range check on the ncols value.
2015-02-10Fix memory access violations discovered by running readelf compiled with ↵Nick Clifton3-5/+26
undefined memory access sanitization on fuzzed binaries. PR binutils/17531 * dwarf.c (display_debug_pubnames_worker): Use dwarf_vma type for offset. * readelf.c (dump_relocations): Handle printing offsets which are MIN_INT. (process_corefile_note_segment): Add range check of the namesz field.
2015-02-10Fixes for memory access violations triggered by running readelf on fuzzed ↵Nick Clifton2-2/+14
binaries. PR binutils/17531 * dwarf.c (process_debug_info): Zero the debug information array since correct initialisation cannot be relied upon. (process_cu_tu_index): Improve range checks.
2015-02-10Fix memory access violations triggered by running objdump compiled with ↵Nick Clifton3-51/+52
out-of-bounds sanitization checking. PR binutils/17512 * dwarf.c (eh_addr_size): Use an unsigned type. (size_of_encoded_value): Return an unsigned type. (read_leb128): Break if the shift becomes too big. (process_extended_line_op): Do not read the address if the length is too long. (read_cie): Warn and fail if the pointer size or segment size are too big. * dwarf.h (DWARF2_External_LineInfo): Delete unused and incorrect structure definition. (DWARF2_External_PubNames): Likewise. (DWARF2_External_CompUnit): Likewise. (DWARF2_External_ARange): Likewise. (DWARF2_Internal_LineInfo): Use dwarf_vma type for li_prologue_length. (eh_addr_size): Update prototype. * coffcode.h (styp_to_sec_flags): Use an unsigned long type to hold the flag bits. * peXXigen.c (pe_print_reloc): Use unsigned types to hold the size and number of relocs. (pe_print_debugdata): Use a 32-bit aligned buffer to store the codeview record. * versados.c (process_otr): Check the esdid value before using it to access the EDATA.
2015-02-10Recognize new DWARF5/GCC5 DW_LANG constants for Fortran 03 and Fortran 08.Mark Wielaard2-0/+7
DWARFv5 defines and GCC5 may output two new DW_LANG constants for the Fortran 2003 and Fortran 2008 standards. Handle and display both in binutils. binutils/ChangeLog: * dwarf.c (read_and_display_attr_value): Handle DW_LANG_Fortran03 and DW_LANG_Fortran08. include/ChangeLog: * dwarf2.h: Add DW_LANG_Fortran03 and DW_LANG_Fortran08. http://dwarfstd.org/ShowIssue.php?issue=141121.1
2015-02-06Fix an invalid memory access triggered by running readelf on a fuzzed binary.Nick Clifton2-3/+4
PR binutils/17531 * readelf.c (process_mips_specific): Fail if an option has an invalid size.
2015-02-06Fix memory access violations triggered by processing fuzzed binaries with a ↵Nick Clifton2-3/+23
32-bit version of readelf, compiled on a 64-bit host. PR binutils/17531 * dwarf.c (xcmalloc): Fail if the arguments are too big. (xcrealloc): Likewise. (xcalloc2): Likewise.
2015-02-06Fixes illegal memory accesses triggereb by running a 32-bit binary version ↵Nick Clifton2-4/+13
of objdump compiled on a 64-bit host. PR binutils/17512 * dwarf.c (display_debug_frames): Fix range checks to work on 32-bit binaries complied on a 64-bit host. * peXXigen.c (rsrc_print_resource_entries): Add range check for addresses that wrap around the address space. (rsrc_parse_entry): Likewise.
2015-02-05Don't refer to optarg in dwarf.c functionAlan Modra2-1/+6
This one is passed in optarg as its argument. PR binutils/17926 * dwarf.c (dwarf_select_sections_by_letters): Don't refer to optarg.
2015-02-04More fixes for memory access violations triggered by running readelf on ↵Nick Clifton2-10/+40
fuzzed binaries. PR binutils/17531 * dwarf.c (read_and_display_attr_value): Test for a block length being so long that it wraps around to before the start of the block. (process_debug_info): Test for section_begin wrapping around to before the start of the section. (display_gdb_index): Test for num_cus being so large that the end address wraps around to before the start of the section. (process_cu_tu_index): Test for j being so large that the section index pool wraps around to before the start of the section.
2015-02-03Fix memory access violations triggered by running readelf on fuzzed binaries.Nick Clifton3-36/+114
PR binutils/17531 * dwarf.c (process_debug_info): Add range check. (display_debug_pubnames_worker): Likewise. (display_gdb_index): Fix range check. (process_cu_tu_index): Add range check. * readelf.c (get_data): Change parameter types from size_t to bfd_size_type. Add checks for loss of accuracy when casting from bfd_size_type to size_t. (get_dynamic_data): Likewise. (process_section_groups): Limit number of error messages.
2015-02-03More fixes for illegal memory accesses triggered by running objdump on ↵Nick Clifton2-1/+6
fuzzed binaries. PR binutils/17512 * objdump.c (display_any_bfd): Fail if archives nest too deeply. * 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. * 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. * 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. * peXXigen.c (pe_print_edata): Check for numeric overflow in edt fields. * tekhex.c (first_phase): Check for src pointer reaching end of buffer.
2015-01-28FT32 initial supportAlan Modra2-0/+14
FT32 is a new 32-bit RISC core developed by FTDI for embedded applications. * configure.ac: Add FT32 support. * configure: Regenerate. bfd/ * Makefile.am: Add FT32 files. * archures.c (enum bfd_architecture): Add bfd_arch_ft32. (bfd_mach_ft32): Define. (bfd_ft32_arch): Declare. (bfd_archures_list): Add bfd_ft32_arch. * config.bfd: Handle FT32. * configure.ac: Likewise. * cpu-ft32.c: New file. * elf32-ft32.c: New file. * reloc.c (BFD_RELOC_FT32_10, BFD_RELOC_FT32_20, BFD_RELOC_FT32_17, BFD_RELOC_FT32_18): Define. * targets.c (_bfd_target_vector): Add ft32_elf32_vec. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate. binutils/ * readelf.c: Add FT32 support. gas/ * Makefile.am: Add FT32 files. * config/tc-ft32.c: New file. * config/tc-ft32.h: New file. * configure.tgt: Add FT32 support. * Makefile.in: Regenerate. * po/POTFILES.in: Regenerate. gas/testsuite/ * gas/ft32/ft32.exp: New file. * gas/ft32/insn.d: New file. * gas/ft32/insn.s: New file. include/ * dis-asm.h (print_insn_ft32): Declare. include/elf/ * common.h (EM_FT32): Define. * ft32.h: New file. include/opcode/ * ft32.h: New file. ld/ * Makefile.am: Add FT32 files. * configure.tgt: Handle FT32 target. * emulparams/elf32ft32.sh: New file. * scripttempl/ft32.sc: New file. * Makefile.in: Regenerate. opcodes/ * Makefile.am: Add FT32 files. * configure.ac: Handle FT32. * disassemble.c (disassembler): Call print_insn_ft32. * ft32-dis.c: New file. * ft32-opc.c: New file. * Makefile.in: Regenerate. * configure: Regenerate. * po/POTFILES.in: Regenerate.
2015-01-27Fixes for invalid memory accesses triggered by running windres on corrupt ↵Nick Clifton4-52/+89
binaries. PR binutils/17512 * rcparse.y: Add checks to avoid integer divide by zero. * rescoff.c (read_coff_rsrc): Add check on the size of the resource section. (read_coff_res_dir): Add check on the nesting level. Check for resource names overrunning the buffer. * resrc.c (write_rc_messagetable): Update formatting. Add check of 'elen' being zero.
2015-01-27Fixes for memory access violations triggered by running addr2line on fuzzed ↵Nick Clifton2-0/+11
binaries. PR binutils/17512 * addr2line.c (slurp_symtab): If the symcount is zero, free the symbol table pointer. * 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. * elf64-ppc.c (opd_entry_value): Fail if there are no relocs available.
2015-01-27Fix memory access violations triggered by running dlltool on corrupt binaries.Nick Clifton2-1/+15
PR binutils/17512 * dlltool.c (identify_search_archive): If the last archive was the same as the current archive, terminate the loop. * pdp11.c (aout_get_external_symbols): Return false if there are no symbols.
2015-01-23Fix build errors when compiling nlmconv.c on a 32-bit host.Nick Clifton2-3/+11
* nlmconv.c (powerpc_mangle_relocs): Fix build errors introduced by recent delta, when compiling on for a 32-bit host.