Commit Graph

90977 Commits

Author SHA1 Message Date
John Baldwin 0aa37b654c Support the fs_base and gs_base registers on FreeBSD/amd64 native processes.
Use ptrace operations to fetch and store the fs_base and gs_base registers
for FreeBSD/amd64 processes.  Note that FreeBSD does not currently store the
value of these registers in core dumps, so these registers are only
available when inspecting a running process.

gdb/ChangeLog:

	* amd64-bsd-nat.c (amd64bsd_fetch_inferior_registers): Use
	PT_GETFSBASE and PT_GETGSBASE.
	(amd64bsd_store_inferior_registers): Use PT_SETFSBASE and
	PT_SETGSBASE.
2017-07-11 09:47:14 -07:00
John Baldwin 48aeef91c2 Include the fs_base and gs_base registers in amd64 target descriptions.
This permits these registers to be used with non-Linux targets.

gdb/ChangeLog:

	* features/Makefile (amd64.dat, amd64-avx.dat, amd64-mpx.dat)
	(amd64-avx-mpx.dat, amd64-avx-avx512.dat)
	(amd64-avx-mpx-avx512-pku.dat): Add i386/64bit-segments.xml in
	those rules.
	* features/i386/amd64-avx-avx512.xml: Add 64bit-segments.xml.
        * features/i386/amd64-avx-mpx-avx512-pku.xml: Add 64bit-segments.xml.
	* features/i386/amd64-avx-mpx.xml: Add 64bit-segments.xml.
	* features/i386/amd64-avx.xml: Add 64bit-segments.xml.
	* features/i386/amd64-mpx.xml: Add 64bit-segments.xml.
	* features/i386/amd64.xml: Add 64bit-segments.xml.
	* features/i386/amd64-avx-avx512.c: Regenerated.
	* features/i386/amd64-avx-mpx-avx512-pku.c: Regenerated.
	* features/i386/amd64-avx-mpx.c: Regenerated.
	* features/i386/amd64-avx.c: Regenerated.
	* features/i386/amd64-mpx.c: Regenerated.
	* features/i386/amd64.c: Regenerated.
	* regformats/i386/amd64-avx-avx512.dat: Regenerated.
	* regformats/i386/amd64-avx-mpx-avx512-pku.dat: Regenerated.
	* regformats/i386/amd64-avx-mpx.dat: Regenerated.
	* regformats/i386/amd64-avx.dat: Regenerated.
	* regformats/i386/amd64-mpx.dat: Regenerated.
	* regformats/i386/amd64.dat: Regenerated.
2017-07-11 09:46:29 -07:00
H.J. Lu 61a0857c0f Support single digit GCC version
On Fedora 26, "g++ -dumpversion" displays "7", instead of "7.1.1".
Update selective.exp to support single digit GCC version.  Also
remove duplicated [4-9] version check.

	* testsuite/ld-selective/selective.exp: Support single digit
	GCC version.
2017-07-11 08:41:22 -07:00
Andreas Schwab 04ac15ab07 Add missing newlines in readelf -n output
* readelf.c (process_note): Print newline after description data
	in narrow mode.
	(print_core_note): Print newline if nothing was printed in wide
	mode.
2017-07-11 17:40:24 +02:00
Alan Modra e3fbc3da13 ppc32 use of %x in einfo format, typo fix
* elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2017-07-11 22:42:43 +09:30
Jiong Wang 70391b29cf [AArch64] Use "#pass" instead of "#..." to filter multiple lines
ld/
	* testsuite/ld-aarch64/dt_textrel.d: Use "#pass" instead of ".*" to
	filter out remaining lines.
2017-07-11 11:29:51 +01:00
Alan Modra 2c4d9cbe51 ppc32 use of %x in einfo format
einfo doesn't support %x.

	* elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
	instruction" error using _bfd_error_handler, not einfo.
