summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove broken nios2 assembler dwim support.Sandra Loosemore2014-11-2811-169/+45
| | | | | | | | | | | | | | | | | | | | | | | | 2014-11-28 Sandra Loosemore <sandra@codesourcery.com> include/opcode/ * nios2.h (NIOS2_INSN_ADDI, NIOS2_INSN_ANDI): Delete. (NIOS2_INSN_ORI, NIOS2_INSN_XORI): Delete. (NIOS2_INSN_OPTARG): Renumber. opcodes/ * nios2-opc.c (nios2_r1_opcodes): Remove deleted attributes from descriptors. gas/ * config/tc-nios2.c (can_evaluate_expr, get_expr_value): Delete. (output_addi, output_andi, output_ori, output_xori): Delete. (md_assemble): Remove calls to deleted functions. gas/testsuite/ * gas/nios2/nios2.exp: Make "movi" a list test. * gas/nios2/movi.s: Adjust comments, add another case. * gas/nios2/movi.l: New. * gas/nios2/movi.d: Delete.
* Fix prints in tests for Python 3Simon Marchi2014-11-289-30/+41
| | | | | | | | | | | | | | | | Python 3's print requires to use parentheses, so this patch adds them where they were missing. gdb/testsuite/ChangeLog: * gdb.ada/py_range.exp: Add parentheses to calls to print. * gdb.dwarf2/symtab-producer.exp: Same. * gdb.gdb/python-interrupts.exp: Same. * gdb.gdb/python-selftest.exp: Same. * gdb.python/py-linetable.exp: Same. * gdb.python/py-type.exp: Same. * gdb.python/py-value-cc.exp: Same. * gdb.python/py-value.exp: Same.
* Correct fabs and fneg insns in simulatorOleg Endo2014-11-282-3/+21
| | | | | | | | | | | | | | | | | | | | It seems that the implementation of the SH fabs and fneg insns in the simulator is not correct. They use the FP_UNARY macro which checks the FPSCR.PR setting and raises an exception if PR = 1 (double precision) and the register number is not even (i.e. a valid DF reg number). For normal unary FP insns this is fine. However, fneg and fabs perform the same (integer) operations regardless of the FPSCR.PR setting. This issue initially popped up here https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63260 I've checked some of the failing tests mentioned in GCC PR 63260 above with the patch applied and the failures go away. sim/sh/ChangeLog (tiny patch): * gencode.c (fabs, fneg): Implement as integer operation instead of using the FP_UNARY macro.
* Fix amd64 dwarf register number mapping (MMX register and higher)Pierre Muller2014-11-282-1/+13
| | | | | | | | | | | | | | | | | Dwarf register numbers are defined in "System V Application Binary Interface AMD64 Architecture Processor Supplement Draft Version 0.99.6" The amd64_dwarf_regmap array is missing the 8 MMX registers in Figure 3.36: DWARF Register Number Mapping page 57. This leads to a wrong value for the registers past this point. gdb/ChangeLog: Pushed by Joel Brobecker <brobecker@adacore.com>. * amd64-tdep.c (amd64_dwarf_regmap array): Add missing MMX registers. Tested on x86_64-linux.
* Remove (dead-code) native core file sniffers on Linux targetsUlrich Weigand2014-11-285-73/+11
| | | | | | | | | | | | | | | | | | | | | Since Andreas Arnez' recent patch series, all Linux targets install gdbarch_iterate_over_regset_sections routines. This means that on Linux native targets, old-style core sniffers are never used. Most Linux targets haven't been using such sniffers for a long time anyway, but a couple remain: ia64 and sparc use core-regset.o, and m68k installs its own core_fns. All this is now dead code, which this commit removes. gdb/ 2014-11-28 Ulrich Weigand  <uweigand@de.ibm.com> * config/ia64/linux.mh (NATDEPFILES): Remove core-regset.o. * config/sparc/linux.mh (NATDEPFILES): Likewise. * config/sparc/linux64.mh (NATDEPFILES): Likewise. * m68klinux-nat.c (fetch_core_registers): Remove. (linux_elf_core_fns): Remove. (_initialize_m68k_linux_nat): Do not call deprecated_add_core_fns.
* gdb_realpath: Rework comment about handling on Windows.Joel Brobecker2014-11-282-9/+32
| | | | | | | | | | | Rework the comment to explain why we're still relying on GetFullPathName even though gnulib ensures that canonicalize_file_name is now available on all platforms, including Windows. gdb/ChangeLog: * utils.c (gdb_realpath): Rework comment about handling on Windows.
* Import rename moduleYao Qi2014-11-2824-35/+4303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is to import rename module. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add rename. * gnulib/aclocal.m4: Re-generated. * gnulib/config.in: Re-generated. * gnulib/configure: Re-generated. * gnulib/import/Makefile.am: Re-generated. * gnulib/import/Makefile.in: Re-generated. * gnulib/import/m4/gnulib-cache.m4: Re-generated. * gnulib/import/m4/gnulib-comp.m4: Re-generated. * import/basename-lgpl.c: New file. * import/dirname-lgpl.c: New file. * import/dirname.h: New file. * import/m4/dirname.m4: New file. * import/m4/malloc.m4: New file. * import/m4/rename.m4: New file. * import/m4/rmdir.m4: New file. * import/m4/stdio_h.m4: New file. * import/malloc.c: New file. * import/rename.c: New file. * import/rmdir.c: New file. * import/same-inode.h: New file. * import/stdio.c: New file. * import/stdio.in.h: New file. * import/stripslash.c: New file.
* Use canonicalize_file_name unconditionallyYao Qi2014-11-285-69/+19
| | | | | | | | | | | | | | gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * configure.ac (AC_CHECK_FUNCS): Remove canonicalize_file_name and realpath. * config.in: Re-generated. * configure: Re-generated. * utils.c (gdb_realpath): Remove code calling realpath, canonicalize_file_name and pathconf. [!_WIN32]: Call canonicalize_file_name.
* Import canonicalize-lgplYao Qi2014-11-2821-67/+3315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is to import canonicalize-lgpl module, which provides readlpath and canonicalize_file_name. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add canonicalize-lgpl. * aclocal.m4: Re-generated. * config.in: Re-generated. * configure: Re-generated. * import/Makefile.am: Re-generated. * import/Makefile.in: Re-generated. * import/m4/gnulib-cache.m4: Re-generated. * import/m4/gnulib-comp.m4: Re-generated. * import/canonicalize-lgpl.c: New file. * import/extra/snippet/_Noreturn.h: New file. * import/m4/canonicalize.m4: New file. * import/m4/double-slash-root.m4: New file. * import/m4/eealloc.m4: New file. * import/m4/malloca.m4: New file. * import/m4/nocrash.m4: New file. * import/m4/stdlib_h.m4: New file. * import/malloca.c: New file. * import/malloca.h: New file. * import/malloca.valgrind: New file.
* Use lstat unconditionallyYao Qi2014-11-285-7/+9
| | | | | | | | | | | | | | | | | | | Since lstat gnulib module is imported, we can use it unconditionally. lstat usage was introduced by this patch https://sourceware.org/ml/gdb-patches/2012-01/msg00390.html during the review, it was suggested to import gnulib lstat module, but we didn't do that. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * configure.ac (AC_CHECK_FUNCS): Remove lstat. * config.in, configure: Regenerate. * symfile.c (find_separate_debug_file_by_debuglink): Remove code checking HAVE_LSTAT is defined.
* Import lstatYao Qi2014-11-2811-79/+400
| | | | | | | | | | | | | | | | | | | | This patch is to import lstat gnulib module. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add lstat. * gnulib/aclocal.m4: Re-generated. * gnulib/config.in: Re-generated. * gnulib/configure: Re-generated. * gnulib/import/Makefile.am: Re-generated. * gnulib/import/Makefile.in: Re-generated. * gnulib/import/m4/gnulib-cache.m4: Re-generated. * gnulib/import/m4/gnulib-comp.m4: Re-generated. * gnulib/import/lstat.c: New file. * gnulib/import/m4/lstat.m4: New file.
* Use readlink unconditionallyYao Qi2014-11-2810-15/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since readlink module is imported, we can use it unconditionally. This patch is to remove configure checks and HAVE_READLINK checks in code. It was mentioned in the patch below [RFA/commit] gdbserver: return ENOSYS if readlink not supported. https://sourceware.org/ml/gdb-patches/2012-02/msg00148.html to use readlink in gdbserver, but we chose something simple at that moment. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * configure.ac (AC_CHECK_FUNCS): Remove readlink. * config.in, configure: Re-generate. * inf-child.c (inf_child_fileio_readlink): Don't check HAVE_READLINK is defined. gdb/gdbserver: 2014-11-28 Yao Qi <yao@codesourcery.com> * configure.ac(AC_CHECK_FUNCS): Remove readlink. * config.in, configure: Re-generate. * hostio.c (handle_unlink): Remove code checking HAVE_READLINK is defined.
* Import readlinkYao Qi2014-11-2815-67/+1245
| | | | | | | | | | | | | | | | | | | | | | | | This patch is to import readlink gnulib module. stat module is imported too, but it isn't used by gdb. gdb: 2014-11-28 Yao Qi <yao@codesourcery.com> * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add readlink. * gnulib/aclocal.m4: Re-generated. * gnulib/config.in: Likewise. * gnulib/configure: Likewise. * gnulib/import/Makefile.am: Likewise. * gnulib/import/Makefile.in: Likewise. * gnulib/import/m4/gnulib-cache.m4: Likewise. * gnulib/import/m4/gnulib-comp.m4: Likewise. * gnulib/import/dosname.h: New file * gnulib/import/m4/largefile.m4: New file. * gnulib/import/m4/readlink.m4: New file. * gnulib/import/m4/stat.m4: New file. * gnulib/import/readlink.c: New file. * gnulib/import/stat.c: New file.
* Fix date in changelogYao Qi2014-11-281-1/+1
|
* Sanity checks on version sectionAlan Modra2014-11-282-12/+30
| | | | | * elf.c (_bfd_elf_slurp_version_tables): Exit loops when vn_next/ vna_next/vd_next/vda_next is zero. Correct counts.
* Don't deprecate powerpc mftb insnAlan Modra2014-11-282-7/+15
| | | | | | | | | mftb is marked phased out in the architecture manual, but we can keep it as an extended mnemonic for mftbl. * ppc-opc.c (powerpc_opcodes <mftb>): Don't deprecate for power7. (TB): Delete. (insert_tbr, extract_tbr): Validate tbr number.
* Fix build breakage on 32-bit targets with 64-bit bfdAlan Modra2014-11-282-5/+18
| | | | | | * readelf.c (get_32bit_elf_symbols): Cast bfd_size_type values to unsigned long for %lx. (get_64bit_elf_symbols, process_section_groups): Likewise.
* Match library name prefixed with sysrootYao Qi2014-11-282-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We enable systemtap probe in glibc recently, and see the following gdb fail, (gdb) set solib-absolute-prefix /. ... Stopped due to shared library event:^M Inferior loaded /./foo/bar/gdb.base/break-probes-solib.so ... (gdb) FAIL: gdb.base/break-probes.exp: run til our library loads (the program exited) $binfile_lib is /foo/bar/gdb.base/break-probes-solib.so, but the sysroot is prefixed in solib.c:solib_find, as comments described: Global variable GDB_SYSROOT is used as a prefix directory to search for shared libraries if they have an absolute path. so the output becomes "/./foo/bar/gdb.base/break-probes-solib.so", which is still correct. However, the test repeatedly continue the program and tries to match $binfile_lib, finally, the program exits and the test fails. This patch is to adjust the pattern to match $sysroot$binfile_lib instead of $binfile_lib. gdb/testsuite: 2014-11-28 Yao Qi <yao@codesourcery.com> * gdb.base/break-probes.exp: Match library name prefixed with sysroot.
* Automatic date update in version.inGDB Administrator2014-11-281-1/+1
|
* Fixes an infinite loop in readelf parsing a corrupt binary, and other minor ↵Espen Grindhaug2014-11-272-20/+80
| | | | | | | | | | | | | corrections. PR binutils/17531 * readelf.c (get_data): Move excessive length check to earlier on in the function and allow for wraparound in the arithmetic. (get_32bit_elf_symbols): Terminate early if the section size is zero. Check for an invalid sh_entsize. Check for an index section with an invalid size. (get_64bit_elf_symbols): Likewise. (process_section_groups): Check for an invalid sh_entsize.
* Update mips tests with symbol version stringH.J. Lu2014-11-277-23/+33
| | | | | | | | | | * ld-mips-elf/got-vers-1.rd: Add symbol version string to versioned symbol names in dynamic relocation. * ld-mips-elf/reloc-estimate-1.d: Likewise. * ld-mips-elf/tlsdyn-o32-1.got: Likewise. * ld-mips-elf/tlsdyn-o32-2.got: Likewise. * ld-mips-elf/tlsdyn-o32-3.got: Likewise. * ld-mips-elf/tlslib-o32-ver.got: Likewise.
* Fix test always passing in python/py-linetable.expSimon Marchi2014-11-272-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following test is found in python/py-linetable.exp: gdb_test "python print sorted(fset)" \ "\[20L, 21L, 22L, 24L, 25L, 28L, 29L, 30L, 32L, 33L, 37L, 39L, 40L, 42L, 44L, 45L, 46L\].*" \ "Test frozen set contains line numbers" I noticed that it passed when using Python 3, even though it should fail because of the missing parentheses for the call print. There needs to be more escaping of the square brackets. Currently, it is interpreted as "any one character from this big list of characters, followed by .*". When adding the required amount of backslashes, the test starts failing as it should. Moreover, both in Python 2.7 and Python 3.3 the numbers don't have the L suffix, so now the test fails because of that. Anybody knows why they were there in the first place? I just tested with Python 2.4 and there are no Ls. gdb/testsuite/ChangeLog: * gdb.python/py-linetable.exp: Escape properly sorted(fset) test expected output. Add parentheses for the call to print. Remove L suffix from integers. Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
* Fixes a few more memory access violations exposed by fuzzed binaries.Nick Clifton2014-11-273-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.
* Automatic date update in version.inGDB Administrator2014-11-271-1/+1
|
* dwarf.c handle new DWARFv5 C11, C++11 and C++14 DW_LANG constants.Mark Wielaard2014-11-272-0/+8
| | | | | | | binutils/ChangeLog * dwarf.c (read_and_display_attr_value): Handle DW_LANG_C11, DW_LANG_C_plus_plus_11 and DW_LANG_C_plus_plus_14.
* gdb.dwarf2/dw2-op-out-param.S: Fix comment.Doug Evans2014-11-262-1/+5
| | | | | | gdb/ChangeLog: * gdb.dwarf2/dw2-op-out-param.S: Fix comment.
* Update list of debug sections for --strip-debug-xxx options.Cary Coutant2014-11-262-0/+15
| | | | | | | | | | | | Add .debug_gdb_scripts, .debug_gnu_pubnames, .debug_gnu_pubtypes, and .debug_str_offsets to lists of sections to strip or keep when stripping debug info. gold/ * layout.cc (gdb_sections): Keep .debug_gdb_scripts and .debug_str_offsets; strip .debug_gnu_pubnames and .debug_gnu_pubtypes. (lines_only_debug_sections): Strip all four new sections.
* Fix for gold linking tlsdesc into an executable with -pie.Han Shen2014-11-262-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | (Also included in this patch is a minor typo fix in gold/ChangeLog.) When linking the following tlsdesc access sequence into an executable with -pie, adrp x0, :tlsdesc:tls_gd ldr x1, [x0, #:tlsdesc_lo12:tls_gd] add x0, x0, :tlsdesc_lo12:tls_gd .tlsdesccall tls_gd blr x1 mrs x1, tpidr_el0 add x0, x1, x0 ldr w0, [x0] current gold-aarch64 backend does tls-desc-gd-to-ie relaxation, into adrp x0, 1000 <__FRAME_END__+0x720> ldr x1, [x0,#4064] ;; <=== the target register should be x0 nop nop mrs x1, tpidr_el0 add x0, x1, x0 ldr w0, [x0] This code is wrong. The fix changes ldr target register into x0.
* More fixes for memory access errors triggered by attemps to examine ↵Nick Clifton2014-11-2621-78/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Recognize new DWARFv5 C11, C++11 and C++14 DW_LANG constants.Mark Wielaard2014-11-264-0/+17
| | | | | | | | | | | | gdb/ChangeLog * dwarf2read.c (set_cu_language): Recognize DW_LANG_C11, DW_LANG_C_plus_plus_11, DW_LANG_C_plus_plus_14. include/ChangeLog * dwarf2.h: Add DW_LANG_C_plus_plus_11, DW_LANG_C11 and DW_LANG_C_plus_plus_14.
* _bfd_elf_slurp_version_tables tidyAlan Modra2014-11-262-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.
* Retry powerpc gold stub grouping when groups prove too largeAlan Modra2014-11-262-132/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An unusually large number of stubs can result in the default section group size being too large; sections plus stubs exceed the range of a branch. Restarting the relaxation pass with a smaller group size can sometimes help. * powerpc.cc (struct Stub_table_owner): New. (Powerpc_relobj): Rename stub_table_ to stub_table_index_, an unsigned int vector. Update all references. (powerpc_relobj::set_stub_table): Take an unsigned int param rather than a Stub_table. Update callers. (Powerpc_relobj::clear_stub_table): New function. (Target_powerpc): Add relax_failed_, relax_fail_count_ and stub_group_size_ vars. (Target_powerpc::new_stub_table): Delete. (max_branch_delta): New function, extracted from.. (Target_powerpc::Relocate::relocate): ..here.. (Target_powerpc::Branch_info::make_stub): ..and here. Return status on whether stub created successfully. (Stub_control::Stub_control): Add "no_size_errors" param. Move default sizing to.. (Target_powerpc::do_relax): ..here. Init stub_group_size_ and reduce on relax failure. (Target_powerpc::group_sections): Add "no_size_errors" param. Use stub_group_size_. Set up group info in a temp vector, before building Stub_table vector. Account for input sections possibly already converted to relaxed sections. (Stub_table::init): Delete. Merge into.. (Stub_table::Stub_table): ..here. (Stub_table::can_reach_stub): New function. (Stub_table::add_plt_call_entry): Add "from" parameter and return true iff stub could be reached. (Stub_table::add_long_branch_entry): Similarly. Add "r_type" param too. (Stub_table::clear_stubs): Add "all" param.
* Fix Nios II prologue analyzer to handle multiple stack adjustments.Sandra Loosemore2014-11-252-8/+31
| | | | | | | | | 2014-11-25 Sandra Loosemore <sandra@codesourcery.com> gdb/ * nios2-tdep.c (nios2_analyze_prologue): Replace restriction that there can be only one stack adjustment in the prologue with tests to detect specific disallowed stack adjustments.
* Fix Nios II GDB epilogue detection to handle multiple stack adjustments.Sandra Loosemore2014-11-252-17/+47
| | | | | | | | 2014-11-25 Sandra Loosemore <sandra@codesourcery.com> gdb/ * nios2-tdep.c (nios2_in_epilogue_p): Handle multiple stack adjustments.
* Refactor Nios II GDB support to use helper functions for disassembly andSandra Loosemore2014-11-252-308/+581
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instruction matching. 2014-11-25 Sandra Loosemore <sandra@codesourcery.com> gdb/ * nios2-tdep.c (nios2_fetch_insn): Move up in file. Disassemble the instruction as well as reading it from memory. (nios2_match_add): New. (nios2_match_sub): New. (nios2_match_addi): New. (nios2_match_orhi): New. (nios2_match_stw): New. (nios2_match_ldw): New. (nios2_match_rdctl): New. (enum branch_condition): New. (nios2_match_branch): New. (nios2_match_jmpi): New. (nios2_match_calli): New. (nios2_match_jmpr): New. (nios2_match_callr): New. (nios2_match_break): New. (nios2_match_trap): New. (nios2_in_epilogue_p): Rewrite to use new functions. (nios2_analyze_prologue): Likewise. (nios2_skip_prologue): Delete unused local limit_pc. (nios2_breakpoint_from_pc): Make R1-specific encodings explicit. (nios2_get_next_pc): Rewrite to use new functions.
* [GOLD] PowerPC relaxation corner caseAlan Modra2014-11-262-0/+14
| | | | | | | | | | | It's possible for the section grouping code to decide that the last section looked at (the first section by address) doesn't fit into a group. In one case that section is already a group owner and that is handled correctly. In other cases the section should be put into its own group. Like this: * powerpc.cc (Stub_control::set_output_and_owner): New function. (Target_powerpc::group_sections): Use it.
* Automatic date update in version.inGDB Administrator2014-11-261-1/+1
|
* Add file size to ELF symbol labelling start of a binary file.Cary Coutant2014-11-253-8/+16
| | | | | | | gold/ * binary.cc (Binary_to_elf::sized_convert): Add size to _start symbol. (Binary_to_elf::write_symbol): Add st_size parameter. * binary.h (Binary_to_elf::write_symbol): Add st_size parameter.
* Fix corrupted .eh_frame section with LTO and --gc-sections.Cary Coutant2014-11-253-6/+30
| | | | | | | | | | | | | | | | When --gc-sections is turned on during an LTO link, the .eh_frame sections from deferred files are processed before those from the replacement files. As a result, the section end-cap from crtendS.o is placed ahead of the .eh_frame data from the replacement files. This patch fixes the bug by skipping the layout of the deferred sections during GC pass 2. gold/ PR gold/17639 * object.cc (Sized_relobj_file): Initialize is_deferred_layout_. (Sized_relobj_file::do_layout): Handle deferred sections properly during GC pass 1. Don't add reloc sections to deferred list twice. * object.h (Sized_relobj_file::is_deferred_layout): New function. (Sized_relobj_file::is_deferred_layout_): New data member.
* Update ld-alpha tests for securepltH.J. Lu2014-11-259-154/+167
| | | | | | | | | | | * ld-alpha/tlsbin.dd: Updated for secureplt. * ld-alpha/tlsbin.rd: Likewise. * ld-alpha/tlsbin.sd: Likewise. * ld-alpha/tlsbinr.dd: Likewise. * ld-alpha/tlsbinr.rd: Likewise. * ld-alpha/tlspic.dd: Likewise. * ld-alpha/tlspic.rd: Likewise. * ld-alpha/tlspic.sd: Likewise.
* Fix trampolines search code for conditional branchesMax Filippov2014-11-265-4/+29
| | | | | | | | | | | | | | | | | | | | | | For conditional branches that need more than one trampoline to reach its target assembler couldn't always find suitable trampoline because post-loop condition check was placed inside the loop, resulting in premature loop termination. Move check outside the loop. This fixes the following build errors seen when assembling huge files produced by gcc: Error: jump target out of range; no usable trampoline found Error: operand 1 of 'j' has out of range value '307307' 2014-11-25 Max Filippov <jcmvbkbc@gmail.com> gas/ * config/tc-xtensa.c (search_trampolines): Move post-loop condition check outside the search loop. gas/testsuite/ * gas/xtensa/trampoline.d: Add expected output for branches. * gas/xtensa/trampoline.s: Add test case for branches.
* Use get_symbol_version_string in BFD_JUMP_TABLE_SYMBOLSH.J. Lu2014-11-2537-9/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Display symbol version when dumping dynrelocsH.J. Lu2014-11-2515-206/+378
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Optimize out i386/x86-64 JUMP_SLOT relocationH.J. Lu2014-11-2512-69/+543
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Automatic date update in version.inGDB Administrator2014-11-251-1/+1
|
* Update libtool.m4 from GCC trunkH.J. Lu2014-11-2414-18/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * libtool.m4: Updated from GCC trunk. bfd/ * configure: Regenerated. binutils/ * configure: Regenerated. gas/ * configure: Regenerated. gprof/ * configure: Regenerated. ld/ * configure: Regenerated. opcodes/ * configure: Regenerated.
* Reindent code (resolve_dynamic_type_internal).Jan Kratochvil2014-11-242-20/+24
| | | | | | | gdb/ChangeLog 2014-11-24 Jan Kratochvil <jan.kratochvil@redhat.com> * gdbtypes.c (resolve_dynamic_type_internal): Reindent the code.
* [AArch64] Cortex-A53 Erratum 835769 -- sort mapsJiong Wang2014-11-242-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.
* [Hurd] Fix deallocation after proc_getprocinfo callSamuel Thibault2014-11-242-3/+14
| | | | | | | | | | 2014-11-24 Samuel Thibault <samuel.thibault@ens-lyon.org> * gdb/gnu-nat.c (inf_validate_procinfo): Multiply the number of elements pi_len by the size of the elements before calling vm_deallocate. (inf_validate_task_sc): Likewise, and properly deallocate the noise array.
* Fix dumping of function arguments.Doug Evans2014-11-232-7/+15
| | | | | | | | gdb/ChangeLog: * gdbtypes.c (print_args): Renamed from print_arg_types. Print arg number and name if present. All callers updated. (dump_fn_fieldlists): Fix indentation of args.