aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-11-04Use unique_xmalloc_ptr in find_separate_debug_file_by_debuglinkTom Tromey2-22/+19
This changes find_separate_debug_file_by_debuglink to use unique_xmalloc_ptr, removing some cleanups. gdb/ChangeLog 2017-11-04 Tom Tromey <tom@tromey.com> * symfile.c (find_separate_debug_file_by_debuglink): Use unique_xmalloc_ptr.
2017-11-04Use std::vector in compile-loc2c.cTom Tromey2-25/+24
This changes compile-loc2c.c to use std::vector, removing some cleanups. gdb/ChangeLog 2017-11-04 Tom Tromey <tom@tromey.com> * compile/compile-loc2c.c (compute_stack_depth_worker): Change type of "info". (compute_stack_depth): Likewise. (do_compile_dwarf_expr_to_c): Use std::vector.
2017-11-04Remove cleanups from link_callbacks_einfoTom Tromey2-7/+7
This removes a cleanup from link_callbacks_einfo by using std::string. gdb/ChangeLog 2017-11-04 Tom Tromey <tom@tromey.com> * compile/compile-object-load.c (link_callbacks_einfo): Use std::string.
2017-11-04Replace really_free_pendings with a scoped_ classTom Tromey6-41/+42
This introduces scoped_free_pendings, and changes users of really_free_pendings to use it instead, removing some clenaups. I tried to examine the affected code to ensure there aren't dangling cleanups in the vicinity. gdb/ChangeLog 2017-11-04 Tom Tromey <tom@tromey.com> * dwarf2read.c (process_full_comp_unit, process_full_type_unit): Use scoped_free_pendings. * dbxread.c (dbx_symfile_read, dbx_psymtab_to_symtab_1): Use scoped_free_pendings. * xcoffread.c (xcoff_psymtab_to_symtab_1): Use scoped_free_pendings. (xcoff_initial_scan): Likewise. * buildsym.c (reset_symtab_globals): Update comment. (scoped_free_pendings): Rename from really_free_pendings. (prepare_for_building): Update comment. (buildsym_init): Likewise. * buildsym.h (class scoped_free_pendings): New class. (really_free_pendings): Don't declare.
2017-11-04Automatic date update in version.inGDB Administrator1-1/+1
2017-11-03x86: Remove func_pointer_refcountH.J. Lu5-60/+60
Since check_reloc is running after gc_sections, there is no need for reference count. If a function pointer relocation can be resolved at run-time, there is no need for PLT and it doesn't count as non-GOT/PLT relocation. func_pointer_refcount can be removed. * elf32-i386.c (elf_i386_check_relocs): Set plt.refcount to 1. Don't use func_pointer_refcount. Don't set plt.refcount nor non_got_ref for function pointer reference. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. * elfxx-x86.c (elf_x86_allocate_dynrelocs): Don't use func_pointer_refcount. (_bfd_x86_elf_copy_indirect_symbol): Don't copy func_pointer_refcount. (_bfd_x86_elf_hide_symbol): Don't use func_pointer_refcount. * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): Likewise. (elf_x86_link_hash_entry): Remove func_pointer_refcount.
2017-11-03Fix regression on ARM after Target FP patchesUlrich Weigand2-1/+6
Commit edd079d9f6ca2f9ad21322b742269aec5de61190 exposed a pre-existing bug in convert_doublest_to_floatformat. In the specific case of converting a zero value to a floatformat using a "special" byteorder (i.e. neither floatformat_little nor floatformat_big), the output buffer was actually left uninitialized. gdb/ChangeLog: 2017-11-03 Ulrich Weigand <uweigand@de.ibm.com> * doublest.c (convert_doublest_to_floatformat): Fix uninitialized output when converting a zero value to a special byteorder format.
2017-11-03[ARC] Force the disassam to use the hexadecimal number for printingclaziss6-2/+40
Force printing of the short/signed values using hexadecimal representation via disassembler option. opcode/ 2017-11-03 Claudiu Zissulescu <claziss@synopsys.com> * arc-dis.c (print_hex): New variable. (parse_option): Check for hex option. (print_insn_arc): Use hexadecimal representation for short immediate values when requested. (print_arc_disassembler_options): Add hex option to the list. binutils/ 2017-11-03 Claudiu Zissulescu <claziss@synopsys.com> * doc/binutils.texi (ARC): Update disassembler options. * testsuite/binutils-all/arc/hexprint.s: New file. * testsuite/binutils-all/arc/objdump.exp: Test hex printing feature.
2017-11-03Add option for Qualcomm Saphira partSiddhesh Poyarekar3-0/+10
This adds an option for the Qualcomm saphira core, the corresponding gcc patch is here: https://gcc.gnu.org/ml/gcc-patches/2017-10/msg02055.html This was tested with an aarch64 build and make check and also by building and running SPEC2006. gas/ * config/tc-aarch64.c (aarch64_cpus): Add saphira. * doc/c-aarch64.texi: Likewise.
2017-11-03Fix integer overflow problems when reading an ELF binary with corrupt ↵Nick Clifton2-25/+50
augmentation data. PR 22386 * dwarf.c (read_cie): Use bfd_size_type for augmentation_data_len. (display_augmentation_data): New function. (display_debug_frames): Use it. Check for integer overflow when testing augmentation_data_len.
2017-11-03[ARC] Sync opcode data base.claziss3-1588/+3455
New EM and HS variants are developed, sync the data base to match them. opcodes/ 2017-11-03 Claudiu Zissulescu <claziss@synopsys.com> * arc-tbl.h (abss, abssh, adc, adcs, adds, aslacc, asls, aslsacc) (asrs, asrsr, cbflyhf0r, cbflyhf1r, cmacchfr, cmacchnfr, cmachfr) (cmachnfr, cmpychfr, cmpychnfr, cmpyhfmr, cmpyhfr, cmpyhnfr, divf) (dmachbl, dmachbm, dmachf, dmachfr, dmacwhf, dmpyhbl, dmpyhbm) (dmpyhf, dmpyhfr, dmpyhwf, dmpywhf, dsync, flagacc, getacc, macdf) (macf, macfr, macwhfl, macwhflr, macwhfm, macwhfmr, macwhkl) (macwhkul, macwhl, macwhul, mpydf, mpyf, mpyfr, mpywhfl, mpywhflr) (mpywhfm, mpywhfmr, mpywhkl, mpywhkul, mpywhl, mpywhul, msubdf) (msubf, msubfr, msubwhfl, msubwhflr, msubwhfm, msubwhfmr, mul64) (negs, negsh, normacc, qmachf, qmpyh, qmpyhf, rndh, satf, sath) (sbcs, setacc, sflag, sqrt, sqrtf, subs, swi_s, vabs2h, vabss2h) (vadd4b, vadds2, vadds2h, vadds4h, vaddsubs, vaddsubs2h) (vaddsubs4h, valgn2h, vasl2h, vasls2h, vasr2h, vasrs2h, vasrsr2h) (vext2bhl, vext2bhlf, vext2bhm, vext2bhmf, vlsr2h, vmac2hf) (vmac2hfr, vmac2hnfr, vmax2h, vmin2h, vmpy2h, vmpy2hf, vmpy2hfr) (vmpy2hwf, vmsub2hf, vmsub2hfr, vmsub2hnfr, vneg2h, vnegs2h) (vnorm2h, vpack2hbl, vpack2hblf, vpack2hbm, vpack2hbmf, vpack2hl) (vpack2hm, vperm, vrep2hl, vrep2hm, vsext2bhl, vsext2bhm, vsub4b) (vsubadds, vsubadds2h, vsubadds4h, vsubs2, vsubs2h, vsubs4h): Changed opcodes. (prealloc, prefetch*): Place them before ld instruction. * arc-opc.c (skip_this_opcode): Add ARITH class.
2017-11-03Skip gdb.mi/list-thread-groups-available.exp if no xml supportYao Qi2-0/+11
I see the following test fail in gdb (configured --with-expat=no), -list-thread-groups --available^M &"warning: Can not parse XML OS data; XML support was disabled at compile time\n"^M ^error,msg="Can not fetch data now."^M (gdb) ^M FAIL: gdb.mi/list-thread-groups-available.exp: list available thread groups (unexpected output) This patch skips it if XML parsing in GDB is disabled, like what you did in gdb.mi/mi-info-os.exp. gdb/testsuite: 2017-11-03 Yao Qi <yao.qi@linaro.org> * gdb.mi/list-thread-groups-available.exp: Skip it if XML parsing in GDB is disabled.
2017-11-03Fix excessive memory allocation attempts and possible integer overfloaws ↵Nick Clifton2-2/+23
when attempting to read a COFF binary with a corrupt symbol count. PR 22385 * coffgen.c (_bfd_coff_get_external_symbols): Check for an overlarge raw syment count. (coff_get_normalized_symtab): Likewise.
2017-11-03Skip gdb.python/py-thrhandle.exp if python is not enabled.Yao Qi2-0/+9
gdb/testsuite: 2017-11-03 Yao Qi <yao.qi@linaro.org> * gdb.python/py-thrhandle.exp: Skip it if python is not enabled.
2017-11-03Automatic date update in version.inGDB Administrator1-1/+1
2017-11-02aarch64: Remove AARCH64_FEATURE_F16 from AARCH64_ARCH_V8_2Siddhesh Poyarekar2-1/+5
The FP16 feature is optional in ARMv8.2, so it is wrong to add it to the default AARCH64_ARCH_V8_2 feature flags. This patch makes the behaviour consistent with that of gcc, which also does not assume FP16 for ARMv8.2. include/ * opcode/aarch64.h (AARCH64_ARCH_V8_2): Drop AARCH64_FEATURE_F16.
2017-11-02Work around integer overflows when readelf is checking for corrupt ELF notes ↵Mingi Cho2-16/+23
when run on a 32-bit host. PR 22384 * readelf.c (print_gnu_property_note): Improve overflow checks so that they will work on a 32-bit host.
2017-11-02Construct readonly regcache without address spaceYao Qi6-12/+18
The address space is useless to readonly regcache, so this patch removes the parameter to construct readonly regcache. address_space was added in regcache by 6c95b8d, but for read-write regcache. regcache::aspace is used for various breakpoint/watchpoint checking, and these regcache are not read-only regcache. gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * frame.c (do_frame_register_read): Remove aspace. * jit.c (jit_frame_sniffer): Likwise. * ppc-linux-tdep.c (ppu2spu_sniffer): Likewise. * regcache.c (regcache::regcache): Pass nullptr. (regcache_print): Caller updated. * regcache.h (regcache::regcache): Remove one constructor parameter aspace.
2017-11-02const-fy regcache::m_readonly_pYao Qi2-1/+5
gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * regcache.h (regcache) <m_readonly_p>: Change it to const bool.
2017-11-02const-fy regcache::m_aspaceYao Qi11-31/+56
regcache::m_aspace is a const, never changed during the lifetime of regcache object. The address_space object is a const object too. gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * breakpoint.c (insert_single_step_breakpoints): Update. * frame.c (struct frame_info) <aspace>: Add const. (frame_save_as_regcache): Add const. (get_frame_address_space): Return const address_space *. * frame.h (get_frame_address_space): Update declaration. * infrun.c (struct step_over_info) <aspace>: Add const. (set_step_over_info): Make aspace const. (displaced_step_prepare_throw): Change variable const. (resume): Likewise. (proceed): Likewise. (adjust_pc_after_break): Likewise. (save_waitstatus): Likewise. (handle_signal_stop): Likewise. (keep_going_pass_signal): Likewise. * jit.c (jit_frame_sniffer): Add const. * mips-tdep.c (mips_single_step_through_delay): Likewise. * ppc-linux-tdep.c (ppu2spu_sniffer): Likewise. * record-full.c (record_full_wait_1): Likewise. * regcache.c (regcache::regcache): Change parameter to const. * regcache.h (regcache::regcache): Likewise. (regcache::aspace): Return const address_space *. (regcache) <m_aspace>: Add const.
2017-11-02s/get_regcache_aspace (regcache)/regcache->aspace ()/gYao Qi8-36/+50
and remove get_regcache_aspace. gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * darwin-nat.c (cancel_breakpoint): Use regcache->aspace (). * frame.c (create_sentinel_frame): Likewise. * infrun.c (displaced_step_prepare_throw): Likewise. (resume): Likewise. (thread_still_needs_step_over_bp): Likewise. (proceed): Likewise. (do_target_wait): Likewise. (adjust_pc_after_break): Likewise. (handle_syscall_event): Likewise. (save_waitstatus): Likewise. (handle_inferior_event_1): Likewise. (handle_signal_stop): Likewise. (keep_going_pass_signal): Likewise. * linux-nat.c (status_callback): Likewise. (save_stop_reason): Likewise. (resume_stopped_resumed_lwps): Likewise. * record-full.c (record_full_exec_insn): Likewise. (record_full_wait_1): Likewise. * regcache.c (get_regcache_aspace): Remove. * regcache.h (get_regcache_aspace): Remove.
2017-11-02Remove regcache_descr::nr_raw_registersYao Qi3-13/+32
struct regcache_descr has fields nr_raw_registers and gdbarch, and nr_raw_registers can be got via gdbarch_num_regs (gdbarch), so it looks nr_raw_registers is redundant. This patch removes it and adds a protected method num_raw_registers. gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * regcache.c (struct regcache_descr) <nr_raw_registers>: Remove. (init_regcache_descr): Use gdbarch_num_regs. (regcache::regcache): Likewise. (regcache::get_register_status): Likewise. (regcache::assert_raw_regnum): Likewise. (regcache::cooked_read): Likewise. (regcache::cooked_read_value): Likewise. (regcache::cooked_write): Likewise. (regcache::dump): Likewise. (regcache::num_raw_registers): New method. * regcache.h (class regcache) <num_raw_registers>: New.
2017-11-02New method regcache::assert_regnumYao Qi3-13/+36
class regcache has some methods checking the range of register number, this patch is to move it in a new method assert_regnum. gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache::assert_regnum): New method. (regcache::invalidate): Call assert_regnum. (regcache::raw_update): Likewise. (regcache::raw_write): Likewise. (regcache::raw_read_part): Likewise. (regcache::raw_write_part): Likewise. (regcache::raw_supply): Likewise. (regcache::raw_supply_integer): Likewise. (regcache::raw_supply_zeroed): Likewise. (regcache::raw_collect): Likewise. (regcache::raw_collect_integer): Likewise. * regcache.h (regcache::assert_regnum): Declare.
2017-11-02Remove code wrapped by "#if 0"Yao Qi2-15/+4
These code wrapped by "#if 0" was added by af030b9a, which added the new command to dump registers in 2002. The email didn't mention this either https://sourceware.org/ml/gdb-patches/2002-08/msg00227.html It was there for 15 years, and nobody needs it, so we can remove it. gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * regcache.c (regcache::dump): Remove code.
2017-11-02Remove regcache_descr fields sizeof_raw_register_status and ↵Yao Qi2-9/+14
sizeof_cooked_register_status struct regcache_descr has two fields sizeof_raw_register_status and sizeof_cooked_register_status, but they equal to nr_cooked_registers and nr_raw_registers respectively, so this patch removes them. gdb: 2017-11-02 Yao Qi <yao.qi@linaro.org> * regcache.c (struct regcache_descr) <sizeof_raw_register_status>: Remove. <sizeof_cooked_register_status>: Remove. (init_regcache_descr): Update. (regcache::regcache): Use nr_cooked_registers and nr_raw_registers. (regcache::save): Likewise. (regcache::dump): Likewise.
2017-11-02[ARM] Help wince objdump on coproc testsThomas Preud'homme3-2/+8
Object files other than ELF do not have mapping symbols to indicate the type of data for objdump to work reliably. This is why the following tests FAIL on arm-wince-pe targets: ARMv6T2 Thumb CoProcessor Instructions (1) ARMv6T2 Thumb CoProcessor Instructions (2) This patch adds the force-thumb disassembler option to objdump for this test to PASS on these targets as well. 2017-11-02 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v6t2-1.d: Add --disassembler-options=force-thumb to objdump options. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v6t2-2.d: Likewise.
2017-11-01FT32: support for FT32B processor - part 2/2James Bowman4-13/+48
FT32B is a new FT32 family member. This patch adds support for the compressed instructions to gdb and sim. gdb/ChangeLog: * ft32-tdep.c (ft32_fetch_instruction): New function. (ft32_analyze_prologue): Use ft32_fetch_instruction(). sim/ChangeLog: * ft32/interp.c (step_once): Add ft32 shortcode decoder.
2017-11-02Automatic date update in version.inGDB Administrator1-1/+1
2017-11-01FT32B is a new FT32 family member. It has a code compression scheme, which ↵James Bowman32-392/+3875
requires the use of linker relaxations. The change is quite large, so submission is in several parts. Part 2 adds a relaxation pass, which actually implements the code compression scheme. bfd * archures.c: Add bfd_mach_ft32b. * cpu-ft32.c: Add arch_info_struct. * elf32-ft32.c: Add R_FT32_RELAX, SC0, SC1, DIFF32. (ft32_elf_relocate_section): Add clauses for R_FT32_SC0, SC1, DIFF32. (ft32_reloc_shortable, elf32_ft32_is_diff_reloc, elf32_ft32_adjust_diff_reloc_value, elf32_ft32_adjust_reloc_if_spans_insn, elf32_ft32_relax_delete_bytes, elf32_ft32_relax_is_branch_target, ft32_elf_relax_section): New function. * reloc.c: Add BFD_RELOC_FT32_RELAX, SC0, SC1, DIFF32. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. gas * config/tc-ft32.c (md_assemble): add relaxation reloc BFD_RELOC_FT32_RELAX. (md_longopts): Add "norelax" and "no-relax". (md_apply_fix): Add reloc BFD_RELOC_FT32_DIFF32. (relaxable_section, ft32_validate_fix_sub, ft32_force_relocation, ft32_allow_local_subtract): New function. * config/tc-ft32.h: remove unused MD_PCREL_FROM_SECTION. * testsuite/gas/ft32/insnsc.s: New test exercising all FT32B shortcodes. include * elf/ft32.h: Add R_FT32_RELAX, SC0, SC1, DIFF32.
2017-11-01Prevent illegal memory accesses when attempting to read excessively large ↵Nick Clifton2-0/+14
COFF line number tables. PR 22376 * coffcode.h (coff_slurp_line_table): Check for an excessively large line number count.
2017-11-01Update check for invalid values in pe_bfd_read_buildid function.Nick Clifton2-3/+8
PR 22373 * peicode.h (pe_bfd_read_buildid): Revise check for invalid size and offset in light of further possible bogus values.
2017-11-01Fix an invalid free called when attempting to link a COFF object against an ↵Nick Clifton4-3/+27
ELF archive with --no-keep-memory enabled. PR 22369 * coffgen.c (_bfd_coff_free_symbols): Fail if called on a non-COFF file. * cofflink.c (coff_link_check_archive_element): Skip non-COFF members of an archive.
2017-11-01[ARM] Fix Coprocessor instructions availabilityThomas Preud'homme26-35/+328
A few coprocessor instructions introduced in ARMv2 are currently accepted by GAS when targeting ARMv1 due to a typo in the code. This patch fixes the issue and introduce a more fine grained testing for coprocessor instructions availability. Coprocessor instructions are grouped as follows: * ARM coprocessor instructions introduced in ARMv2 Includes: ldc, stc, mcr, mrc, cdp, ldcl, stcl Guarded by: ARM_EXT_V2 Tests: copro-arm_v2plus-arm_v*.d * ARM coprocessor instructions introduced in ARMv5 Includes: ldc2, ldc2l, stc2, stc2l, cdp2, mcr2, mrc2 Guarded by: ARM_EXT_V5 Tests: copro-arm_v5plus-arm_v*.d * ARM coprocessor instructions introduced in ARMv5TE Includes: mcrr, mrrc Guarded by: ARM_EXT_V5E Tests: copro-arm_v5teplus-arm_v*.d * ARM coprocessor instructions introduced in ARMv6 Includes: mcrr2, mrrc2 Guarded by: ARM_EXT_V6 Tests: copro-arm_v6plus-arm_v*.d * Thumb coprocessor instructions introduced in ARMv6T2 Includes: ldc, ldcl, stc, stcl, mcr, mrc, mcrr, mrrc, cdp, ldc2, ldc2l, stc2, stc2l, cdp2, mcr2, mrc2, mcrr2, mrrc2 Guarded by: ARM_EXT_V6T2 Tests: copro-thumb_v6t2plus-thumb_v*.d For each of these groups, at least 2 tests are performed: * instructions are not available in earlier architecture * instructions are available in architecture where they were introduced More tests need to be performed when instructions in a group span several assembly files. Note that an instruction in the original coprocessor testcase is changed to unified syntax to allow the testcase to be assembled for ARM and Thumb state. Correct processing of legacy syntax is covered in other testcases. 2017-11-01 Thomas Preud'homme <thomas.preudhomme@arm.com> gas/ * config/tc-arm.c (arm_ext_v2): Define to ARM_EXT_V2 feature bit. * testsuite/gas/arm/copro.s: Split into ... * testsuite/gas/arm/copro-arm_v2plus-thumb_v6t2plus.s: This while changing it to unified syntax and ... * testsuite/gas/arm/copro-arm_v5plus-thumb_v6t2plus.s: this and ... * testsuite/gas/arm/copro-arm_v5teplus-thumb_v6t2plus.s: This and ... * testsuite/gas/arm/copro-arm_v6plus-thumb_v6t2plus.s: This. * testsuite/gas/arm/copro.d: Split into ... * testsuite/gas/arm/copro-arm_v2plus-arm_v2.d: This but target ARMv2 and ... * testsuite/gas/arm/copro-arm_v5plus-arm_v5.d: this but target ARMv5 and ... * testsuite/gas/arm/copro-arm_v5teplus-arm_v5te.d: This but target ARMv5TE and ... * testsuite/gas/arm/copro-arm_v6plus-arm_v6.d: This but target ARMv6. * testsuite/gas/arm/copro-arm_v2plus-arm_v1.d: New testcase. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-1.d: New testcase. * testsuite/gas/arm/copro-arm_v2plus-thumb_v6t2plus-unavail.l: Expected errors for the above two testcases. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v6t2-1.d: New testcase. * testsuite/gas/arm/copro-arm_v5plus-arm_v4.d: New testcase. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-2.d: New testcase. * testsuite/gas/arm/copro-arm_v5plus-thumb_v6t2plus-unavail.l: Expected errors for the above two testcases. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v6t2-2.d: New testcase. * testsuite/gas/arm/copro-arm_v5teplus-arm_v5.d: New testcase. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-3.d: New testcase. * testsuite/gas/arm/copro-arm_v5teplus-thumb_v6t2plus-unavail.l: Expected errors for the above two testcases. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v6t2-3.d: New testcase. * testsuite/gas/arm/copro-arm_v6plus-arm_v5te.d: New testcase. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v4t-4.d: New testcase. * testsuite/gas/arm/copro-arm_v6plus-thumb_v6t2plus-unavail.l: Expected errors for the above two testcases. * testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v6t2-4.d: New testcase.
2017-11-01PR22374, PowerPC unnecessary PLT entriesAlan Modra5-13/+58
We don't need a PLT entry when function pointer initialization in a read/write section is the only reference to a given function symbol. This patch prevents the unnecessary PLT entry, and ensures no dynamic relocs are emitted when UNDEFWEAK_NO_DYNAMIC_RELOC says so. bfd/ PR 22374 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't create a plt entry when just a dynamic reloc can serve. Ensure no dynamic relocations when UNDEFWEAK_NO_DYNAMIC_RELOC by setting non_got_ref. Expand and move the non_got_ref comment. * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. ld/ * testsuite/ld-powerpc/ambiguousv2.d: Remove FIXME.
2017-11-01PR22374 testcase, function pointer references in .dataAlan Modra6-0/+39
Function pointer references in .data ought to use a dynamic reloc. There shouldn't be any need for a PLT entry and definitely no copy reloc. This test fails on quite a few targets, but isn't something that anyone should worry about too much. It's really just a missed optimization. PR 22374 * testsuite/ld-elf/pr22374a.s, * testsuite/ld-elf/pr22374b.s, * testsuite/ld-elf/pr22374-1.r, * testsuite/ld-elf/pr22374-2.r: New test. * testsuite/ld-elf/elf.exp: Run it.
2017-11-01Tidy elf.expAlan Modra2-36/+29
* testsuite/ld-elf/elf.exp: Merge some conditionals, a better name than "shared library for next test", and use xfail arg of run_ld_link_tests in a few places.
2017-10-31Use console uiout when executing breakpoint commandsSimon Marchi4-6/+31
As reported here https://sourceware.org/ml/gdb/2017-10/msg00020.html the output of certain commands, like backtrace, doesn't appear anywhere when it is run as a breakpoint command and when using MI. The reason is that the current_uiout is set to the mi_ui_out while these commands run, whereas we want the output as CLI output. Some commands like "print" work, because they use printf_filtered (gdb_stdout, ...) directly, bypassing the current ui_out. The fix I did is to force setting the cli_uiout as the current_uiout when calling execute_control_command. I am not sure if this is the right way to fix the problem, comments about the approach would be appreciated. I enhanced gdb.mi/mi-break.exp to test the backtrace command. Regtested on the buildbot. gdb/ChangeLog: * cli/cli-script.c (execute_control_command): Rename to ... (execute_control_command_1): ... this. (execute_control_command): New function. gdb/testsuite/ChangeLog: * gdb.mi/mi-break.exp (test_breakpoint_commands): Test backtrace as a breakpoint command.
2017-11-01Automatic date update in version.inGDB Administrator1-1/+1
2017-10-31tracepoint: Remove unnecessary const_castSimon Marchi2-1/+5
We are passing a const char * to a const char * parameter, the const_cast is not necessary. gdb/ChangeLog: * tracepoint.c (tfind_command): Remove const_cast.
2017-10-31Fix illegal memory access triggered when parsing a PE binary with a corrupt ↵Nick Clifton2-3/+12
data dictionary. PR 22373 * peicode.h (pe_bfd_read_buildid): Check for invalid size and data offset values.
2017-10-31Remind users to use the --use-dynamic command line option to dump dynamic ↵Nick Clifton2-1/+21
relocations. * readelf.c (process_relocs): Tell users if no static relocs were found, but if they had added --use-dynamic to the command line then relocs would have been displayed.
2017-10-30gdb/Makefile.in: fix 'make tags' failureMike Gulick2-1/+4
'make tags' fails with the following error: make[2]: Entering directory '/local-ssd/mgulick/gdb/git/binutils-gdb/gdb' make[2]: *** No rule to make target 'gdb.h', needed by 'TAGS'. Stop. make[2]: Leaving directory '/local-ssd/mgulick/gdb/git/binutils-gdb/gdb' The file gdb/gdb.h was removed in commit 65630365f7d073430e62b4fe65f34dcdc0a4b05e. gdb/ChangeLog: 2017-10-30 Mike Gulick <mgulick@mathworks.com> * Makefile.in (HFILES_NO_SRCDIR): Remove reference to gdb.h.
2017-10-31Automatic date update in version.inGDB Administrator1-1/+1
2017-10-30Introduce in_inclusive_range, fix -Wtautological-compare warningsSimon Marchi4-9/+27
When compiling with clang or gcc 8, we see warnings like this: /home/emaisin/src/binutils-gdb/gdb/arm-tdep.c:10013:13: error: comparison of 0 <= unsigned expression is always true [-Werror,-Wtautological-compare] if (0 <= insn_op1 && 3 >= insn_op1) ~ ^ ~~~~~~~~ /home/emaisin/src/binutils-gdb/gdb/arm-tdep.c:11722:20: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare] else if (opB >= 0 && opB <= 2) ~~~ ^ ~ This is because an unsigned integer (opB in this case) will always be >= 0. It is still useful to keep both bounds of the range in the expression, even if one is at the edge of the data type range. This patch introduces a utility function in_inclusive_range that gets rid of the warning while conveying that we are checking for a range. Tested by rebuilding. gdb/ChangeLog: * common/common-utils.h (in_inclusive_range): New function. * arm-tdep.c (arm_record_extension_space): Use in_inclusive_range. (thumb_record_ld_st_reg_offset): Use in_inclusive_range. * cris-tdep.c (cris_spec_reg_applicable): Use in_inclusive_range.
2017-10-30remote.c, QCatchSyscalls: Build std::string instead of unique_xmalloc_ptrPedro Alves2-15/+13
Simplify the code a little bit using std::string + string_appendf. gdb/ChangeLog: 2017-10-30 Pedro Alves <palves@redhat.com> Simon Marchi <simon.marchi@ericsson.com> * remote.c (remote_set_syscall_catchpoint): Build a std::string instead of a gdb::unique_xmalloc_ptr, using string_appendf.
2017-10-30Introduce string_appendf/string_vappendfPedro Alves4-0/+104
string_appendf is like string_printf, but instead of allocating a new string, it appends to an existing string. This allows reusing a std::string's memory buffer across several calls, for example. gdb/ChangeLog: 2017-10-30 Pedro Alves <palves@redhat.com> * common/common-utils.c (string_appendf, string_vappendf): New functions. * common/common-utils.h (string_appendf, string_vappendf): New declarations. * unittests/common-utils-selftests.c (string_appendf_func) (test_appendf_func, string_vappendf_wrapper, string_appendf_tests) (string_vappendf_tests): New functions. (_initialize_common_utils_selftests): Register "string_appendf" and "string_vappendf tests".
2017-10-30Merge/shared string_printf and string_vprintf unit testsPedro Alves2-15/+38
Merge the string_printf and string_vprintf tests, running them all against both functions. gdb/ChangeLog: 2017-10-30 Pedro Alves <palves@redhat.com> * unittests/common-utils-selftests.c (format_func): New typedef. (string_printf_tests, string_vprintf_tests): Tests factored out and merged to ... (test_format_func): ... this new function. (string_printf_tests, string_vprintf_tests): Reimplement on top of test_format_func.
2017-10-29darwin-nat: Remove gdb.h includeSimon Marchi2-1/+4
gdb.h has been removed in Eliminate catch_exceptions/catch_exceptions_with_msg 65630365f7d073430e62b4fe65f34dcdc0a4b05e Remove the include in darwin-nat.c. Tested by rebuilding. gdb/ChangeLog: * darwin-nat.c: Remove include of gdb.h.
2017-10-30frv-elf --gc-sections failuresAlan Modra2-1/+5
git commit 81742b83e9 exposed an frv-elf bug, with the object id not matching the hash table id. * elf32-frv.c (ELF_TARGET_ID): Don't define for generic elf target.
2017-10-30relocs_compatible test for gc-sectionsAlan Modra2-0/+8
I noticed when looking at pr22300 that before calling check_relocs we have an elf_object_id test (added for pr11933) as well as the relocs_compatible test. I believe backend gc_mark_hook and gc_sweep_hook ought to be protected similarly from being confused by unexpected relocations (for example, both elf64-ppc.c and elf32-ppc.c use _bfd_elf_relocs_compatible, so I think it would be possible for the ppc64 gc_mark_hook to be presented with a ppc32 relocatable object). * elflink.c (elf_gc_sweep): Test elf_object_id in addition to relocs_compatible. (bfd_elf_gc_sections): Likewise.