2017-07-11 19:18:47 +09:30
Alan Modra 4162bb66c6 Mark generated cgen files read-only
* cgen.sh: Mark generated files read-only.
	* epiphany-asm.c: Regenerate.
	* epiphany-desc.c: Regenerate.
	* epiphany-desc.h: Regenerate.
	* epiphany-dis.c: Regenerate.
	* epiphany-ibld.c: Regenerate.
	* epiphany-opc.c: Regenerate.
	* epiphany-opc.h: Regenerate.
	* fr30-asm.c: Regenerate.
	* fr30-desc.c: Regenerate.
	* fr30-desc.h: Regenerate.
	* fr30-dis.c: Regenerate.
	* fr30-ibld.c: Regenerate.
	* fr30-opc.c: Regenerate.
	* fr30-opc.h: Regenerate.
	* frv-asm.c: Regenerate.
	* frv-desc.c: Regenerate.
	* frv-desc.h: Regenerate.
	* frv-dis.c: Regenerate.
	* frv-ibld.c: Regenerate.
	* frv-opc.c: Regenerate.
	* frv-opc.h: Regenerate.
	* ip2k-asm.c: Regenerate.
	* ip2k-desc.c: Regenerate.
	* ip2k-desc.h: Regenerate.
	* ip2k-dis.c: Regenerate.
	* ip2k-ibld.c: Regenerate.
	* ip2k-opc.c: Regenerate.
	* ip2k-opc.h: Regenerate.
	* iq2000-asm.c: Regenerate.
	* iq2000-desc.c: Regenerate.
	* iq2000-desc.h: Regenerate.
	* iq2000-dis.c: Regenerate.
	* iq2000-ibld.c: Regenerate.
	* iq2000-opc.c: Regenerate.
	* iq2000-opc.h: Regenerate.
	* lm32-asm.c: Regenerate.
	* lm32-desc.c: Regenerate.
	* lm32-desc.h: Regenerate.
	* lm32-dis.c: Regenerate.
	* lm32-ibld.c: Regenerate.
	* lm32-opc.c: Regenerate.
	* lm32-opc.h: Regenerate.
	* lm32-opinst.c: Regenerate.
	* m32c-asm.c: Regenerate.
	* m32c-desc.c: Regenerate.
	* m32c-desc.h: Regenerate.
	* m32c-dis.c: Regenerate.
	* m32c-ibld.c: Regenerate.
	* m32c-opc.c: Regenerate.
	* m32c-opc.h: Regenerate.
	* m32r-asm.c: Regenerate.
	* m32r-desc.c: Regenerate.
	* m32r-desc.h: Regenerate.
	* m32r-dis.c: Regenerate.
	* m32r-ibld.c: Regenerate.
	* m32r-opc.c: Regenerate.
	* m32r-opc.h: Regenerate.
	* m32r-opinst.c: Regenerate.
	* mep-asm.c: Regenerate.
	* mep-desc.c: Regenerate.
	* mep-desc.h: Regenerate.
	* mep-dis.c: Regenerate.
	* mep-ibld.c: Regenerate.
	* mep-opc.c: Regenerate.
	* mep-opc.h: Regenerate.
	* mt-asm.c: Regenerate.
	* mt-desc.c: Regenerate.
	* mt-desc.h: Regenerate.
	* mt-dis.c: Regenerate.
	* mt-ibld.c: Regenerate.
	* mt-opc.c: Regenerate.
	* mt-opc.h: Regenerate.
	* or1k-asm.c: Regenerate.
	* or1k-desc.c: Regenerate.
	* or1k-desc.h: Regenerate.
	* or1k-dis.c: Regenerate.
	* or1k-ibld.c: Regenerate.
	* or1k-opc.c: Regenerate.
	* or1k-opc.h: Regenerate.
	* or1k-opinst.c: Regenerate.
	* xc16x-asm.c: Regenerate.
	* xc16x-desc.c: Regenerate.
	* xc16x-desc.h: Regenerate.
	* xc16x-dis.c: Regenerate.
	* xc16x-ibld.c: Regenerate.
	* xc16x-opc.c: Regenerate.
	* xc16x-opc.h: Regenerate.
	* xstormy16-asm.c: Regenerate.
	* xstormy16-desc.c: Regenerate.
	* xstormy16-desc.h: Regenerate.
	* xstormy16-dis.c: Regenerate.
	* xstormy16-ibld.c: Regenerate.
	* xstormy16-opc.c: Regenerate.
	* xstormy16-opc.h: Regenerate.
