aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2014-12-10Automatic date update in version.inGDB Administrator1-1/+1
2014-12-10Don't sort ld -r relocs for mipsAlan Modra8-22/+68
HI16/LO16 are deliberately put adjacent, which might mean relocs are then not sorted by r_offset. See tc-mips.c:mips_frob_file. Don't undo the HI16/LO16 sorting. 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-09More fixes for memory access violations triggered by fuzzed binaries.Nick Clifton7-31/+104
PR binutils/17512 * objdump.c (display_any_bfd): Avoid infinite loop closing and opening the same archive again and again. * 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. * 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-09ppc64_elf_edit_opd revamp, take 2Alan Modra2-16/+5
Now that ld -r relocs are sorted by the pr17666 fix, there isn't so much need to sort incoming relocs. * elf64-ppc.c (sort_r_offset): Delete. (ppc64_elf_edit_opd): Don't sort input relocs.
2014-12-09Automatic date update in version.inGDB Administrator1-1/+1
2014-12-08Automatic date update in version.inGDB Administrator1-1/+1
2014-12-07Automatic date update in version.inGDB Administrator1-1/+1
2014-12-06Add Visium support to bfdEric Botcazou14-0/+1022
bfd/ * config.bfd: Add Visium support. * configure.ac: Likewise. * configure: Regenerate. * Makefile.am (ALL_MACHINES): Add cpu-visium.lo. (ALL_MACHINES_CFILES): Add cpu-visium.c. (BFD32_BACKENDS): Add elf32-visium.lo. (BFD32_BACKENDS_CFILES): Add elf32-visium.c. * Makefile.in: Regenerate. * archures.c (DESCRIPTION): Add Visium support. (bfd_visium_arch): Declare. (bfd_archures_list): Add bfd_visium_arch. * reloc.c: Add Visium relocations. * targets.c (visium_elf32_vec): Declare. (_bfd_target_vector): Add visium_elf32_vec. * bfd-in2.h: Regenerate. * libbfd.h: Likewise. * cpu-visium.c: New file. * elf32-visium.c: Likewise. * po/SRC-POTFILES.in: Regenerate. include/elf/ * common.h (EM_VISIUM): Define. * visium.h: New file.
2014-12-06Automatic date update in version.inGDB Administrator1-1/+1
2014-12-052014-12-05 Steve Ellcey <sellcey@mips.com>Steve Ellcey2-1/+5
* ecoff.c (_bfd_ecoff_slurp_symbol_table): Add cast.
2014-12-05Define bfd_elf32_get_synthetic_symtab for x32H.J. Lu2-0/+6
* elf64-x86-64.c (bfd_elf32_get_synthetic_symtab): New.
2014-12-04Add _bfd_elf_ifunc_get_synthetic_symtabH.J. Lu5-191/+292
In i386 and x86-64 binaries with ifunc, relocations against .got.plt section may not be in the same order as entries in PLT section. This patch adds _bfd_elf_ifunc_get_synthetic_symtab. It takes a function pointer which returns an array of PLT entry symbol values. It calls the function pointer to get the PLT entry symbol value array indexed by relocation index, instead of calling plt_sym_val on each relocation index. PR binutils/17677 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): New prototype. * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): New function. * elf32-i386.c (elf_i386_plt_sym_val): Removed. (elf_backend_plt_sym_val): Likewise. (elf_i386_get_plt_sym_val): New. (elf_i386_get_synthetic_symtab): Likewise. (bfd_elf32_get_synthetic_symtab): Likewise. * elf64-x86-64.c (elf_x86_64_plt_sym_val): Removed. (elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise. (elf_backend_plt_sym_val): Likewise. (elf_x86_64_get_plt_sym_val): New. (elf_x86_64_get_synthetic_symtab): Use _bfd_elf_ifunc_get_synthetic_symtab. (bfd_elf64_get_synthetic_symtab): Don't undefine for NaCl.
2014-12-05Automatic date update in version.inGDB Administrator1-1/+1
2014-12-04Sort relocs output by ld -rAlan Modra2-0/+167
bfd/ 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 reloc hashes after sorting invalidates. ld/testsuite/ * ld-powerpc/vxworks-relax.rd: Update for reloc sorting. * ld-powerpc/vxworks-relax-2.rd: Likewise. * ld-sh/sh64/reldl32.rd: Likewise. * ld-sh/sh64/reldl64.rd: Likewise.
2014-12-04Automatic date update in version.inGDB Administrator1-1/+1
2014-12-03Fix memory access problems exposed by fuzzed binaries.Nick Clifton4-104/+54
PR binutils/17512 * objdump.c (free_debug_section): Reset the compress_status as well. * 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-03Reformat elf_x86_64_create_dynamic_sectionsH.J. Lu2-2/+5
* elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Reformat.
2014-12-02Check info->executable for symbols which need copy relocsH.J. Lu2-2/+8
* elf64-x86-64.c (elf_x86_64_relocate_section): Check info->executable for symbols which need copy relocs.
2014-12-02Discard space for relocs against symbols with copy relocsH.J. Lu2-15/+30
This patch reverts the change in elf_x86_64_check_relocs and the partial change in elf_x86_64_adjust_dynamic_symbol. Instead, we discard space in PIE for relocs against symbols which turn out to need copy relocs. * elf64-x86-64.c (elf_x86_64_check_relocs): Revert the last change. (elf_x86_64_adjust_dynamic_symbol): Don't check !info->shared with ELIMINATE_COPY_RELOCS. (elf_x86_64_allocate_dynrelocs): For PIE, discard space for relocs against symbols which turn out to need copy relocs.
2014-12-03Automatic date update in version.inGDB Administrator1-1/+1
2014-12-02X86-64: Allow copy relocs for building PIEH.J. Lu2-11/+46
This patch allows copy relocs for non-GOT pc-relative relocation in PIE. bfd/ * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Always allow copy relocs for building executables. (elf_x86_64_check_relocs): Allow copy relocs for non-GOT pc-relative relocation in shared object. (elf_x86_64_adjust_dynamic_symbol): Allocate copy relocs for PIE. (elf_x86_64_relocate_section): Don't copy a pc-relative relocation into the output file if the symbol needs copy reloc. ld/testsuite/ * ld-x86-64/copyreloc-lib.c: New file. * ld-x86-64/copyreloc-main.c: Likewise. * ld-x86-64/copyreloc-main.out: Likewise. * ld-x86-64/copyreloc-main1.rd: Likewise. * ld-x86-64/copyreloc-main2.rd: Likewise. * ld-x86-64/x86-64.exp: Run copyreloc tests.
2014-12-02[MIPS] When calculating a relocation using an undefined weak symbol don't ↵Andrew Bennett2-11/+27
check for overflow. In MIPS the relocation calculation only ignores the overflow checks for undefined weak symbols on relocations associated with j/jal. This patch extends this to the relocations used by the: b* instructions; pc/gp relative symbol offsets; and the lwpc/ldpc MIPS r6 instructions. bfd/ * elfxx-mips.c (mips_elf_calculate_relocation): Only check for overflow on non-weak undefined symbols. ld/testsuite/ * ld-mips-elf/mips-elf.exp: Add in undefined weak overflow tests for o32, n32 and n64. * ld-mips-elf/undefweak-overflow.s: New test. * ld-mips-elf/undefweak-overflow.d: New test. * ld-mips-elf/undefweak-overflow-n32.d: New test. * ld-mips-elf/undefweak-overflow-n64.d: New test.
2014-12-02ppc64_elf_edit_opd revampAlan Modra2-128/+163
This patch sorts .opd relocs (see pr17666) and allows .opd sections with a mix of 16 and 24 byte entries to be edited. * 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.
2014-12-02Automatic date update in version.inGDB Administrator1-1/+1
2014-12-01More fixes for memory access violations exposed by fuzzed binaries.Nick Clifton8-18/+97
PR binutils/17512 * dwarf.h (struct dwarf_section): Add user_data field. * dwarf.c (frame_need_space): Check for an over large register number. (display_debug_frames): Check the return value from frame_need_space. Check for a CFA expression that is so long the start address wraps around. (debug_displays): Initialise the user_data field. * objdump.c (load_specific_debug_section): Save the BFD section pointer in the user_data field of the dwarf_section structure. (free_debug_section): Update BFD section data when freeing section contents. * readelf.c (load_specific_debug_section): Initialise the user_data field. * 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. * 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. * reloc.c (bfd_perform_relocation): Avoid seg-fault if the howto parameter is NULL.
2014-12-01Automatic date update in version.inGDB Administrator1-1/+1
2014-11-30Don't output symbol version definitions for non-DT_NEEDED libsAlan Modra2-2/+13
PR 16452, 16457 * elflink.c (_bfd_elf_link_find_version_dependencies): Exclude symbols from libraries that won't be listed in DT_NEEDED. (elf_link_output_extsym): Don't output verdefs for such symbols.
2014-11-30Automatic date update in version.inGDB Administrator1-1/+1
2014-11-29Automatic date update in version.inGDB Administrator1-1/+1
2014-11-28Sanity checks on version sectionAlan Modra2-12/+30
* elf.c (_bfd_elf_slurp_version_tables): Exit loops when vn_next/ vna_next/vd_next/vda_next is zero. Correct counts.
2014-11-28Automatic date update in version.inGDB Administrator1-1/+1
2014-11-27Fixes a few more memory access violations exposed by fuzzed binaries.Nick Clifton3-1/+27
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. * elf.c (_bfd_elf_print_private_bfd_data): Fix the range check scanning the external dynamic entries.
2014-11-27Automatic date update in version.inGDB Administrator1-1/+1
2014-11-26More fixes for memory access errors triggered by attemps to examine ↵Nick Clifton19-55/+169
corrupted binaries. PR binutils/17512 * dwarf.c (display_block): Do nothing if the block starts after the end of the buffer. (read_and_display_attr_value): Add range checks. (struct Frame_Chunk): Make the ncols and ra fields unsigned. (frame_need_space): Test for an ncols of zero. (read_cie): Fail if the augmentation data extends off the end of the buffer. (display_debug_frames): Add checks for read_cie failing. Add range checks. * 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. * 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-26_bfd_elf_slurp_version_tables tidyAlan Modra2-43/+52
The internal verref buffer is allocated with bfd_zalloc, based on a count given in headers. If the headers are broken/fuzzed and contain an enormous count the alloc can result in OOM. If we first read the external verrefs (into a buffer that isn't zeroed on allocation) then the read provides a sanity check on the headers. Also prints an error for version info that fails other sanity checks. * elf.c (_bfd_elf_slurp_version_tables): Delay allocation of internal verref buffer. Error for zero sh_info. Print errors. Check for zero vd_ndx. Use bfd_zalloc for vd_auxptr buffer.
2014-11-26Automatic date update in version.inGDB Administrator1-1/+1
2014-11-25Use get_symbol_version_string in BFD_JUMP_TABLE_SYMBOLSH.J. Lu35-6/+116
This patch adds get_symbol_version_string to BFD_JUMP_TABLE_SYMBOLS so that we can use bfd_get_symbol_version_string in objdump for non-ELF targets. bfd/ * targets.c (BFD_JUMP_TABLE_SYMBOLS): Use NAME##_get_symbol_version_string. (bfd_get_symbol_version_string): New. * aout-adobe.c (aout_32_get_symbol_version_string): Define using _bfd_nosymbols define. * aout-target.h (MY_get_symbol_version_string): Likewise. * aout-tic30.c (MY_get_symbol_version_string): Likewise. * binary.c (binary_get_symbol_version_string): Likewise. * bout.c (aout_32_get_symbol_version_string): Likewise. * coff-rs6000.c (_bfd_xcoff_get_symbol_version_string): Likewise. * i386msdos.c (msdos_get_symbol_version_string): Likewise. * i386os9k.c (aout_32_get_symbol_version_string): Likewise. * ieee.c (ieee_get_symbol_version_string): Likewise. * ihex.c (ihex_get_symbol_version_string): Likewise. * libecoff.h (_bfd_ecoff_get_symbol_version_string): Likewise. * mach-o-target.c (bfd_mach_o_get_symbol_version_string): Likewise. * mmo.c (mmo_get_symbol_version_string): Likewise. * nlm-target.h (nlm_get_symbol_version_string): Likewise. * oasys.c (oasys_get_symbol_version_string): Likewise. * pef.c (bfd_pef_get_symbol_version_string): Likewise. * plugin.c (bfd_plugin_get_symbol_version_string): Likewise. * ppcboot.c (ppcboot_get_symbol_version_string): Likewise. * som.c (som_get_symbol_version_string): Likewise. * srec.c (srec_get_symbol_version_string): Likewise. * tekhex.c (tekhex_get_symbol_version_string): Likewise. * versados.c (versados_get_symbol_version_string): Likewise. * vms-alpha.c (alpha_vms_get_symbol_version_string): Likewise. * xsym.c (bfd_sym_get_symbol_version_string): Likewise. * coff64-rs6000.c (rs6000_xcoff64_vec): Use coff_get_symbol_version_string. (rs6000_xcoff64_aix_vec): Likewise. * elf-bfd.h (bfd_elf_get_symbol_version_string): Renamed to ... (_bfd_elf_get_symbol_version_string): This. * elf.c: Likewise. (bfd_elf_print_symbol): Updated. * elfxx-target.h (bfd_elfNN_get_symbol_version_string): Define. * libbfd-in.h (_bfd_nosymbols_get_symbol_version_string): Define. * libcoff-in.h (coff_get_symbol_version_string): Likewise. * bfd-in2.h: Regenerated. * libbfd.h: Likewise. * libcoff.h: Likewise. binutils/ * objdump.c (objdump_print_symname): Replace bfd_elf_get_symbol_version_string with bfd_get_symbol_version_string.
2014-11-25Display symbol version when dumping dynrelocsH.J. Lu3-38/+64
Both readelf/objdump know how to get symbol version string for dynamic symbols. This patch extracts this functionality into a separate function and uses it to add symbol version string to versioned symbol names when dumping dynamic relocations. bfd/ PR binutils/16496 * elf-bfd.h (bfd_elf_get_symbol_version_string): New. * elf.c (bfd_elf_get_symbol_version_string): New. Extracted from bfd_elf_print_symbol. (bfd_elf_print_symbol): Use it. binutils/ PR binutils/16496 * objdump.c (objdump_print_symname): Call bfd_elf_get_symbol_version_string to get ELF symbol version string. Append version string if needed. * readelf.c (versioned_symbol_info): New enum. (get_symbol_version_string): New. Extracted from process_symbol_table. (dump_relocations): Add a new argument to indicate if dynamic symbol table is used. Use get_symbol_version_string to get symbol version string for dynamic symbol. Append version string if needed. (process_relocs): Updated dump_relocations call. (process_symbol_table): Use get_symbol_version_string. ld/testsuite/ PR binutils/16496 * ld-cris/weakref3.d: Add symbol version string to versioned symbol names in dynamic relocation. * ld-cris/weakref4.d: Likewise. * ld-elfvers/vers24.rd: Likewise. * ld-elf/pr16496a.c: New file. * ld-elf/pr16496a.map: Likewise. * ld-elf/pr16496b.c: Likewise. * ld-elf/pr16496b.od: Likewise. * ld-elf/shared.exp (build_tests): Add libpr16496a.so and libpr16496b.so tests.
2014-11-25Optimize out i386/x86-64 JUMP_SLOT relocationH.J. Lu3-68/+423
When there are both PLT and GOT references to the same function symbol, linker will create a GOTPLT slot for PLT entry and a GOT slot for GOT reference. A run-time JUMP_SLOT relocation is created to update the GOTPLT slot and a run-time GLOB_DAT relocation is created to update the GOT slot. Both JUMP_SLOT and GLOB_DAT relocations will apply the same symbol value to GOTPLT and GOT slots, respectively, at run-time. This optimization combines GOTPLT and GOT slots into a single GOT slot and removes the run-time JUMP_SLOT relocation. It replaces the regular PLT entry: indirect jump [GOTPLT slot] push relocation index jump PLT0 with an GOT PLT entry with an indirect jump via the GOT slot: indirect jump [GOT slot] nop and resolves PLT reference to the GOT PLT entry. We must avoid this optimization if pointer equality is needed since we don't clear symbol value in this case and the dynamic linker won't update the GOT slot. Otherwise, the resulting binary will get into an infinite loop at run-time. bfd/ * elf32-i386.c (elf_i386_got_plt_entry): New. (elf_i386_pic_got_plt_entry): Likewise. (elf_i386_link_hash_entry): Add plt_got. (elf_i386_link_hash_table): Likewise. (elf_i386_link_hash_newfunc): Initialize plt_got.offset to -1. (elf_i386_get_local_sym_hash): Likewise. (elf_i386_check_relocs): Create the GOT PLT if there are both PLT and GOT references when the regular PLT is used. (elf_i386_allocate_dynrelocs): Use the GOT PLT if there are both PLT and GOT references unless pointer equality is needed. (elf_i386_relocate_section): Also check the GOT PLT when resolving R_386_PLT32. (elf_i386_finish_dynamic_symbol): Use the GOT PLT if it is available. * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add plt_got. (elf_x86_64_link_hash_table): Likewise. (elf_x86_64_link_hash_newfunc): Initialize plt_got.offset to -1. (elf_x86_64_get_local_sym_hash): Likewise. (elf_x86_64_check_relocs): Create the GOT PLT if there are both PLT and GOT references when the regular PLT is used. (elf_x86_64_allocate_dynrelocs): Use the GOT PLT if there are both PLT and GOT references unless pointer equality is needed. (elf_x86_64_relocate_section): Also check the GOT PLT when resolving R_X86_64_PLT32. (elf_x86_64_finish_dynamic_symbol): Use the GOT PLT if it is available. ld/ * emulparams/elf_i386.sh (TINY_READONLY_SECTION): New. * emulparams/elf_x86_64.sh (TINY_READONLY_SECTION): Add .plt.got. ld/testsuite/ * ld-i386/i386.exp: Add run-time relocation tests for plt-main. * ld-i386/plt-main.rd: New file. * ld-x86-64/plt-main-bnd.dd: Likewise. * ld-x86-64/plt-main.rd: Likewise. * ld-x86-64/x86-64.exp: Add run-time relocation tests for plt-main.
2014-11-25Automatic date update in version.inGDB Administrator1-1/+1
2014-11-24Update libtool.m4 from GCC trunkH.J. Lu2-2/+6
* libtool.m4: Updated from GCC trunk. bfd/ * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gprof/ * configure: Regenerated. ld/ * configure: Regenerated. opcodes/ * configure: Regenerated.
2014-11-24[AArch64] Cortex-A53 Erratum 835769 -- sort mapsJiong Wang2-0/+32
2014-11-24 Tejas Belagod <tejas.belagod@arm.com> bfd/ * elfnn-aarch64.c (elf_aarch64_compare_mapping): New. (erratum_835769_scan): Sort map list.
2014-11-24PowerPC64 --plt-alignAlan Modra2-1/+5
Alignment of plt stubs was broken, firstly because the option was being dropped due to the alignment value not being set in the "params" struct used in elf64-ppc.c, and secondly due to not calculating the number of alignment boundary crossings correctly. bfd/ * elf64-ppc.c (plt_stub_pad): Correct. ld/ * ld.texinfo: Correct --plt-align documentation. * emultempl/ppc64elf.em (plt_stub_align): Delete. Use and set params.plt_stub_align instead.
2014-11-24Automatic date update in version.inGDB Administrator1-1/+1
2014-11-23Assert size of elf_x86_64_{bnd|legacy}_plt2_entryH.J. Lu2-16/+12
Assert size of elf_x86_64_bnd_plt2_entry and elf_x86_64_legacy_plt2_entry only in elf_x86_64_check_relocs. * elf64-x86-64.c (elf_x86_64_check_relocs): Assert size of elf_x86_64_bnd_plt2_entry and elf_x86_64_legacy_plt2_entry. (elf_x86_64_allocate_dynrelocs): Don't assert size of elf_x86_64_bnd_plt2_entry and elf_x86_64_legacy_plt2_entry.
2014-11-23Automatic date update in version.inGDB Administrator1-1/+1
2014-11-22Check branch displacement overflow in x86-64 PLT entryH.J. Lu2-2/+15
Displacement of branch to PLT0 in x86-64 PLT entry is signed 32-bit. This patch adds a sanity check. We will only see the failure when PLT size is > 2GB. * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check branch displacement overflow in PLT entry.
2014-11-22Automatic date update in version.inGDB Administrator1-1/+1
2014-11-21Fixes for memory access violations exposed by fuzzinf various binaries.Nick Clifton8-111/+302
PR binutils/17512 * dwarf.c (get_encoded_value): Check for an encoded size of 0. (display_debug_lines_raw): Check for an invalid line range value. (display_debug_frames): Check for corrupt augmentation data. * coffgen.c (coff_get_normalized_symtab): Check for an excessive number of auxillary entries. * 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. * pei-x86_64.c (pex64_xdata_print_uwd_codes): Replace abort with an error message. (pex64_dump_xdata): Check for buffer overflows. * 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.
2014-11-21Optimize PC-relative offset overflow checkH.J. Lu2-6/+7
* elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Optimize PC-relative offset overflow check.