2017-07-11 19:18:06 +09:30
Iain Buclaw 11cb57160f Sync dlang demangling tests from upstream libiberty testsuite.
Rationale behind the change instead of adding a `.init$' postfix being
that "initializer for symbol" is much more informative when inspecting D
runtime type information in gdb, which is the only place where you would
encounter references to this compiler-generated symbol.

gdb/testsuite/ChangeLog:

	* gdb.dlang/demangle.exp: Update for demangling changes.
2017-07-11 09:51:03 +02:00
GDB Administrator 36cebdda80 Automatic date update in version.in 2017-07-11 00:00:41 +00:00
Anton Kolesov 6dc8d7579d Add missing ChangeLog etries
This adds the missing ChangeLog entries for my previous patch

3d99e81 Import setenv and unsetenv from gnulib
2017-07-10 20:49:28 +03:00
Nick Clifton adce5b398d Fix compile time warning about duplicate case values for powerpc-aix target.
* coffcode.h (coff_slurp_symbol_table): Do not include an entry
	for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2017-07-10 13:18:05 +01:00
Yao Qi 77c501bcea Re-generate i386/amd64-avx-avx512-linux.c and i386/amd64-avx-mpx-avx512-pku-linux.c
gdb:

2017-07-10  Yao Qi  <yao.qi@linaro.org>

	* features/i386/amd64-avx-avx512-linux.c: Re-generated.
	* features/i386/amd64-avx-mpx-avx512-pku-linux.c: Re-generated.
2017-07-10 12:00:35 +01:00
Yao Qi 2e1e43e140 Re-indent the code
gdb/gdbserver:

2017-07-10  Yao Qi  <yao.qi@linaro.org>

	* linux-x86-low.c (x86_linux_read_description): Re-indent the code.
2017-07-10 11:53:44 +01:00
Anton Kolesov 3d99e817a9 Import setenv and unsetenv from gnulib
This patch supersedes
https://sourceware.org/ml/gdb-patches/2017-07/msg00009.html

---

Patch [1] broke a build on MinGW hosts, because MinGW doesn't provide POSIX
functions setenv () and unsetenv ().  This can be fixed by using
implementations from gnulib.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=9a6c7d9c0

gdb/ChangeLog
yyyy-mm-dd  Anton Kolesov  <Anton.Kolesov@synopsys.com>

	* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add setenv and
	unsetenv.
	* gnulib/aclocal.m4: Regenerate.
	* gnulib/config.in: Regenerate.
	* gnulib/configure: Regenerate.
	* gnulib/import/Makefile.am: Regenerate.
	* gnulib/import/Makefile.in: Regenerate.
	* gnulib/import/m4/gnulib-cache.m4: Regenerate.
	* gnulib/import/m4/gnulib-comp.m4: Regenerate.
	* gnulib/import/m4/environ.m4: New file.
	* gnulib/import/m4/setenv.m4: New file.
	* gnulib/import/setenv.c: New file.
	* gnulib/import/unsetenv.c: New file.
2017-07-10 13:23:12 +03:00
GDB Administrator a074796714 Automatic date update in version.in 2017-07-10 00:00:41 +00:00
Jan Kratochvil 14357de15f DWARF-5: Fix error message typo.
binutils/
2017-07-09  Rafael Fontenelle <rafaelff@gnome.org>

	* dwarf.c (display_formatted_table): Fix error message typo.
2017-07-09 20:52:18 +02:00
Simon Marchi 266934d1ad compile-loc2c: Fix uninitialized variable error
Compiling with clang gives this warning/error:

  /home/emaisin/src/binutils-gdb/gdb/compile/compile-loc2c.c:731:6: error: variable 'uoffset' is uninitialized when used here [-Werror,-Wuninitialized]
              uoffset += dwarf2_per_cu_text_offset (per_cu);
              ^~~~~~~
  /home/emaisin/src/binutils-gdb/gdb/compile/compile-loc2c.c:669:23: note: initialize the variable 'uoffset' to silence this warning
        uint64_t uoffset, reg;
                        ^
                         = 0

I am really not sure if what this patch does is good, but it is my best
guess.  DW_OP_addr means that there's an constant address provided by
the DWARF bytecode that should be pushed on the stack.  That address is
considered skipped by the "op_ptr += addr_size", but it is never read.
uoffset is indeed read just after, without having been assigned first.

So I think the intent is to read the address, it was just omitted.

gdb/ChangeLog:

	* compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Read
	address when op is DW_OP_addr.
2017-07-09 20:25:46 +02:00
Tom Tromey 0327869232 Fix size check in dwarf2_evaluate_loc_desc_full
This Rust bug report:

https://github.com/rust-lang/rust/issues/41970

noted an error from gdb.  What is happening here (for me, the original
report had a different error) is that a pieced DWARF expression is not
writing to every byte in the resulting value.  GDB errors in this
case.  However, it seems to me that it is always valid to write fewer
bytes; the issue comes from writing too many -- that is, the test is
reversed.  The test was also checking the sub-object, but this also
seems incorrect, as it's expected for the expression to write the
entirety of the enclosing object.  So, this patch reverses the test
and applies it to the outer type, not the subobject type.

Regtested on the buildbot.

gdb/ChangeLog
2017-07-09  Tom Tromey  <tom@tromey.com>

	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Reverse size
	check and apply to outer type.

gdb/testsuite/ChangeLog
2017-07-09  Tom Tromey  <tom@tromey.com>

	* gdb.dwarf2/shortpiece.exp: New file.
2017-07-09 10:46:49 -06:00
GDB Administrator f4db828807 Automatic date update in version.in 2017-07-09 00:00:41 +00:00
GDB Administrator 12c1f20d6f Automatic date update in version.in 2017-07-08 00:00:40 +00:00
John Baldwin 4b654465bf Read signal information from FreeBSD core dumps.
FreeBSD recently added a new ELF core note which dumps the entire LWP
info structure (the same structure returned by the ptrace PT_LWPINFO
operation) for each thread.  The plan is for this note to eventually
supplant the older "thrmisc" ELF core note as it contains more
information and it permits new information to be exported via both
ptrace() and core dumps using the same structure.

For signal information, the implementation is similar to the native
implementation for FreeBSD processes.  The PL_FLAG_SI flag must be
checked to determine if the embedded siginfo_t structure is valid, and
if so it is transferred into the caller's buffer.

gdb/ChangeLog:

	* fbsd-tdep.c (LWPINFO_OFFSET, LWPINFO_PL_FLAGS)
	(LWPINFO64_PL_SIGINFO, LWPINFO32_PL_SIGINFO, PL_FLAG_SI)
	(SIZE64_SIGINFO_T, SIZE32_SIGINFO_T, fbsd_core_xfer_siginfo): New.
	(fbsd_init_abi): Install gdbarch "core_xfer_siginfo" method.
2017-07-07 16:12:42 -07:00
John Baldwin e6f3b9c319 Create pseudo sections for FreeBSD NT_PTLWPINFO core notes.
bfd/ChangeLog:

	* elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2017-07-07 16:11:42 -07:00
John Baldwin 0b9305edf1 Recognize the recently-added FreeBSD core dump note for LWP info.
This core dump note contains the same information returned by the
ptrace PT_LWPINFO operation for each LWP belonging to a process.

binutils/ChangeLog:

	* readelf.c (get_freebsd_elfcore_note_type): Handle
	NT_FREEBSD_PTLWPINFO.

include/ChangeLog:

	* elf/common.h (NT_FREEBSD_PTLWPINFO): Define.
2017-07-07 16:10:47 -07:00
John Baldwin 2af9fc4432 Use the thread_section_name helper class in fbsd_core_thread_name.
gdb/ChangeLog:

	* fbsd-tdep.c (fbsd_core_thread_name): Use thread_section_name.
2017-07-07 16:09:13 -07:00
John Baldwin 382b69bbb7 Add a new gdbarch method to fetch signal information from core files.
Previously the core_xfer_partial method used core_get_siginfo to handle
TARGET_OBJECT_SIGNAL_INFO requests.  However, core_get_siginfo looked for
Linux-specific sections in the core file.  To support fetching siginfo
from cores on other systems, add a new gdbarch method (`core_xfer_siginfo`)
and move the body of the existing core_get_siginfo into a
linux_core_xfer_siginfo implementation of this method in linux-tdep.c.

gdb/ChangeLog:

	* corelow.c (get_core_siginfo): Remove.
	(core_xfer_partial): Use the gdbarch "core_xfer_siginfo" method
	instead of get_core_siginfo.
	* gdbarch.sh (core_xfer_siginfo): New gdbarch callback.
	* gdbarch.h: Re-generate.
	* gdbarch.c: Re-generate.
	* linux-tdep.c (linux_core_xfer_siginfo): New.
	(linux_init_abi): Install gdbarch "core_xfer_siginfo" method.
2017-07-07 16:08:33 -07:00
John Baldwin 6e5eab33ab Move the thread_section_name class to gdbcore.h.
This allows it to be used outside of corelow.c.
2017-07-07 16:06:45 -07:00
John Baldwin 929edea98d Fetch signal information for native FreeBSD processes.
Use the `pl_siginfo' field in the `struct ptrace_lwpinfo' object returned
by the PT_LWPINFO ptrace() request to supply the current contents of
$_siginfo for each thread.  Note that FreeBSD does not supply a way to
modify the signal information for a thread, so $_siginfo is read-only for
FreeBSD.

To handle 32-bit processes on a 64-bit host, define types for 32-bit
compatible siginfo_t and convert the 64-bit siginfo_t to the 32-bit
equivalent when supplying information for a 32-bit process.

gdb/ChangeLog:

	* fbsd-nat.c [PT_LWPINFO && __LP64__] (union sigval32)
	(struct siginfo32): New.
	[PT_LWPINFO] (fbsd_siginfo_size, fbsd_convert_siginfo): New.
	(fbsd_xfer_partial) [PT_LWPINFO]: Handle TARGET_OBJECT_SIGNAL_INFO
	via ptrace(PT_LWPINFO).
2017-07-07 16:05:47 -07:00
John Baldwin 762c974a09 Implement the "get_siginfo_type" gdbarch method for FreeBSD architectures.
As with Linux architectures, cache the created type in the gdbarch when it
is first created.  Currently FreeBSD uses an identical siginfo type on
all architectures, so there is no support for architecture-specific fields.

gdb/ChangeLog:

	* fbsd-tdep.c (fbsd_gdbarch_data_handle, struct fbsd_gdbarch_data)
	(init_fbsd_gdbarch_data, get_fbsd_gdbarch_data)
	(fbsd_get_siginfo_type): New.
	(fbsd_init_abi): Install gdbarch "get_siginfo_type" method.
	(_initialize_fbsd_tdep): New.
2017-07-07 16:04:18 -07:00
Maciej W. Rozycki e54cb31aa3 MIPS/LD: Fix a segfault from ELF `e_flags' access with non-ELF output BFD
Fix a commit 861fb55ab5 ("Defer allocation of R_MIPS_REL32 GOT
slots"), <https://sourceware.org/ml/binutils/2008-08/msg00096.html>,
regression and a more recent:

FAIL: ld-unique/pr21529

new LD test case failure, observed with all the relevant MIPS targets
whenever the linker is invoked with one or more ELF inputs and the
output format set to `binary'.

The culprit is a segmentation fault caused in `mips_before_allocation'
by a null pointer dereference, where an attempt is made to access the
ELF file header's `e_flags' member, for the purpose of determining
whether to produce a PLT and copy relocations, without first checking
that the output BFD is ELF.  The `e_flags' member is stored in BFD's
private data pointed to by `tdep', which in the case of the `binary' BFD
is null, causing the segmentation fault.  With other non-ELF BFDs such
as SREC `tdep' is not null and consequently no crash may happen and in
that case random data will be interpreted as it was `e_flags'.

Disable the access to `e_flags' then and all the associated checks and
consequently never produce a PLT and copy relocations if output is not a
MIPS ELF BFD, matching `_bfd_mips_elf_merge_private_bfd_data' that does
not process `e_flags' in that case either and therefore does not let us
decide here anyway if all the input objects included in the link are
suitable for use with a PLT and copy relocations.

	ld/
	* emultempl/mipself.em (mips_before_allocation): Avoid ELF
	processing if not MIPS ELF.
	* testsuite/ld-mips-elf/binary.d: New test.
	* testsuite/ld-mips-elf/binary.ld: New test linker script.
	* testsuite/ld-mips-elf/binary.s: New test source.
	* testsuite/ld-mips-elf/mips-elf.exp: Run the new test.
2017-07-07 17:58:03 +01:00
Alan Modra c620a2b547 Make ppc476 testcases more robust
* testsuite/ld-powerpc/ppc476-shared.lnk: Align .bss.
	* testsuite/ld-powerpc/ppc476-shared.d: Adjust.
	* testsuite/ld-powerpc/ppc476-shared2.d: Adjust.
2017-07-07 23:53:18 +09:30
Alan Modra 7639175c9a Move print_insn_XXX to an opcodes internal header, again
88c1242dc0 changed some generated files rather than the source.

	* cgen-dis.in: Include disassemble.h, not dis-asm.h.
	* m32c-dis.c: Regenerate.
	* mep-dis.c: Regenerate.
2017-07-07 12:23:42 +09:30
Alan Modra 532cc31305 Add some missing xcoff support
* coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2017-07-07 10:35:31 +09:30
Alan Modra aff6079bc7 Apply ld/Makefile.in patch to the correct file
Makefile.in is generated.

	* Makefile.am (eelf64_s390.c): Depend on emultempl/s390.em.
2017-07-07 10:35:31 +09:30
Alan Modra 1cf9552bf1 Another _doprnt fix for %L handling
* bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
	as long long.  Move code replacing "ll" with "I64", and simplify.
2017-07-07 10:35:31 +09:30
GDB Administrator 9691e722c6 Automatic date update in version.in 2017-07-07 00:00:35 +00:00
David Blaikie 33c5cd7587 Fission support for multiple CUs per DWO file
In some cases a compiler may produce a single object file (& thus single
DWO file) representing multiple source files. The most common example of
this is in whole program optimization (such as LLVM's LTO). Fission may
still be a beneficial feature to use here - to avoid the need to
read/link the debug info with system libraries and the like.

This change adds basic support for multiple CUs in a single DWO file to
support LLVM's output in this situation.

There is still outstanding work to design and implement a solution for
cross-CU references (usually using DW_FORM_ref_addr) in this scenario.
For now LLVM works around this by duplicating DIEs rather than making
cross-CU references in DWO files. This degrades debugger
behavior/quality especially for file-local entities.

2017-07-06  David Blaikie  <dblaikie@gmail.com>

	* dwarf2read.c (struct dwo_file): Use a htab of dwo_unit* (rather than
	a singular dwo_unit*) to support multiple CUs in the same way that
	multiple TUs are supported.
	(create_cus_hash_table): Replace create_dwo_cu with a function for
	parsing multiple CUs from a DWO file.
	(open_and_init_dwo_file): Use create_cus_hash_table rather than
	create_dwo_cu.
	(lookup_dwo_cutu): Lookup CU in the hash table in the dwo_file with
	htab_find, rather than comparing the signature to a singleton CU in
	the dwo_file.

2017-07-06  David Blaikie  <dblaikie@gmail.com>

	* gdb.dwarf2/fission-multi-cu.S: Test containing multiple CUs in a DWO,
	built from fissiont-multi-cu{1,2}.c.
	* gdb.dwarf2/fission-multi-cu.exp: Test similar to fission-base.exp,
	except putting 'main' and 'func' in separate CUs in the same DWO file.
	* gdb.dwarf2/fission-multi-cu1.c: First CU for the multi-CU-single-DWO
	test.
	* gdb.dwarf2/fission-multi-cu2.c: Second CU in the multi-CU-single-DWO
	test.
2017-07-06 11:59:39 -07:00
H.J. Lu a0b7b10523 Convert 'L' to 'l' when setting wide_width to 1
When setting wide_width to 1, convert 'L' to 'l'.  Otherwise, %Lx/%Lu/%Ld
will be passed to fprintf which will treat the argument as long long.

	* bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
	to 1.
2017-07-06 06:52:13 -07:00
GDB Administrator 4b617f5235 Automatic date update in version.in 2017-07-06 00:00:56 +00:00
Pedro Alves 8455d26243 Fix Python unwinder frames regression
The gdb.python/py-unwind.exp test is crashing GDB / leaving core dumps
in the test dir, even though it all passes cleanly.  The crash is not
visible in gdb.sum/gdb.log because it happens as side effect of the
"quit" command, while flushing the frame cache.

The problem is simply a typo in a 'for' loop's condition, introduced
by a recent change [4fa847d78e ("Remove MAX_REGISTER_SIZE from
py-unwind.c")], resulting in infinite loop / double-free.

The new test exposes the crash, like:

 Running src/gdb/testsuite/gdb.python/py-unwind.exp ...
 ERROR: Process no longer exists

gdb/ChangeLog:
2017-07-06  Pedro Alves  <palves@redhat.com>

	* python/py-unwind.c (pyuw_dealloc_cache): Fix for loop condition.

gdb/testsuite/ChangeLog:
2017-07-06  Pedro Alves  <palves@redhat.com>

	* gdb.python/py-unwind.exp: Test flushregs.
2017-07-06 00:19:24 +01:00
H.J. Lu 1d827a720c Fix build with GCC 4.2
Fix GCC 4.2 warnings like:

cc1: warnings being treated as errors
binutils-gdb/bfd/dwarf2.c:1844: warning: declaration of ‘time’ shadows a global declaration
/usr/include/time.h:187: warning: shadowed declaration is here
binutils-gdb/bfd/dwarf2.c: In function ‘line_info_add_file_name’:
binutils-gdb/bfd/dwarf2.c:1854: warning: declaration of ‘time’ shadows a global declaration
/usr/include/time.h:187: warning: shadowed declaration is here

bfd/

	* dwarf2.c (line_info_add_include_dir_stub): Replace time with
	xtime.
	(line_info_add_file_name): Likewise.
	(decode_line_info): Likewise.

binutils/

	* dwarf.c (display_debug_names): Replace index with xindex.
2017-07-05 09:05:05 -07:00
James Greenhalgh 15a7695fdc [ARM] Add support for Cortex-A55 and Cortex-A75.
This patch adds support for the ARM Cortex-A55 and
Cortex-A75 processors.

The ARM Cortex-A55 and Cortex-A75 procsessors implement the ARMv8-A
architecture, with support for the ARMv8.1-A and ARMv8.2-A extensions,
including support for the 16-bit floating point extensions.

The 16-bit floating-point extensions are optional, and we haven't defined
an option mapping straight to them thus far, so this patch first needs to
add one of those in include/opcode/arm.h, then we can simply add the CPU names
as usual in config/tc-arm.c .

Tested on arm-none-eabi.

2017-07-05  James Greenhalgh  <james.greenhalgh@arm.com>

	* config/tc-arm.c (arm_cpus): Add Cortex-A55 and Cortex-A75.
	* doc/c-arm.texi (-mcpu): Document Cortex-A55 and Cortex-A75.
2017-07-05 12:04:37 +01:00
Borislav Petkov e4bdd67955 X86: Disassemble primary opcode map's group 2 ModRM.reg == 6 aliases correctly
The instructions are not documented in the Intel SDM but are documented
in the AMD APM as an alias to the group 2, ModRM.reg == 4 variant.

Both AMD and Intel CPUs execute the C[0-1] and D[0-3] instructions as
expected, i.e., like the /4 aliases:

  #include <stdio.h>

  int main(void)
  {
          int a = 2;

          printf ("a before: %d\n", a);

          asm volatile(".byte 0xd0,0xf0"          /* SHL %al */
                       : "+a" (a));

          printf("a after : %d\n", a);

          return 0;
  }

  $ ./a.out
  a before: 2
  a after : 4
2017-07-05 11:27:49 +02:00
Ramana Radhakrishnan 60c96dbf02 Fixup changelog entries for previous commit
40c7d50720
2017-07-05 10:21:24 +01:00
GDB Administrator 033ea118c0 Automatic date update in version.in 2017-07-05 00:00:31 +00:00
Pedro Alves 4da3eb35ef Garbage collect TYPE_STATIC and several TYPE_FN_FIELD_x
Nothing uses these.  Most of the TYPE_FN_FIELD_ ones were probably
used by the gcj support.

gdb/ChangeLog:
2017-07-04  Pedro Alves  <palves@redhat.com>

	* gdbtypes.c (recursive_dump_type): Don't reference TYPE_STATIC.
	* gdbtypes.h (TYPE_STATIC): Delete.
	(struct fn_field) <is_public, is_abstract, is_static, is_final,
	is_synchronized, is_native>: Delete.
	<dummy>: Bump.
	(TYPE_FN_FIELD_PUBLIC, TYPE_FN_FIELD_STATIC, TYPE_FN_FIELD_FINAL)
	(TYPE_FN_FIELD_SYNCHRONIZED, TYPE_FN_FIELD_NATIVE)
	(TYPE_FN_FIELD_ABSTRACT): Delete.
2017-07-04 18:40:26 +01:00
Ramana Radhakrishnan 40c7d50720 [Patch ARM] Support MVFR2 VFP Coprocessor register for ARMv8-A
This patch adds support mvfr2 control registers for armv8-a as
this was missed from the original port to armv8-a (documented
at G6.2.109 in (Issue B.a) of the ARM-ARM. This was discovered
by an internal user of the GNU toolchain.

I'd like to backport this to the binutils 2.28 and binutils 2.29
release branch if possible (with suitable testing and basically
checking removing the armv8-r parts).

Tristan - are you ok with the backports ?

Applied to trunk.

regards Ramana

2017-07-04  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>

        * gas/config/tc-arm.c (arm_regs): Add MVFR2.
        (do_vmrs): Constraint for MVFR2 and armv8.
        (do_vmsr): Likewise.
        * gas/testsuite/gas/arm/armv8-a+fp.d: Update.
        * gas/testsuite/gas/arm/armv8-ar+fp.s: Likewise.
        * gas/testsuite/gas/arm/armv8-r+fp.d: Likewise.
        * gas/testsuite/gas/arm/vfp-bad.s: Likewise.
        * gas/testsuite/gas/arm/vfp-bad.l: Likewise.
        * opcodes/arm-dis.c: Support MVFR2 in disassembly
        with vmrs and vmsr.
2017-07-04 16:18:47 +01:00
Tristan Gingold 0d702cfe5d Regenerate configure.
bfd/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* version.m4: Bump version to 2.29.51
	* configure: Regenerate.

binutils/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.

gas/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.

gprof/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.

ld/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.

opcodes/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* configure: Regenerate.
2017-07-04 11:15:33 +02:00
Tristan Gingold 55a09eb6df Add markers.
binutils/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.29.

gas/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.29.

ld/
2017-07-04  Tristan Gingold  <gingold@adacore.com>

	* NEWS: Add marker for 2.29.
2017-07-04 11:07:03 +02:00
Jiong Wang 564e46b795 [AArch64] Remove useless and incorrect assertion
The outer caller elf_link_output_extsym in elflink.c is a traverse function on
all external symbol, and it will only call *finish_dynamic_symbol if some
conditions is meet.  It is executed conditionally.

If the condition to trigger that assertion is satisified, it then won't satify
the outer check in finish_dynamic_symbol, so *finish_dynamic_symbol won't be
called that the assertion is expected to be dead code.

If elf_link_output_extsym is a traverse function that unconditionally called
on external symbols decided to be exported, then an assertion to make sure these
symbols are in sane status might make sense.

bfd/
        * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
        sanity check at the head of this function.
2017-07-04 09:24:10 +01:00