Simon Marchi [Sun, 27 Nov 2016 03:05:06 +0000 (22:05 -0500)]
Remove ui_out_destroy
It's not actually used, and removing it simplifies the upcoming patches
a bit. After the whole series, destroying an ui_out object will be
simply "delete uiout", which will call the default destructor.
gdb/ChangeLog:
* ui-out.c (ui_out_destroy, uo_data_destroy): Remove.
* ui-out.h (ui_out_destroy): Remove.
Simon Marchi [Sun, 27 Nov 2016 03:04:49 +0000 (22:04 -0500)]
Rename ui_out_data to mi_ui_out_data
Just a little cleanup, so the name is more consistent with the naming of
the equivalent structures of cli and tui. It goes away in subsequent
patches anyway, but it might help follow the changes in those patches...
gdb/ChangeLog:
* mi/mi-out.c (ui_out_data): Rename to ...
(mi_ui_out_data): ... this.
Simon Marchi [Sun, 27 Nov 2016 03:02:56 +0000 (22:02 -0500)]
Remove unused functions and declarations
gdb/ChangeLog:
* ui-out.c (_initialize_ui_out): Remove.
(ui_out_set_flags): Remove.
(ui_out_clear_flags): Remove.
* ui-out.h (ui_out_begin_cleanup_end): Remove.
(ui_out_begin_cleanup_end): Remove.
(ui_out_set_flags): Remove.
(ui_out_clear_flags): Remove.
* mi/mi-out.c (_initialize_mi_out): Remove.
(mi_out_buffered): Remove.
* mi/mi-out.h (mi_out_buffered): Remove.
GDB Administrator [Sun, 27 Nov 2016 00:00:30 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Thu, 24 Nov 2016 15:23:07 +0000 (10:23 -0500)]
Remove stale comments
The default ui_out is gone since commit
23ff98d2fed4a1eaeb815e18cd4169e5aa7aaa60.
gdb/ChangeLog:
* ui-out.h (struct ui_out_impl): Remove comment.
* ui-out.c (struct ui_out): Remove comment.
GDB Administrator [Sat, 26 Nov 2016 00:00:09 +0000 (00:00 +0000)]
Automatic date update in version.in
John Baldwin [Fri, 25 Nov 2016 18:29:50 +0000 (10:29 -0800)]
Remove check requiring void argument to functions with no parameters.
C++ treats an empty parameter list as no parameters unlike C.
gdb/ChangeLog:
* contrib/ari/gdb_ari.sh (no parameter function): Remove check.
Simon Marchi [Fri, 25 Nov 2016 14:58:02 +0000 (09:58 -0500)]
Fix typo in Makefile
Fix a typo I made in my previous Makefile cleanup series.
Thanks to Patrick Monnerat for reporting.
gdb/ChangeLog:
* Makefile.in: Fix typo.
Simon Marchi [Fri, 25 Nov 2016 14:41:58 +0000 (09:41 -0500)]
Fix typos in comment
gdb/ChangeLog:
* record-full.c (record_full_resume): Fix typos in comment.
Simon Marchi [Fri, 25 Nov 2016 14:07:35 +0000 (09:07 -0500)]
Fix typo in comment
gdb/ChangeLog:
* infcmd.c (interrupt_command): Fix typo in comment.
Jose E. Marchesi [Fri, 25 Nov 2016 11:40:15 +0000 (03:40 -0800)]
gas: fix CBCOND diagnostics for invalid immediate operands.
This patch fixes two problems in the SPARC assembler:
- The diagnostic message
Error: Illegal operands: Immediate value in cbcond is out of range.
is incorrectly issued for non-CBCOND instructions that feature a
simm5 immediate field, such as MPMUL, MONTMUL, etc.
- When an invalid immediate operand is used in a CBCOND
instruction, two redundant error messages are issued to the
user, the second due to a stale fixup (this happens since
commit
85024cd8bcb93f4112470ecdbd6c10fc2aea724f).
Some diagnostic tests for the CBCOND instructions are also
included in the patch.
Tested in both sparc64-linux-gnu and sparcv9-linux-gnu targets.
gas/ChangeLog:
2016-11-25 Jose E. Marchesi <jose.marchesi@oracle.com>
* config/tc-sparc.c (sparc_ip): Avoid emitting a cbcond error
messages for non-cbcond instructions.
* testsuite/gas/sparc/cbcond-diag.s: New file.
* testsuite/gas/sparc/cbcond-diag.l: Likewise.
* testsuite/gas/sparc/sparc.exp (gas_64_check): Run cbcond-diag tests.
Jon Turney [Fri, 25 Nov 2016 09:47:31 +0000 (09:47 +0000)]
Prevent problems with section alignment by not shrinking the .rsrc section.
PR ld/20193
* peXXigen.c (rsrc_process_section): Do not shrink the merged
.rsrc section.
GDB Administrator [Fri, 25 Nov 2016 00:00:09 +0000 (00:00 +0000)]
Automatic date update in version.in
John Baldwin [Thu, 24 Nov 2016 20:01:24 +0000 (12:01 -0800)]
Do not use std::move when assigning an anonymous object to a unique_ptr.
Using std::move forces an extra copy of the object. These changes fix
-Wpessimizing-move warnings from clang.
gdb/ChangeLog:
* ada-lang.c (create_excep_cond_exprs): Do not use 'std::move'.
* ax-gdb.c (agent_eval_command_one): Likewise.
(agent_eval_command_one): Likewise.
* breakpoint.c (parse_cond_to_aexpr): Likewise.
(parse_cmd_to_aexpr): Likewise.
* dtrace-probe.c (dtrace_process_dof_probe): Likewise.
* parse.c (parse_expression_for_completion): Likewise.
John Baldwin [Thu, 24 Nov 2016 20:01:24 +0000 (12:01 -0800)]
Add noexcept to custom non-throwing new operators.
Both libc++ and libstdc++ declare non-throwing new operators as
noexcept and overloads must also be noexcept. This fixes a
-Wmissing-exception-spec warning with clang.
gdb/ChangeLog:
* common/new-op.c (operator new): Mark 'noexcept'.
(operator new[]): Likewise.
Andreas Arnez [Thu, 24 Nov 2016 16:48:04 +0000 (17:48 +0100)]
Optimize byte-aligned copies in copy_bitwise()
The function copy_bitwise used for copying DWARF pieces can potentially
be invoked for large chunks of data. For instance, consider a large
struct one of whose members is currently located in a register. In this
case copy_bitwise would still copy the data bitwise in a loop, which is
much slower than necessary.
This change uses memcpy for the large part instead, if possible.
gdb/ChangeLog:
* dwarf2loc.c (copy_bitwise): Use memcpy for the middle part, if
it is byte-aligned.
Andreas Arnez [Thu, 24 Nov 2016 16:48:04 +0000 (17:48 +0100)]
Add unit test for copy_bitwise
This adds a unit test for the copy_bitwise function in dwarf2loc.c.
With the old (broken) version of copy_bitwise this test would generate
the following failure message:
(gdb) maintenance selftest
Self test failed: copy_bitwise
11000000 !=
10000000 (7+2 -> 0)
gdb/ChangeLog:
2016-11-24 Andreas Arnez <arnez@linux.vnet.ibm.com>
Pedro Alves <palves@redhat.com>
* dwarf2loc.c (bits_to_str, check_copy_bitwise)
(copy_bitwise_tests): New functions.
(_initialize_dwarf2loc): Register the new function
copy_bitwise_tests as a unit test.
* selftest.c (run_self_tests): Improve the failure message's
wording and formatting.
Andreas Arnez [Thu, 24 Nov 2016 16:48:03 +0000 (17:48 +0100)]
Fix copy_bitwise()
When the user writes or reads a variable whose location is described
with DWARF pieces (DW_OP_piece or DW_OP_bit_piece), GDB's helper
function copy_bitwise is invoked for each piece. The implementation of
this function has a bug that may result in a corrupted copy, depending
on alignment and bit size. (Full-byte copies are not affected.)
This rewrites copy_bitwise, replacing its algorithm by a fixed version,
and adding an appropriate test case. Without the fix the new test case
fails, e.g.:
print def_t
$2 = {a = 0, b =
4177919}
(gdb) FAIL: gdb.dwarf2/nonvar-access.exp: print def_t
Written in binary, the wrong result above looks like this:
01111111011111111111111
Which means that two zero bits have sneaked into the copy of the
original all-one bit pattern. The test uses this simple all-one value
in order to avoid another GDB bug that causes the DWARF piece of a
DW_OP_stack_value to be taken from the wrong end on big-endian
architectures.
gdb/ChangeLog:
* dwarf2loc.c (extract_bits_primitive): Remove.
(extract_bits): Remove.
(copy_bitwise): Rewrite. Fixes a possible corruption that may
occur for non-byte-aligned copies.
gdb/testsuite/ChangeLog:
* gdb.dwarf2/nonvar-access.exp: Add a test for accessing
non-byte-aligned bit fields.
Andreas Arnez [Thu, 24 Nov 2016 16:48:03 +0000 (17:48 +0100)]
Fix PR12616 - gdb does not implement DW_AT_data_bit_offset
The DW_AT_data_bit_offset attribute was introduced by DWARF V4 and
allows specifying the offset of a data member within its containing
entity. But although the new attribute was intended to replace
DW_AT_bit_offset for this purpose, GDB ignores it, and thus GCC still
emits DW_AT_bit_offset instead. See also
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71669.
This change fixes GDB's lack of support for DW_AT_data_bit_offset and
adds an appropriate test case.
gdb/ChangeLog:
PR gdb/12616
* dwarf2read.c (dwarf2_add_field): Handle the DWARF V4 attribute
DW_AT_data_bit_offset.
gdb/testsuite/ChangeLog:
PR gdb/12616
* gdb.dwarf2/nonvar-access.exp: New testcase. Check that GDB
respects the DW_AT_data_bit_offset attribute.
Jiong Wang [Thu, 24 Nov 2016 14:01:53 +0000 (14:01 +0000)]
[ARM] Bind defined symbol locally in PIE
bfd/
PR target/20737
* elf32-arm.c (elf32_arm_final_link_relocate): Bind defined symbol
locally in PIE.
ld/
* testsuite/ld-arm/pie-bind-locally-a.s: New test source.
* testsuite/ld-arm/pie-bind-locally-b.s: Likewise.
* testsuite/ld-arm/pie-bind-locally.d: New testcase.
* testsuite/ld-arm/arm-elf.exp: Run new testcase.
Nick Clifton [Thu, 24 Nov 2016 10:00:20 +0000 (10:00 +0000)]
Fix snafu parsing $ORIGIN.
PR ld/20858
* emultempl/elf32.em (_search_needed): Allow for path separator
and terminating NUL byte when allocating space for new $ORIGIN
path.
Kuan-Lin Chen [Thu, 24 Nov 2016 02:22:15 +0000 (10:22 +0800)]
RISC-V/bfd: Fix bitsize of R_RISCV_ADD8.
bfd/ChangeLog:
* bfd/elfxx-riscv.c (howto_table): Fix bitsize of R_RISCV_ADD8.
GDB Administrator [Thu, 24 Nov 2016 00:00:32 +0000 (00:00 +0000)]
Automatic date update in version.in
Pedro Alves [Wed, 23 Nov 2016 15:36:26 +0000 (15:36 +0000)]
gdb: Use C++11 std::chrono
This patch fixes a few problems with GDB's time handling.
#1 - It avoids problems with gnulib's C++ namespace support
On MinGW, the struct timeval that should be passed to gnulib's
gettimeofday replacement is incompatible with libiberty's
timeval_sub/timeval_add. That's because gnulib also replaces "struct
timeval" with its own definition, while libiberty expects the
system's.
E.g., in code like this:
gettimeofday (&prompt_ended, NULL);
timeval_sub (&prompt_delta, &prompt_ended, &prompt_started);
timeval_add (&prompt_for_continue_wait_time,
&prompt_for_continue_wait_time, &prompt_delta);
That's currently handled in gdb by not using gnulib's gettimeofday at
all (see common/gdb_sys_time.h), but that #undef hack won't work with
if/when we enable gnulib's C++ namespace support, because that mode
adds compile time warnings for uses of ::gettimeofday, which are hard
errors with -Werror.
#2 - But there's an elephant in the room: gettimeofday is not monotonic...
We're using it to:
a) check how long functions take, for performance analysis
b) compute when in the future to fire events in the event-loop
c) print debug timestamps
But that's exactly what gettimeofday is NOT meant for. Straight from
the man page:
~~~
The time returned by gettimeofday() is affected by
discontinuous jumps in the system time (e.g., if the system
administrator manually changes the system time). If you need a
monotonically increasing clock, see clock_gettime(2).
~~~
std::chrono (part of the C++11 standard library) has a monotonic clock
exactly for such purposes (std::chrono::steady_clock). This commit
switches to use that instead of gettimeofday, fixing all the issues
mentioned above.
gdb/ChangeLog:
2016-11-23 Pedro Alves <palves@redhat.com>
* Makefile.in (SFILES): Add common/run-time-clock.c.
(HFILES_NO_SRCDIR): Add common/run-time-clock.h.
(COMMON_OBS): Add run-time-clock.o.
* common/run-time-clock.c, common/run-time-clock.h: New files.
* defs.h (struct timeval, print_transfer_performance): Delete
declarations.
* event-loop.c (struct gdb_timer) <when>: Now a
std::chrono::steady_clock::time_point.
(create_timer): use std::chrono::steady_clock instead of
gettimeofday. Use new instead of malloc.
(delete_timer): Use delete instead of xfree.
(duration_cast_timeval): New.
(update_wait_timeout): Use std::chrono::steady_clock instead of
gettimeofday.
* maint.c: Include <chrono> instead of "gdb_sys_time.h", <time.h>
and "timeval-utils.h".
(scoped_command_stats::~scoped_command_stats)
(scoped_command_stats::scoped_command_stats): Use
std::chrono::steady_clock instead of gettimeofday. Use
user_cpu_time_clock instead of get_run_time.
* maint.h: Include "run-time-clock.h" and <chrono>.
(scoped_command_stats): <m_start_cpu_time>: Now a
user_cpu_time_clock::time_point.
<m_start_wall_time>: Now a std::chrono::steady_clock::time_point.
* mi/mi-main.c: Include "run-time-clock.h" and <chrono> instead of
"gdb_sys_time.h" and <sys/resource.h>.
(rusage): Delete.
(mi_execute_command): Use new instead of XNEW.
(mi_load_progress): Use std::chrono::steady_clock instead of
gettimeofday.
(timestamp): Rewrite in terms of std::chrono::steady_clock,
user_cpu_time_clock and system_cpu_time_clock.
(timeval_diff): Delete.
(print_diff): Adjust to use std::chrono::steady_clock,
user_cpu_time_clock and system_cpu_time_clock.
* mi/mi-parse.h: Include "run-time-clock.h" and <chrono> instead
of "gdb_sys_time.h".
(struct mi_timestamp): Change fields types to
std::chrono::steady_clock::time_point, user_cpu_time_clock::time
and system_cpu_time_clock::time_point, instead of struct timeval.
* symfile.c: Include <chrono> instead of <time.h> and
"gdb_sys_time.h".
(struct time_range): New.
(generic_load): Use std::chrono::steady_clock instead of
gettimeofday.
(print_transfer_performance): Replace timeval parameters with a
std::chrono::steady_clock::duration parameter. Adjust.
* utils.c: Include <chrono> instead of "timeval-utils.h",
"gdb_sys_time.h", and <time.h>.
(prompt_for_continue_wait_time): Now a
std::chrono::steady_clock::duration.
(defaulted_query, prompt_for_continue): Use
std::chrono::steady_clock instead of
gettimeofday/timeval_sub/timeval_add.
(reset_prompt_for_continue_wait_time): Use
std::chrono::steady_clock::duration instead of struct timeval.
(get_prompt_for_continue_wait_time): Return a
std::chrono::steady_clock::duration instead of struct timeval.
(vfprintf_unfiltered): Use std::chrono::steady_clock instead of
gettimeofday. Use std::string. Use '.' instead of ':'.
* utils.h: Include <chrono>.
(get_prompt_for_continue_wait_time): Return a
std::chrono::steady_clock::duration instead of struct timeval.
gdb/gdbserver/ChangeLog:
2016-11-23 Pedro Alves <palves@redhat.com>
* debug.c: Include <chrono> instead of "gdb_sys_time.h".
(debug_vprintf): Use std::chrono::steady_clock instead of
gettimeofday. Use '.' instead of ':'.
* tracepoint.c: Include <chrono> instead of "gdb_sys_time.h".
(get_timestamp): Use std::chrono::steady_clock instead of
gettimeofday.
Nick Clifton [Wed, 23 Nov 2016 14:57:51 +0000 (14:57 +0000)]
Adjust linker test for arm-vxworks in wake of patch for PR 20815.
Simon Marchi [Tue, 22 Nov 2016 21:14:25 +0000 (16:14 -0500)]
Minor formatting fixups in Makefiles
Mostly some whitespace changes to make things a bit more consistent.
gdb/ChangeLog:
* Makefile.in: Fix whitespace formatting.
gdb/gdbserver/ChangeLog:
* Makefile.in: Fix whitespace formatting.
Simon Marchi [Tue, 22 Nov 2016 21:14:24 +0000 (16:14 -0500)]
Normalize names of some source files
Most tdep/nat files are named:
<cpu>-<os>-tdep.c
<cpu>-<os>-nat.c
A few files do not respect this scheme. This patch renames them so that
they are consistent with the rest of the files. It builds fine with
--enable-targets=all, but that doesn't test the nat files. I can only
hope that my grep skill is good enough.
gdb/ChangeLog:
* Makefile.in (ALL_64_TARGET_OBS, ALL_TARGET_OBS,
HFILES_NO_SRCDIR, ALLDEPFILES): Rename files.
* alphabsd-nat.c: Rename to ...
* alpha-bsd-nat.c: ... this, adjust include.
* alphabsd-tdep.c: Rename to ...
* alpha-bsd-tdep.c: ... this, adjust include.
* alphabsd-tdep.h: Rename to ...
* alpha-bsd-tdep.h: ... this, adjust include barrier and comment.
* alphafbsd-tdep.c: Rename to ...
* alpha-fbsd-tdep.c: ... this.
* alphanbsd-tdep.c: Rename to ...
* alpha-nbsd-tdep.c: ... this, adjust include.
* alphaobsd-tdep.c: Rename to ...
* alpha-obsd-tdep.c: ... this, adjust include.
* amd64bsd-nat.c: Rename to ...
* amd64-bsd-nat.c: ... this, adjust include.
* amd64fbsd-nat.c: Rename to ...
* amd64-fbsd-nat.c: ... this, adjust include.
* amd64fbsd-tdep.c: Rename to ...
* amd64-fbsd-tdep.c: ... this, adjust include.
* amd64nbsd-nat.c: Rename to ...
* amd64-nbsd-nat.c: ... this.
* amd64nbsd-tdep.c: Rename to ...
* amd64-nbsd-tdep.c: ... this.
* amd64obsd-nat.c: Rename to ...
* amd64-obsd-nat.c: ... this.
* amd64obsd-tdep.c: Rename to ...
* amd64-obsd-tdep.c: ... this.
* amd64-tdep.h: Update comments.
* armbsd-tdep.c: Rename to ...
* arm-bsd-tdep.c: ... this.
* armnbsd-nat.c: Rename to ...
* arm-nbsd-nat.c: ... this.
* armnbsd-tdep.c: Rename to ...
* arm-nbsd-tdep.c: ... this.
* armobsd-tdep.c: Rename to ...
* arm-obsd-tdep.c: ... this.
* arm-tdep.h: Update comments.
* hppabsd-tdep.c: Rename to ...
* hppa-bsd-tdep.c: ... this, adjust include.
* hppabsd-tdep.h: Rename to ...
* hppa-bsd-tdep.h: ... this, adjust include barrier and comment.
* hppanbsd-nat.c: Rename to ...
* hppa-nbsd-nat.c: ... this.
* hppanbsd-tdep.c: Rename to ...
* hppa-nbsd-tdep.c: ... this, adjust include.
* hppaobsd-nat.c: Rename to ...
* hppa-obsd-nat.c: ... this.
* hppaobsd-tdep.c: Rename to ...
* hppa-obsd-tdep.c: ... this, adjust include.
* i386bsd-nat.c: Rename to ...
* i386-bsd-nat.c: ... this, adjust include.
* i386bsd-nat.h: Rename to ...
* i386-bsd-nat.h: ... this, adjust include barrier and comment.
* i386bsd-tdep.c: Rename to ...
* i386-bsd-tdep.c: ... this.
* i386fbsd-nat.c: Rename to ...
* i386-fbsd-nat.c: ... this, adjust include.
* i386fbsd-tdep.c: Rename to ...
* i386-fbsd-tdep.c: ... this, adjust include.
* i386fbsd-tdep.h: Rename to ...
* i386-fbsd-tdep.h: ... this, adjust include barrier and comment.
* i386gnu-nat.c: Rename to ...
* i386-gnu-nat.c: ... this.
* i386gnu-tdep.c: Rename to ...
* i386-gnu-tdep.c: ... this.
* i386nbsd-nat.c: Rename to ...
* i386-nbsd-nat.c: ... this, adjust include.
* i386nbsd-tdep.c: Rename to ...
* i386-nbsd-tdep.c: ... this.
* i386obsd-nat.c: Rename to ...
* i386-obsd-nat.c: ... this, adjust include.
* i386obsd-tdep.c: Rename to ...
* i386-obsd-tdep.c: ... this.
* i386v4-nat.c: Rename to ...
* i386-v4-nat.c: ... this.
* i386-tdep.h: Update comments.
* m68k-tdep.h: Update comments.
* m68kbsd-nat.c: Rename to ...
* m68k-bsd-nat.c: ... this.
* m68kbsd-tdep.c: Rename to ...
* m68k-bsd-tdep.c: ... this.
* m68klinux-nat.c: Rename to ...
* m68k-linux-nat.c: ... this.
* m68klinux-tdep.c: Rename to ...
* m68k-linux-tdep.c: ... this.
* m88kbsd-nat.c: Rename to ...
* m88k-bsd-nat.c: ... this.
* mipsnbsd-nat.c: Rename to ...
* mips-nbsd-nat.c: ... this, adjust include.
* mipsnbsd-tdep.c: Rename to ...
* mips-nbsd-tdep.c: ... this, adjust include.
* mipsnbsd-tdep.h: Rename to ...
* mips-nbsd-tdep.h: ... this, adjust include barrier and comment.
* mips64obsd-nat.c: Rename to ...
* mips64-obsd-nat.c: ... this.
* mips64obsd-tdep.c: Rename to ...
* mips64-obsd-tdep.c: ... this.
* ppcfbsd-nat.c: Rename to ...
* ppc-fbsd-nat.c: ... this, adjust include.
* ppcfbsd-tdep.c: Rename to ...
* ppc-fbsd-tdep.c: ... this, adjust include.
* ppcfbsd-tdep.h: Rename to ...
* ppc-fbsd-tdep.h: ... this, adjust include barrier and comment.
* ppcnbsd-nat.c: Rename to ...
* ppc-nbsd-nat.c: ... this, adjust include.
* ppcnbsd-tdep.c: Rename to ...
* ppc-nbsd-tdep.c: ... this, adjust include.
* ppcnbsd-tdep.h: Rename to ...
* ppc-nbsd-tdep.h: ... this, adjust include barrier and comment.
* ppcobsd-nat.c: Rename to ...
* ppc-obsd-nat.c: ... this, adjust include.
* ppcobsd-tdep.c: Rename to ...
* ppc-obsd-tdep.c: ... this, adjust include.
* ppcobsd-tdep.h: Rename to ...
* ppc-obsd-tdep.h: ... this, adjust include barrier and comment.
* shnbsd-nat.c: Rename to ...
* sh-nbsd-nat.c: ... this.
* shnbsd-tdep.c: Rename to ...
* sh-nbsd-tdep.c: ... this.
* sparcnbsd-nat.c: Rename to ...
* sparc-nbsd-nat.c: ... this.
* sparcnbsd-tdep.c: Rename to ...
* sparc-nbsd-tdep.c: ... this.
* sparcobsd-tdep.c: Rename to ...
* sparc-obsd-tdep.c: ... this.
* sparc64fbsd-nat.c: Rename to ...
* sparc64-fbsd-nat.c: ... this.
* sparc64fbsd-tdep.c: Rename to ...
* sparc64-fbsd-tdep.c: ... this.
* sparc64nbsd-nat.c: Rename to ...
* sparc64-nbsd-nat.c: ... this.
* sparc64nbsd-tdep.c: Rename to ...
* sparc64-nbsd-tdep.c: ... this.
* sparc64obsd-nat.c: Rename to ...
* sparc64-obsd-nat.c: ... this.
* sparc64obsd-tdep.c: Rename to ...
* sparc64-obsd-tdep.c: ... this.
* sparc64-tdep.h: Update comments.
* vaxbsd-nat.c: Rename to ...
* vax-bsd-nat.c: ... this.
* vaxnbsd-tdep.c: Rename to ...
* vax-nbsd-tdep.c: ... this.
* vaxobsd-tdep.c: Rename to ...
* vax-obsd-tdep.c: ... this.
* x86bsd-nat.h: Rename to ...
* x86-bsd-nat.h: ... this, adjust include barrier and comment.
* x86bsd-nat.c: Rename to ...
* x86-bsd-nat.c: ... this, adjust include.
* configure.tgt: Update renamed files.
* config/alpha/fbsd.mh: Update renamed files.
* config/alpha/nbsd.mh: Update renamed files.
* config/arm/nbsdelf.mh: Update renamed files.
* config/djgpp/fnchange.lst: Update renamed files.
* config/i386/fbsd.mh: Update renamed files.
* config/i386/fbsd64.mh: Update renamed files.
* config/i386/i386gnu.mh: Update renamed files.
* config/i386/i386sol2.mh: Update renamed files.
* config/i386/nbsd64.mh: Update renamed files.
* config/i386/nbsdelf.mh: Update renamed files.
* config/i386/obsd.mh: Update renamed files.
* config/i386/obsd64.mh: Update renamed files.
* config/i386/sol2-64.mh: Update renamed files.
* config/m68k/linux.mh: Update renamed files.
* config/m68k/nbsdelf.mh: Update renamed files.
* config/m68k/obsd.mh: Update renamed files.
* config/m88k/obsd.mh: Update renamed files.
* config/mips/nbsd.mh: Update renamed files.
* config/mips/obsd64.mh: Update renamed files.
* config/pa/nbsd.mh: Update renamed files.
* config/pa/obsd.mh: Update renamed files.
* config/powerpc/fbsd.mh: Update renamed files.
* config/powerpc/nbsd.mh: Update renamed files.
* config/powerpc/obsd.mh: Update renamed files.
* config/sh/nbsd.mh: Update renamed files.
* config/sparc/fbsd.mh: Update renamed files.
* config/sparc/nbsd64.mh: Update renamed files.
* config/sparc/nbsdelf.mh: Update renamed files.
* config/sparc/obsd64.mh: Update renamed files.
* config/vax/nbsdelf.mh: Update renamed files.
* config/vax/obsd.mh: Update renamed files.
Simon Marchi [Tue, 22 Nov 2016 21:14:22 +0000 (16:14 -0500)]
Makefiles: Flatten and sort file lists
I find the big file lists in the Makefiles a bit ugly and not very
practical. Since there are multiple filenames on each line (as much as
fits in 80 columns), it's not easy to add, remove or change a name in
the middle. As a result, we have a mix of long and short lines in no
particular order (ALL_TARGET_OBS is a good example).
I therefore suggest flattening the lists (one name per line) and keeping
them in alphabetical order. The diffs will be much clearer and merge
conflicts will be easier to resolve.
A nice (IMO) side-effect I observed is that the files are compiled
alphabetically by make, so it gives a rough idea of the progress of the
build.
I added a comment in gdb/Makefile.in to mention to keep the file lists
ordered, and gave the general guidelines on what order to respect. I
added a comment in other Makefiles which refers to gdb/Makefile.in, to
avoid duplication.
Running the patch through the buildbot found that gdb.base/default.exp
started to fail. The languages in the error message shown when typing
"set language" have changed order. We could probably improve gdb so
that it prints them in a stable order, regardless of the order of the
object list passed to the linked, but just fixing the test is easier for
now.
New in v2:
- Change ordering style, directories go at the end.
- Cleanup gdbserver's and data-directory's Makefile as well.
- Add comments at top of Makefiles about the ordering.
- Remove wrong trailing backslahes.
- Fix test gdb.base/default.exp.
gdb/ChangeLog:
* Makefile.in: Add comment about file lists ordering.
(SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_MI_OBS, SUBDIR_MI_SRCS,
SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS, SUBDIR_GCC_COMPILE_OBS,
SUBDIR_GCC_COMPILE_SRCS, SUBDIR_GUILE_OBS, SUBDIR_GUILE_SRCS,
SUBDIR_PYTHON_OBS, SUBDIR_PYTHON_SRCS, SUBDIR_GDBTK_OBS,
SUBDIR_GDBTK_SRCS, XMLFILES, REMOTE_OBS, ALL_64_TARGET_OBS,
ALL_TARGET_OBS, SFILES, HFILES_NO_SRCDIR, HFILES_WITH_SRCDIR,
COMMON_OBS, YYFILES, YYOBJ, generated_files, ALLDEPFILES):
Flatten list and order alphabetically.
* data-directory/Makefile.in: Add comment about file lists
ordering.
(GEN_SYSCALLS_FILES, PYTHON_FILE_LIST): Flatten list and order
alphabetically.
gdb/gdbserver/ChangeLog:
* Makefile.in (SFILES, OBS): Flatten list and order
alphabetically.
gdb/testsuite/ChangeLog:
* gdb.base/default.exp: Fix output of "set language".
Nick Clifton [Wed, 23 Nov 2016 11:10:39 +0000 (11:10 +0000)]
Fix the linker so that it will not silently generate ELF binaries with invalid program headers. Fix readelf to report such invalid binaries.
PR ld/20815
bfd * elf.c (elf_modify_segment_map): Allow empty LOAD segments if
they contain the program headers.
(_bfd_elf_map_sections_to_segments): If the linker created the
PHDR segment then always attempt to include it in a LOAD segment.
(assign_file_positions_for_non_load_sections): Allow LOAD segments
to overlap PHDR segments.
(phdr_sorter): New function. Sorts program headers.
(assign_file_positions_except_relocs): Sort the program headers
before writing them out. Issue an error if the PHDR segment is
not covered by a LOAD segment, unless the backend allows it.
* elf-bfd.h (struct elf_backend_data): Add
elf_backend_allow_non_load_phdr.
* elfxx-target.h (elf_backend_allow_non_load_phdr): Provide
default definition that returns FALSE.
(elfNN_bed): Initialise the elf_backend_allow_non_load_phdr
field.
* elf64-hppa.c (elf64_hppa_allow_non_load_phdr): New function.
Returns TRUE.
(elf_backend_allow_non_load_phdr): Define.
* elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Do not
place the interpreter string into the .interp section if the
nointerp flag is set in the link info structure.
* elf32-arc.c (elf_arc_size_dynamic_sections): Likewise.
* elf32-score7.c (score_elf_final_link_relocate): Allow for the
_gp symbol not being part of the output.
binutils* readelf.c (process_program_headers): Check PT_LOAD and PT_PHDR
segments for validity.
ld * ld.texinfo: Note that PT_TLS can be used as a segment type.
* testsuite/ld-discard/discard.ld: Add space for program headers.
* testsuite/ld-elf/flags1.ld: Likewise.
* testsuite/ld-elf/maxpage3.t: Likewise.
* testsuite/ld-elf/noload-1.t: Likewise.
* testsuite/ld-elf/orphan.ld: Likewise.
* testsuite/ld-elf/overlay.t: Likewise.
* testsuite/ld-elf/pr14052.t: Likewise.
* testsuite/ld-elf/pr19539.t: Likewise.
* testsuite/ld-elf/provide-hidden-1.ld: Likewise.
* testsuite/ld-elf/provide-hidden-s.ld: Likewise.
* testsuite/ld-elf/weak-dyn-1.ld: Likewise.
* testsuite/ld-i386/pr19539.t: Likewise.
* testsuite/ld-scripts/defined.t: Likewise.
* testsuite/ld-scripts/defined6.t: Likewise.
* testsuite/ld-scripts/dynamic-sections.t: Likewise.
* testsuite/ld-scripts/empty-aligned.t: Likewise.
* testsuite/ld-scripts/provide-2.t: Likewise.
* testsuite/ld-scripts/provide-4.t: Likewise.
* testsuite/ld-vax-elf/plt-local.ld: Likewise.
* testsuite/ld-x86-64/pr19539.t: Likewise.
* testsuite/ld-elf/ehdr_start-missing.d: Do not initialise the
dynamic linker.
* testsuite/ld-elf/ehdr_start-weak.d: Likewise.
* testsuite/ld-elf/elf.exp (pr14170, pr17068): Likewise.
* testsuite/ld-elf/loadaddr1.d: Update expected readelf output.
* testsuite/ld-elf/noload-2.d: Likewise.
* testsuite/ld-powerpc/vxworks2.sd: Likewise.
* testsuite/ld-scripts/phdrs3a.d: Likewise.
* testsuite/ld-scripts/size-2.d: Likewise.
* testsuite/ld-elf/group.ld: Add program headers.
* testsuite/ld-elf/overlay.d: Skip for SPU.
* testsuite/ld-elf/flags1.d: Skip for RX.
* testsuite/ld-elf/pr19162.d: Skip for HPPA64.
* testsuite/ld-elf/pr19539.d: Skip for ALPHA.
* testsuite/ld-scripts/empty-orphan.t: Update program headers.
* testsuite/ld-scripts/size-2.t: Likewise.
Jose E. Marchesi [Wed, 23 Nov 2016 11:04:17 +0000 (03:04 -0800)]
gas: run the hwcaps-bump tests with 64-bit sparc objects only.
gas/ChangeLog:
2016-11-23 Jose E. Marchesi <jose.marchesi@oracle.com>
* testsuite/gas/sparc/sparc.exp (gas_64_check): Make sure the
hwcaps-bump test is run with 64-bit objects.
Kuan-Lin Chen [Wed, 23 Nov 2016 05:18:59 +0000 (13:18 +0800)]
RISCV/GAS Add missing break in md_apply_fix.
gdb/ChangeLog:
* config/tc-riscv.c: Add missing break.
Alan Modra [Wed, 23 Nov 2016 04:37:17 +0000 (15:07 +1030)]
elf_backend_dtrel_excludes_plt
Now that all targets creating .rel.plt/.rela.plt use the ELF hash
table shortcut srelplt, the generic ELF code can set up DT_RELSZ/
DT_RELASZ and DT_REL/DT_RELA for targets that don't want PLT relocs
included in those tags.
* elf-bfd.h (struct elf_backend_data): Add dtrel_excludes_plt.
* elfxx-target.h (elf_backend_dtrel_excludes_plt): Define.
(elfNN_bed): Init new field.
* elflink.c (bfd_elf_final_link): Add and use htab variable. Handle
dtrel_excludes_plt.
* elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_sections): Delete
DT_RELASZ code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-arc.c (elf_arc_finish_dynamic_sections): Delete DT_RELASZ code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-arm.c (elf32_arm_finish_dynamic_sections): Delete code
subtracting off plt relocs from DT_RELSZ, DT_RELASZ.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-cr16.c (_bfd_cr16_elf_finish_dynamic_sections): Delete
DT_RELASZ code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-cris.c (elf_cris_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Delete DT_RELASZ
and DT_RELA code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-i386.c (elf_i386_finish_dynamic_sections): Delete DT_RELSZ
and DT_REL code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-lm32.c (lm32_elf_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-m32r.c (m32r_elf_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-m68k.c (elf_m68k_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-metag.c (elf_metag_finish_dynamic_sections): Delete DT_RELASZ
and DT_RELA code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Delete
DT_RELASZ and DT_RELA code. Use ELF htab shortcuts for other
dynamic sections.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-mips.c (elf_backend_dtrel_excludes_plt): Define.
* elf32-nds32.c (nds32_elf_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-or1k.c (or1k_elf_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-ppc.c (ppc_elf_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-sh.c (sh_elf_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-sparc.c (elf_backend_dtrel_excludes_plt): Define.
* elf32-vax.c (elf_vax_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Delete DT_RELASZ
and DT_RELA code.
(elf_backend_dtrel_excludes_plt): Define.
* elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): Delete
DT_RELASZ code.
(elf_backend_dtrel_excludes_plt): Define.
* elfnn-ia64.c (elfNN_ia64_finish_dynamic_sections): Delete DT_RELASZ
code.
(elf_backend_dtrel_excludes_plt): Define.
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Delete
DT_RELASZ code.
* elfxx-sparc.c (sparc_finish_dyn): Delete DT_RELASZ code.
Alan Modra [Wed, 23 Nov 2016 04:36:34 +0000 (15:06 +1030)]
Delete duplicate target short-cuts to dynamic sections
We'd like to have the elf_link_hash_table srelplt field rather than
some private target field used to save short-cuts to a PLT relocation
section. This save a little space but mainly is so that the generic
ELF code can access the field. Ditto for other dynamic sections.
* elf-m10300.c (mn10300_elf_check_relocs): Use elf htab shortcuts
to dynamic sections.
(mn10300_elf_final_link_relocate): Likewise.
(_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise.
(_bfd_mn10300_elf_size_dynamic_sections): Likewise.
(_bfd_mn10300_elf_finish_dynamic_symbol): Likewise.
(_bfd_mn10300_elf_finish_dynamic_sections): Likewise.
* elf32-bfin.c (bfin_check_relocs): Likewise.
(bfin_relocate_section): Likewise.
(bfin_gc_sweep_hook): Likewise.
(struct bfinfdpic_elf_link_hash_table): Delete sgot, sgotrel, splt
and spltrel.
(bfinfdpic_got_section, bfinfdpic_gotrel_section,
bfinfdpic_plt_section, bfinfdpic_pltrel_section): Define using elf
shortcut sections.
(_bfin_create_got_section): Use elf htab shortcuts to dyn sections.
Delete dead code.
(bfin_finish_dynamic_symbol): Use elf htab shortcuts to dyn sections.
(bfin_size_dynamic_sections): Likewise.
* elf32-cr16.c (_bfd_cr16_elf_create_got_section): Likewise.
(cr16_elf_check_relocs): Likewise.
(cr16_elf_final_link_relocate): Likewise.
(_bfd_cr16_elf_create_dynamic_sections): Likewise.
(_bfd_cr16_elf_adjust_dynamic_symbol): Likewise.
(_bfd_cr16_elf_size_dynamic_sections): Likewise.
(_bfd_cr16_elf_finish_dynamic_symbol): Likewise.
(_bfd_cr16_elf_finish_dynamic_sections): Likewise.
* elf32-cris.c (cris_elf_relocate_section): Likewise.
(elf_cris_finish_dynamic_symbol): Likewise.
(elf_cris_finish_dynamic_sections): Likewise.
(cris_elf_gc_sweep_hook): Likewise.
(elf_cris_adjust_gotplt_to_got): Likewise.
(elf_cris_adjust_dynamic_symbol): Likewise.
(cris_elf_check_relocs): Likewise. Delete dead code.
(elf_cris_size_dynamic_sections): Use elf htab shortcuts to dynamic
sections.
(elf_cris_discard_excess_program_dynamics): Likewise.
* elf32-frv.c (struct frvfdpic_elf_link_hash_table): Delete sgot,
sgotrel, splt and spltrel.
(frvfdpic_got_section, frvfdpic_gotrel_section,
frvfdpic_plt_section, frvfdpic_pltrel_section): Define using elf
shortcut sections.
(_frv_create_got_section): Likewise.
* elf32-hppa.c (struct elf32_hppa_link_hash_table): Delete sgot,
srelgot, splt and srelplt.
(hppa_build_one_stub): Use elf htab shortcuts to dynamic sections.
(elf32_hppa_create_dynamic_sections): Likewise.
(elf32_hppa_check_relocs): Likewise.
(allocate_plt_static): Likewise.
(allocate_dynrelocs): Likewise.
(elf32_hppa_size_dynamic_sections): Likewise.
(elf32_hppa_relocate_section): Likewise.
(elf32_hppa_finish_dynamic_symbol): Likewise.
(elf32_hppa_finish_dynamic_sections): Likewise.
* elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
* elf32-lm32.c (struct elf_lm32_link_hash_table): Delete sgot,
sgotplt, srelgot, splt and srelplt.
(lm32fdpic_got_section, lm32fdpic_gotrel_section): Define using elf
shortcut sections.
(create_got_section): Delete. Use _bfd_elf_create_got_section instead.
(lm32_elf_relocate_section): Use elf htab shortcuts to dyn sections.
(lm32_elf_check_relocs): Likewise.
(lm32_elf_finish_dynamic_sections): Likewise.
(lm32_elf_finish_dynamic_symbol): Likewise.
(allocate_dynrelocs): Likewise.
(lm32_elf_size_dynamic_sections): Likewise.
(lm32_elf_create_dynamic_sections): Likewise.
* elf32-m32c.c (m32c_elf_relocate_section): Likewise.
(m32c_elf_check_relocs): Likewise.
(m32c_elf_finish_dynamic_sections): Likewise.
(m32c_elf_always_size_sections): Likewise.
* elf32-m32r.c (struct elf_m32r_link_hash_table): Delete sgot,
sgotplt, srelgot, splt and srelplt.
(create_got_section): Delete. Use _bfd_elf_create_got_section instead.
(m32r_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic
sections.
(allocate_dynrelocs): Likewise.
(m32r_elf_size_dynamic_sections): Likewise.
(m32r_elf_relocate_section): Likewise.
(m32r_elf_finish_dynamic_symbol): Likewise.
(m32r_elf_finish_dynamic_sections): Likewise.
(m32r_elf_check_relocs): Likewise.
* elf32-m68k.c (elf_m68k_partition_multi_got): Likewise.
(elf_m68k_check_relocs): Likewise.
(elf_m68k_adjust_dynamic_symbol): Likewise.
(elf_m68k_size_dynamic_sections): Likewise.
(elf_m68k_relocate_section): Likewise.
(elf_m68k_finish_dynamic_symbol): Likewise.
(elf_m68k_finish_dynamic_sections): Likewise.
* elf32-metag.c (struct elf_metag_link_hash_table): Delete sgot,
sgotplt, srelgot, splt and srelplt.
(elf_metag_relocate_section): Use elf htab shortcuts to dynamic
sections.
(elf_metag_create_dynamic_sections): Likewise. Allocate got header
here in .got.
(elf_metag_check_relocs): Use elf htab shortcuts to dynamic sections.
(allocate_dynrelocs): Likewise.
(elf_metag_size_dynamic_sections): Likewise.
(elf_metag_finish_dynamic_symbol): Likewise.
(elf_metag_finish_dynamic_sections): Likewise.
(elf_metag_size_stubs): Likewise.
(elf_backend_got_header_size): Don't define.
(elf_backend_want_got_plt): Define.
* elf32-microblaze.c (struct elf32_mb_link_hash_table): Delete sgot,
sgotplt, srelgot, splt and srelpl.
(microblaze_elf_relocate_section): Use elf htab shortcuts to dynamic
sections.
(create_got_section): Delete. Use _bfd_elf_create_got_section instead.
(microblaze_elf_check_relocs): Use elf htab shortcuts to dyn sections.
(microblaze_elf_create_dynamic_sections): Likewise.
(allocate_dynrelocs): Likewise.
(microblaze_elf_size_dynamic_sections): Likewise.
(microblaze_elf_finish_dynamic_symbol): Likewise.
(microblaze_elf_finish_dynamic_sections): Likewise.
* elf32-nds32.c (nds32_elf_link_hash_table_create): Don't NULL
already zero fields.
(create_got_section): Delete. Use _bfd_elf_create_got_section instead.
(nds32_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic
sections.
(allocate_dynrelocs): Likewise.
(nds32_elf_size_dynamic_sections): Likewise.
(nds32_elf_relocate_section): Likewise.
(nds32_elf_finish_dynamic_symbol): Likewise.
(nds32_elf_finish_dynamic_sections): Likewise.
(nds32_elf_check_relocs): Likewise.
(calculate_plt_memory_address): Likewise.
(calculate_got_memory_address): Likewise.
* elf32-nds32.h (struct elf_nds32_link_hash_table): Delete sgot,
sgotplt, srelgot, splt and srelplt.
* elf32-or1k.c (struct elf_or1k_link_hash_table): Likewise.
(or1k_elf_relocate_section): Use elf htab shortcuts to dyn sections.
(create_got_section): Delete. Use _bfd_elf_create_got_section instead.
(or1k_elf_check_relocs): Use elf htab shortcuts to dynamic sections.
(or1k_elf_finish_dynamic_sections): Likewise.
(or1k_elf_finish_dynamic_symbol): Likewise.
(allocate_dynrelocs): Likewise.
(or1k_elf_size_dynamic_sections): Likewise.
(or1k_elf_create_dynamic_sections): Likewise.
* elf32-ppc.c (struct ppc_elf_link_hash_table): Delete got, relgot,
plt, relplt, iplt, reliplt and sgotplt.
(ppc_elf_create_got): Use elf htab shortcuts to dynamic sections.
(ppc_elf_create_glink): Likewise.
(ppc_elf_create_dynamic_sections): Likewise.
(ppc_elf_check_relocs): Likewise.
(ppc_elf_select_plt_layout): Likewise.
(ppc_elf_tls_setup): Likewise.
(allocate_got): Likewise.
(allocate_dynrelocs): Likewise.
(ppc_elf_size_dynamic_sections): Likewise.
(ppc_elf_relax_section): Likewise.
(ppc_elf_relocate_section): Likewise.
(ppc_elf_finish_dynamic_symbol): Likewise.
(ppc_elf_reloc_type_class): Likewise.
(ppc_elf_finish_dynamic_sections): Likewise.
* elf32-rl78.c (rl78_elf_relocate_section): Likewise.
(rl78_elf_check_relocs): Likewise.
(rl78_elf_finish_dynamic_sections): Likewise.
(rl78_elf_always_size_sections): Likewise.
* elf32-s390.c (create_got_section): Delete.
(elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section.
(elf_s390_check_relocs): Likewise.
* elf32-score.c (score_elf_create_got_section): Set elf shortcuts.
(s3_bfd_score_elf_finish_dynamic_sections): Use elf shortcuts.
* elf32-score7.c (score_elf_create_got_section): As above.
(s7_bfd_score_elf_finish_dynamic_sections): As above.
* elf32-sh.c (struct elf_sh_link_hash_table): Delete sgot,
sgotplt, srelgot, splt and srelplt.
(create_got_section): Don't set them.
(sh_elf_create_dynamic_sections): Use elf htab shortcuts to dynamic
sections.
(allocate_dynrelocs): Likewise.
(sh_elf_size_dynamic_sections): Likewise.
(sh_elf_add_rofixup): Likewise.
(sh_elf_relocate_section): Likewise.
(sh_elf_check_relocs): Likewise.
(sh_elf_finish_dynamic_symbol): Likewise.
(sh_elf_finish_dynamic_sections): Likewise.
* elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
* elf32-tilepro.c (tilepro_elf_create_got_section): Likewise.
* elf32-vax.c (elf_vax_check_relocs): Likewise.
(elf_vax_adjust_dynamic_symbol): Likewise.
(elf_vax_always_size_sections): Likewise.
(elf_vax_instantiate_got_entries): Likewise.
(elf_vax_relocate_section): Likewise.
(elf_vax_finish_dynamic_symbol): Likewise.
(elf_vax_finish_dynamic_sections): Likewise.
* elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
(xstormy16_elf_always_size_sections): Likewise.
(xstormy16_elf_relocate_section): Likewise.
(xstormy16_elf_finish_dynamic_sections): Likewise.
* elf32-xtensa.c (struct elf_xtensa_link_hash_table): Delete sgot,
sgotplt, srelgot, splt and srelplt.
(elf_xtensa_create_dynamic_sections): Use elf htab shortcuts to
dynamic sections.
(elf_xtensa_allocate_dynrelocs): Likewise.
(elf_xtensa_allocate_local_got_size): Likewise.
(elf_xtensa_size_dynamic_sections): Likewise.
(elf_xtensa_relocate_section): Likewise.
(elf_xtensa_finish_dynamic_sections): Likewise.
(shrink_dynamic_reloc_sections): Likewise.
(elf_xtensa_get_plt_section): Likewise.
(elf_xtensa_get_gotplt_section): Likewise.
(xtensa_callback_required_dependence): Likewise.
* elf64-alpha.c (elf64_alpha_create_dynamic_sections): Set elf htab
shortcuts to dynamic sections.
(elf64_alpha_adjust_dynamic_symbol): Use elf htab shortcuts to
dynamic sections.
(elf64_alpha_size_plt_section): Likewise.
(elf64_alpha_size_rela_got_1): Likewise.
(elf64_alpha_size_rela_got_section): Likewise.
(elf64_alpha_relocate_section): Likewise.
(elf64_alpha_finish_dynamic_symbol): Likewise.
(elf64_alpha_finish_dynamic_sections): Likewise.
* elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise.
* elf64-s390.c (create_got_section): Delete.
(elf_s390_create_dynamic_sections): Use _bfd_elf_create_got_section.
(elf_s390_check_relocs): Likewise.
* elf64-sh64.c (sh_elf64_relocate_section): Use elf htab shortcuts to
dynamic sections.
(sh_elf64_check_relocs): Likewise.
(sh64_elf64_adjust_dynamic_symbol): Likewise.
(sh64_elf64_size_dynamic_sections): Likewise.
(sh64_elf64_finish_dynamic_symbol): Likewise.
(sh64_elf64_finish_dynamic_sections): Likewise.
* elflink.c (_bfd_elf_create_got_section): Likewise.
* elfnn-aarch64.c (aarch64_elf_create_got_section): Likewise.
* elfnn-ia64.c (elfNN_ia64_size_dynamic_sections): Likewise.
(elfNN_ia64_finish_dynamic_sections): Likewise.
* elfnn-riscv.c (riscv_elf_create_got_section): Likewise.
* elfxx-mips.c (struct mips_elf_link_hash_table): Delete srellt,
sgotplt, splt and sgot.
(mips_elf_initialize_tls_slots): Use elf htab shortcuts to dynamic
sections.
(mips_elf_gotplt_index): Likewise.
(mips_elf_primary_global_got_index): Likewise.
(mips_elf_global_got_index): Likewise.
(mips_elf_got_offset_from_index): Likewise.
(mips_elf_create_local_got_entry): Likewise.
(mips_elf_create_got_section): Likewise.
(mips_elf_calculate_relocation): Likewise.
(_bfd_mips_elf_create_dynamic_sections): Likewise.
(_bfd_mips_elf_adjust_dynamic_symbol): Likewise.
(mips_elf_lay_out_got): Likewise.
(mips_elf_set_plt_sym_value): Likewise.
(_bfd_mips_elf_size_dynamic_sections): Likewise.
(_bfd_mips_elf_finish_dynamic_symbol): Likewise.
(_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
(mips_finish_exec_plt): Likewise.
(mips_vxworks_finish_exec_plt): Likewise.
(mips_vxworks_finish_shared_plt): Likewise.
(_bfd_mips_elf_finish_dynamic_sections): Likewise.
* elfxx-sparc.c (sparc_finish_dyn): Likewise.
* elfxx-tilegx.c (tilegx_elf_create_got_section): Likewise.
Alan Modra [Wed, 23 Nov 2016 04:34:24 +0000 (15:04 +1030)]
Regen POTFILES.in
bfd/
* po/BLD-POTFILES.in: Regenerate.
* po/SRC-POTFILES.in: Regenerate.
gas/
* po/POTFILES.in: Regenerate.
Pedro Alves [Thu, 17 Nov 2016 23:15:34 +0000 (23:15 +0000)]
gdbserver: Use warning for warnings
gdb/gdbserver/ChangeLog:
2016-11-23 Pedro Alves <palves@redhat.com>
* event-loop.c (handle_file_event): Use warning.
* linux-low.c (linux_resume_one_lwp_throw): Use warning.
* mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
Use warning.
Pedro Alves [Fri, 18 Nov 2016 00:07:10 +0000 (00:07 +0000)]
gdbserver: Use debug_printf for debug output
gdb/gdbserver/ChangeLog:
2016-11-23 Pedro Alves <palves@redhat.com>
* linux-low.c (check_zombie_leaders): Use debug_printf for debug
output.
* notif.c (handle_notif_ack, notif_event_enque): Likewise.
* remote-utils.c (putpkt_binary_1, readchar, getpkt): Use
debug_printf and debug_flush for debug output.
* server.c (handle_general_set): Likewise.
* thread-db.c (try_thread_db_load): Use debug_printf for debug
output.
GDB Administrator [Wed, 23 Nov 2016 00:00:36 +0000 (00:00 +0000)]
Automatic date update in version.in
Cary Coutant [Tue, 22 Nov 2016 23:44:56 +0000 (15:44 -0800)]
Print the default for all binary options; clean up --help output.
gold/
PR gold/20346
* options.cc (One_option::print): Print "(default)" when appropriate.
* options.h: Clean up and re-sort options.
(One_option::is_default): New data member.
(One_option::One_option): Add is_default parameter; adjust all calls.
(DEFINE_var): Add is_default__ parameter; adjust all calls.
(DEFINE_bool): Set is_default based on default_value__.
(DEFINE_bool_ignore): New macro.
(--no-eh-frame-hdr): New option.
(--enable-new-dtags): Remove mention of DT_FLAGS.
Ambrogino Modigliani [Tue, 22 Nov 2016 16:05:00 +0000 (16:05 +0000)]
Fix spelling mistakes in comments in shell scripts
gdb/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* contrib/expect-read1.sh: Fix spelling in comments.
* gdb_buildall.sh: Fix spelling in comments.
* gdb_mbuild.sh: Fix spelling in comments.
Ambrogino Modigliani [Tue, 22 Nov 2016 15:43:03 +0000 (15:43 +0000)]
Fix spelling mistakes in comments in configure scripts
All changes are limited to comments, and no run-time behavior is
affected.
bfd/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* warning.m4: Fix spelling in comments.
* configure.ac: Fix spelling in comments.
* configure: Regenerate.
binutils/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* configure: Regenerate.
gdb/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* configure.ac: Fix spelling in comments.
* configure: Regenerate.
gas/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* configure: Regenerate.
gold/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* configure: Regenerate.
gprof/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* configure: Regenerate.
ld/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* configure: Regenerate.
opcodes/ChangeLog:
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* configure: Regenerate.
Yao Qi [Tue, 22 Nov 2016 14:05:06 +0000 (14:05 +0000)]
Change gdbarch software_single_step frame_info to regcache
This patch changes gdbarch method software_single_step's parameter from
"struct frame_info *" to "struct regcache *, IOW, software_single_step
starts to use current regcache rather than current frame for software
single.
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* gdbarch.sh (software_single_step): Change parameter from frame_info
to regcache.
* gdbarch.c, gdbarch.h: Regenerated.
* aarch64-tdep.c (aarch64_software_single_step): Change parameter
from frame_info to regcache. Don't call get_current_regcache.
* alpha-tdep.c (alpha_deal_with_atomic_sequence): Likewise.
(alpha_software_single_step): Likewise.
* alpha-tdep.h (alpha_software_single_step): Update declaration.
* arm-linux-tdep.c (arm_linux_software_single_step): Likewise.
* arm-tdep.c (arm_software_single_step): Likewise.
* arm-tdep.h (arm_software_single_step): Likewise.
* breakpoint.c (insert_single_step_breakpoint): Pass regcache to
gdbarch_software_single_step.
* cris-tdep.c (cris_software_single_step): Change parameter from
frame_info to regcache. Don't call get_current_regcache.
* mips-tdep.c (mips_software_single_step): Likewise.
* mips-tdep.h (mips_software_single_step): Update declaration.
* moxie-tdep.c (moxie_software_single_step): Likewise.
* nios2-tdep.c (nios2_software_single_step): Likewise.
* ppc-tdep.h (ppc_deal_with_atomic_sequence): Update declaration.
* rs6000-aix-tdep.c (rs6000_software_single_step): Likewise.
* rs6000-tdep.c (ppc_deal_with_atomic_sequence): Likewise.
* s390-linux-tdep.c (s390_software_single_step): Likewise.
* sparc-tdep.c (sparc_software_single_step): Likewise.
* spu-tdep.c (spu_software_single_step): Likewise.
* tic6x-tdep.c (tic6x_software_single_step): Likewise.
Yao Qi [Tue, 22 Nov 2016 14:05:05 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: spu
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* spu-tdep.c (spu_software_single_step): Call get_regcache_arch
instead of get_frame_arch. Call regcache_read_pc instead of
get_frame_pc. Call regcache_raw_get_unsigned instead of
get_frame_register_unsigned.
Yao Qi [Tue, 22 Nov 2016 14:05:05 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: tic6x
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* tic6x-tdep.c (tic6x_condition_true): Replace frame with
regcache. Call regcache_raw_get_signed instead of
get_frame_register_signed.
(tic6x_get_next_pc): Likewise. Caller updated.
Yao Qi [Tue, 22 Nov 2016 14:05:05 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: rs6000
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* rs6000-aix-tdep.c (branch_dest): Replace parameter frame with
regcache. Call get_regcache_arch instead of get_frame_arch.
Call regcache_raw_get_unsigned instead of
get_frame_register_unsigned.
(rs6000_software_single_step): Likewise.
* rs6000-tdep.c (ppc_deal_with_atomic_sequence): Call
get_regcache_arch instead of get_frame_arch. Call
regcache_read_pc instead of get_frame_pc.
Yao Qi [Tue, 22 Nov 2016 14:05:05 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: s390
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* s390-linux-tdep.c (s390_software_single_step): Call
get_regcache_arch instead of get_frame_arch. Call
regcache_read_pc instead of get_frame_pc.
Yao Qi [Tue, 22 Nov 2016 14:05:05 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: sparc
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* sparc-tdep.c (sparc_analyze_control_transfer): Replace parameter
frame with regcache. Call get_current_frame.
(sparc_software_single_step): Call get_regcache_arch instead of
get_frame_arch. Call regcache_raw_get_unsigned instead of
get_frame_register_unsigned.
Yao Qi [Tue, 22 Nov 2016 14:05:05 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: nios2
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* nios2-tdep.c (nios2_get_next_pc): Replace parameter frame
with regcache. Call regcache_raw_get_signed instead of
get_frame_register_unsigned.
(nios2_software_single_step): Call get_regcache_arch
instead of get_frame_arch.
Yao Qi [Tue, 22 Nov 2016 14:05:05 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: moxie
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* moxie-tdep.c (moxie_software_single_step): Call
get_regcache_arch instead of get_frame_arch. Call
regcache_read_pc instead of get_frame_pc.
Yao Qi [Tue, 22 Nov 2016 14:05:05 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: mips
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* mips-tdep.c (mips32_bc1_pc): Replace parameter frame with
regcache. Call regcache_raw_get_unsigned instead of
get_frame_register_unsigned.
(mips32_next_pc): Likewise.
(micromips_bc1_pc): Likewise.
(micromips_next_pc): Likewise.
(extended_mips16_next_pc): Likewise.
(mips16_next_pc): Likewise.
(mips_next_pc): Likewise.
(mips_software_single_step): Call get_regcache_arch instead
of get_frame_arch.
Yao Qi [Tue, 22 Nov 2016 14:05:04 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: cris
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* cris-tdep.c (find_step_target): Replace parameter frame
with regcache. Call get_regcache_arch instead of
get_frame_arch. Call regcache_raw_get_unsigned instead of
get_frame_register_unsigned.
(cris_software_single_step): Call get_regcache_arch instead
of get_frame_arch.
Yao Qi [Tue, 22 Nov 2016 14:05:04 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: alpha
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* alpha-tdep.c (alpha_deal_with_atomic_sequence): Call
get_regcache_arch instead of get_frame_arch. Call
regcache_read_pc instead of get_frame_pc.
(alpha_next_pc): Replace parameter frame with regcache.
Call regcache_raw_get_unsigned instead of
get_frame_register_unsigned.
Yao Qi [Tue, 22 Nov 2016 14:05:04 +0000 (14:05 +0000)]
gdbarch software_single_step frame_info to regcache: aarch64
Use regcache in software_single_step.
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* aarch64-tdep.c (aarch64_software_single_step): Call
get_regcache_arch instead of get_frame_arch. Call
regcache_read_pc instead of get_frame_pc.
Yao Qi [Tue, 22 Nov 2016 14:05:04 +0000 (14:05 +0000)]
New regcache_raw_get_signed
This patch adds a new regcache api regcache_raw_get_signed.
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* regcache.c (regcache_raw_get_signed): New function.
* regcache.h (regcache_raw_get_signed): Declare.
Jose E. Marchesi [Tue, 22 Nov 2016 12:40:37 +0000 (04:40 -0800)]
gas,opcodes: fix hardware capabilities bumping in the sparc assembler.
When the assembler finds an instruction which is part of a higher
opcode architecture it bumps the current opcode architecture. For
example:
$ echo "mwait" | as -bump
{standard input}: Assembler messages:
{standard input}:1: Warning: architecture bumped from "v6" to "v9m" on "mwait"
However, when two instructions pertaining to the same opcode
architecture but associated to different SPARC hardware capabilities
are found in the input stream, and no GAS architecture is specified in
the command line, the assembler bangs:
$ echo "mwait; wr %g0,%g1,%mcdper" | as -bump
{standard input}: Assembler messages:
{standard input}:1: Warning: architecture bumped from "v6" to "v9m" on "mwait"
{standard input}:1: Error: Hardware capability "sparc5" not enabled for "wr".
... and it should'nt, as WRMCDPER pertains to the same architecture
level than MWAIT.
This patch fixes this by extending the definition of sparc opcode
architectures to contain a set of hardware capabilities and making the
assembler to take these capabilities into account when updating the
set of allowed hwcaps when an architecture bump is triggered by some
instruction.
This way, hwcaps associated to architecture levels are maintained in
opcodes, while the assembler keeps the flexibiity of defining GAS
architectures including additional hwcaps (like -Asparcfmaf or the
v8plus* variants).
A test covering this failure case is included.
gas/ChangeLog:
2016-11-22 Jose E. Marchesi <jose.marchesi@oracle.com>
* config/tc-sparc.c: Move HWS_* and HWS2_* definitions to
opcodes/sparc-opc.c.
(sparc_arch): Clarify the new role of the hwcap_allowed and
hwcap2_allowed fields.
(sparc_arch_table): Remove HWS_* and HWS2_* instances from
hwcap_allowed and hwcap2_allowed respectively.
(md_parse_option): Include the opcode arch hwcaps when processing
-A.
(sparc_ip): Use the current opcode arch hwcaps to update
hwcap_allowed, as well of the hwcaps of the instruction triggering
the bump.
* testsuite/gas/sparc/hwcaps-bump.s: New file.
* testsuite/gas/sparc/hwcaps-bump.l: Likewise.
* testsuite/gas/sparc/sparc.exp (gas_64_check): Run tests in
hwcaps-bump.
include/ChangeLog:
2016-11-22 Jose E. Marchesi <jose.marchesi@oracle.com>
* opcode/sparc.h (sparc_opcode_arch): New fields hwcaps and
hwcaps2.
opcodes/ChangeLog:
2016-11-22 Jose E. Marchesi <jose.marchesi@oracle.com>
* sparc-opc.c (HWS_V8): Definition moved from
gas/config/tc-sparc.c.
(HWS_V9): Likewise.
(HWS_VA): Likewise.
(HWS_VB): Likewise.
(HWS_VC): Likewise.
(HWS_VD): Likewise.
(HWS_VE): Likewise.
(HWS_VV): Likewise.
(HWS_VM): Likewise.
(HWS2_VM): Likewise.
(sparc_opcode_archs): Initialize hwcaps and hwcaps2 fields of
existing entries.
Claudiu Zissulescu [Wed, 9 Nov 2016 14:30:35 +0000 (15:30 +0100)]
[ARC] Fix printing 'b' mnemonics.
gas/
2016-11-22 Claudiu Zissulescu <claziss@synopsys.com>
* testsuite/gas/arc/b.d: Update test result.
opcode/
2016-11-22 Claudiu Zissulescu <claziss@synopsys.com>
* arc-tbl.h: Reorder conditional flags with delay flags for 'b'
instructions.
Alan Modra [Tue, 22 Nov 2016 08:15:29 +0000 (18:45 +1030)]
PR20744, Incorrect PowerPC VLE relocs
VLE 16A and 16D relocs were functionally swapped.
PR 20744
include/
* opcode/ppc.h: Define VLE insns using 16A and 16D relocs.
bfd/
* elf32-ppc.h (struct ppc_elf_params): Add vle_reloc_fixup field.
* elf32-ppc.c: Include opcode/ppc.h.
(ppc_elf_howto_raw): Correct dst_mask for R_PPC_VLE_LO16A,
R_PPC_VLE_LO16D, R_PPC_VLE_HI16A, R_PPC_VLE_HI16D, R_PPC_VLE_HA16A,
R_PPC_VLE_HA16D, R_PPC_VLE_SDAREL_LO16A, R_PPC_VLE_SDAREL_LO16D,
R_PPC_VLE_SDAREL_HI16A, R_PPC_VLE_SDAREL_HI16D,
R_PPC_VLE_SDAREL_HA16A, and R_PPC_VLE_SDAREL_HA16D relocs.
(ppc_elf_link_hash_table_create): Update default_params init.
(ppc_elf_vle_split16): Correct shift and mask. Add params.
Report or fix insn/reloc mismatches.
(ppc_elf_relocate_section): Pass input_section, offset and fixup
to ppc_elf_vle_split16.
binutils/
* NEWS: Mention PowerPC VLE relocation error.
gas/
* config/tc-ppc.c: Delete VLE insn defines.
(md_assemble): Swap use_a_reloc and use_d_reloc.
* testsuite/gas/ppc/vle-reloc.d: Update.
ld/
* emultempl/ppc32elf.em (params): Update initializer. Handle
--vle-reloc-fixup command line arg.
Alan Modra [Tue, 22 Nov 2016 05:57:12 +0000 (16:27 +1030)]
Use input_bfd in relocate_section
It makes just a little more sense to use input_bfd when retrieving
insns for relocation, since the relocations match the endianness of
the input bfd.
* elf32-ppc.c (ppc64_elf_relocate_section): Calculate d_offset for
input_bfd. Replace occurrences of output_bfd as bfd_get_32 and
bfd_put_32 param with input_bfd.
* elf32-ppc.c (ppc_elf_relocate_section): Likewise. Also
ppc_elf_vle_split16 param.
(ppc_elf_vle_split16): Rename output_bfd param to input_bfd.
Yao Qi [Tue, 22 Nov 2016 08:53:34 +0000 (08:53 +0000)]
Use VALUE_NEXT_FRAME_ID in value_from_component
We renamed VALUE_FRAME_ID to VALUE_NEXT_FRAME_ID recently,
https://sourceware.org/ml/gdb-patches/2016-11/msg00018.html
and we should use VALUE_NEXT_FRAME_ID in value_from_component
too.
gdb:
2016-11-22 Yao Qi <yao.qi@linaro.org>
* value.c (value_from_component): Use VALUE_NEXT_FRAME_ID
instead of VALUE_FROM_ID.
GDB Administrator [Tue, 22 Nov 2016 00:00:15 +0000 (00:00 +0000)]
Automatic date update in version.in
Cary Coutant [Mon, 21 Nov 2016 22:05:40 +0000 (14:05 -0800)]
Fix bug where -u option with empty archive results in internal error.
gold/
PR gold/20693
* gold.cc (queue_middle_tasks): Force valid target earlier.
Simon Marchi [Mon, 21 Nov 2016 21:05:57 +0000 (16:05 -0500)]
Add missing POSTCOMPILE step to mi/ file generation rules
A little oversight from my part, it caused the Makefile not to track
the dependencies from mi/*.c files.
gdb/ChangeLog:
* Makefile.in (%o: $(srcdir)/mi/%.c): Add missing POSTCOMPILE
step.
Igor Kudrin [Mon, 21 Nov 2016 17:59:37 +0000 (09:59 -0800)]
Add --build-id=uuid support for MinGW32.
2016-11-21 Igor Kudrin <ikudrin@accesssoftek.com>
gold/
* layout.cc: Include windows.h and rpcdce.h (for MinGW32).
(Layout::create_build_id): Generate uuid using UuidCreate().
Maciej W. Rozycki [Mon, 21 Nov 2016 15:59:42 +0000 (15:59 +0000)]
BFD/DWARF2: Correct an `index' global shadowing error
Fix a commit
089e3718bd8d ("Greatly improve the speed if looking up
DWARF line number information.") build regression:
cc1: warnings being treated as errors
.../bfd/dwarf2.c: In function 'build_line_info_table':
.../bfd/dwarf2.c:1614: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:304: warning: shadowed declaration is here
.../bfd/dwarf2.c: In function 'build_lookup_funcinfo_table':
.../bfd/dwarf2.c:2262: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:304: warning: shadowed declaration is here
make[4]: *** [dwarf2.lo] Error 1
in a way following commit
91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").
bfd/
* dwarf2.c (build_line_info_table): Rename `index' local
variable to `line_index'.
(build_lookup_funcinfo_table): Rename `index' local variable to
`func_index'.
Yao Qi [Mon, 21 Nov 2016 14:15:06 +0000 (14:15 +0000)]
Create subobject value in pretty printer
Nowadays, we create a value of subobject in pretty printer with 'address'
being used,
value = value_from_contents_and_address (type, valaddr + embedded_offset,
address + embedded_offset);
set_value_component_location (value, val);
/* set_value_component_location resets the address, so we may
need to set it again. */
if (VALUE_LVAL (value) != lval_internalvar
&& VALUE_LVAL (value) != lval_internalvar_component
&& VALUE_LVAL (value) != lval_computed)
set_value_address (value, address + embedded_offset);
value_from_contents_and_address creates a value from memory, but the
value we are pretty-printing may not from memory at all.
Instead of using value_from_contents_and_address, we create a value
of subobject with the same location as object's but different offset.
We avoid using address in this way. As a result, parameter 'address'
in apply_val_pretty_printer is no longer needed, we can remove it in
next step.
We've already had the location of the 'whole' value, so it is safe
to assume we can create a value of 'component' or 'suboject' value
at the same location but with different offset.
gdb:
2016-11-21 Yao Qi <yao.qi@linaro.org>
* guile/scm-pretty-print.c (gdbscm_apply_val_pretty_printer):
Don't call value_from_contents_and_address and
set_value_address. Call value_from_component.
* python/py-prettyprint.c (gdbpy_apply_val_pretty_printer):
Likewise.
* value.c (value_from_component): New function.
* value.h (value_from_component): Likewise.
* valarith.c (value_subscripted_rvalue): Call
value_from_component.
Renlin Li [Mon, 21 Nov 2016 12:06:04 +0000 (12:06 +0000)]
[GAS][ARM][PR20827]Fix gas error for two register form instruction (pre-UAL syntax).
gas/
2016-11-21 Renlin Li <renlin.li@arm.com>
PR gas/20827
* config/tc-arm.c (encode_arm_shift): Don't assert for operands not
presented.
* testsuite/gas/arm/add-shift-two.d: New.
* testsuite/gas/arm/add-shift-two.s: New.
Alan Modra [Mon, 21 Nov 2016 09:48:41 +0000 (20:18 +1030)]
Use ACX_PROG_CMP_IGNORE_INITIAL in gas
* configure.ac: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
* Makefile.am (comparison): Rewrite using do_compare.
* configure: Regenerate.
* Makefile.in: Regenerate.
* doc/Makefile.in: Regenerate.
GDB Administrator [Mon, 21 Nov 2016 00:00:33 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 20 Nov 2016 00:00:28 +0000 (00:00 +0000)]
Automatic date update in version.in
Joel Brobecker [Sat, 19 Nov 2016 18:40:17 +0000 (10:40 -0800)]
ARI: Add detection of printf_vma and sprintf_vma
We shouldn't be using these, since their output goes straight to
stdout, which doesn't allow redirection. So this patch updates
the ARI to detect any such use.
gdb/ChangeLog:
* contrib/ari/gdb_ari.sh: Add detection of printf_vma and
sprintf_vma.
Jose E. Marchesi [Sat, 19 Nov 2016 12:39:09 +0000 (04:39 -0800)]
Revert "bfd: allow negative offsets to _GLOBAL_OFFSET_TABLE_ in elf64 SPARC"
This reverts commit
b19753ce31da347605dfa903c6fd2158e2444f0d.
As it turns out, GCC (and the assembler) needs additional work in
order to support negative GOT offsets in 64-bit sparc. This is
breaking TLS Local Dynamic in position-independent code.
Simon Marchi [Sat, 19 Nov 2016 02:16:52 +0000 (21:16 -0500)]
Makefile: fix typo
Thanks to Patrick Monnerat for reporting this typo.
gdb/ChangeLog:
* Makefile.in (%.o: $(srcdir)/gdbtk/generic/%.c): Fix typo.
GDB Administrator [Sat, 19 Nov 2016 00:00:32 +0000 (00:00 +0000)]
Automatic date update in version.in
Andreas Arnez [Fri, 18 Nov 2016 15:59:00 +0000 (16:59 +0100)]
gdb/doc: Add missing comma after xref
Get rid of a warning for missing punctuation after xref.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Async Records): Add missing comma after
xref.
Claudiu Zissulescu [Thu, 17 Nov 2016 12:26:54 +0000 (13:26 +0100)]
[ARC] Fix and extend features of .cpu directive.
gas/
2016-11-18 Claudiu Zissulescu <claziss@synopsys.com>
* testsuite/gas/arc/cl-warn.s: New file.
* testsuite/gas/arc/cpu-pseudop-1.d: Likewise.
* testsuite/gas/arc/cpu-pseudop-1.s: Likewise.
* testsuite/gas/arc/cpu-pseudop-2.d: Likewise.
* testsuite/gas/arc/cpu-pseudop-2.s: Likewise.
* testsuite/gas/arc/cpu-warn2.s: Likewise.
* config/tc-arc.c (selected_cpu): Initialize.
(feature_type): New struct.
(feature_list): New variable.
(arc_check_feature): New function.
(arc_select_cpu): Check for .cpu duplicates. Don't overwrite the
current cpu features. Check if a feature is available for a given
cpu.
(md_parse_option): Test if features are available for a given cpu.
James Clarke [Fri, 18 Nov 2016 11:51:40 +0000 (12:51 +0100)]
bfd: fix negative GOT offsets for non-local references on sparc64
bfd/ChangeLog:
2016-11-18 James Clarke <jrtc27@jrtc27.com>
* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Don't convert
R_SPARC_GOTDATA_OP_HIX22 and R_SPARC_GOTDATA_OP_LOX10 to
R_SPARC_GOT* for non-local references. Instead, treat them like
R_SPARC_GOTDATA_HIX22/R_SPARC_GOTDATA_LOX10 when filling in the
immediate with the calculated relocation.
Mark Wielaard [Thu, 17 Nov 2016 00:28:09 +0000 (01:28 +0100)]
cxxfilt: Recognize rust_demangling.
David Tolnay [Wed, 16 Nov 2016 23:09:27 +0000 (23:09 +0000)]
libiberty: Add Rust symbol demangling.
Adds Rust symbol demangler. Rust mangles symbols using GNU_V3 style,
adding a hash and various special character subtitutions. This adds
a new rust style to cplus_demangle and adds 3 helper functions
rust_demangle, rust_demangle_sym and rust_is_mangled.
rust-demangle.c was written by David. Mark did the code formatting to
GNU style and integration into the gcc/libiberty build system and
testsuite.
include/ChangeLog:
2016-11-03 David Tolnay <dtolnay@gmail.com>
Mark Wielaard <mark@klomp.org>
* demangle.h (DMGL_RUST): New macro.
(DMGL_STYLE_MASK): Add DMGL_RUST.
(demangling_styles): Add dlang_rust.
(RUST_DEMANGLING_STYLE_STRING): New macro.
(RUST_DEMANGLING): New macro.
(rust_demangle): New prototype.
(rust_is_mangled): Likewise.
(rust_demangle_sym): Likewise.
libiberty/ChangeLog:
2016-11-03 David Tolnay <dtolnay@gmail.com>
Mark Wielaard <mark@klomp.org>
* Makefile.in (CFILES): Add rust-demangle.c.
(REQUIRED_OFILES): Add rust-demangle.o.
* cplus-dem.c (libiberty_demanglers): Add rust_demangling case.
(cplus_demangle): Handle RUST_DEMANGLING.
(rust_demangle): New function.
* rust-demangle.c: New file.
* testsuite/Makefile.in (really-check): Add check-rust-demangle.
(check-rust-demangle): New rule.
* testsuite/rust-demangle-expected: New file.
Mark Wielaard [Tue, 15 Nov 2016 19:31:59 +0000 (19:31 +0000)]
libiberty: demangler crash with missing :? or fold expression component.
When constructing an :? or fold expression that requires a third
expression only the first and second were explicitly checked to
not be NULL. Since the third expression is also required in these
constructs it needs to be explicitly checked and rejected when missing.
Otherwise the demangler will crash once it tries to d_print the
NULL component. Added two examples to demangle-expected of strings
that would crash before this fix.
Found by American Fuzzy Lop (afl) fuzzer.
Mark Wielaard [Tue, 15 Nov 2016 19:31:50 +0000 (19:31 +0000)]
libiberty: Fix some demangler crashes caused by reading past end of input.
In various situations the cplus_demangle () function could read past the
end of input causing crashes. Add checks in various places to not advance
the demangle string location and fail early when end of string is reached.
Add various examples of input strings to the testsuite that would crash
test-demangle before the fixes.
Found by using the American Fuzzy Lop (afl) fuzzer.
libiberty/ChangeLog:
* cplus-dem.c (demangle_signature): After 'H', template function,
no success and don't advance position if end of string reached.
(demangle_template): After 'z', template name, return zero on
premature end of string.
(gnu_special): Guard strchr against searching for zero characters.
(do_type): If member, only advance mangled string when 'F' found.
* testsuite/demangle-expected: Add examples of strings that could
crash the demangler by reading past end of input.
Mark Wielaard [Mon, 14 Nov 2016 19:46:26 +0000 (19:46 +0000)]
libiberty: Add -Wshadow=local to warning flags (if supported).
libiberty/ChangeLog:
* configure.ac (ac_libiberty_warn_cflags): Add -Wshadow=local.
* configure: Regenerated.
Jason Merrill [Mon, 7 Nov 2016 23:09:29 +0000 (23:09 +0000)]
Implement P0012R1, Make exception specifications part of the type system.
libiberty/
* cp-demangle.c (is_fnqual_component_type): New.
(d_encoding, d_print_comp_inner, d_print_mod_list): Use it.
(FNQUAL_COMPONENT_CASE): New.
(d_make_comp, has_return_type, d_print_comp_inner)
(d_print_function_type): Use it.
(next_is_type_qual): New.
(d_cv_qualifiers, d_print_mod): Handle noexcept and throw-spec.
include/
* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_NOEXCEPT, DEMANGLE_COMPONENT_THROW_SPEC.
Mark Wielaard [Fri, 4 Nov 2016 23:55:01 +0000 (23:55 +0000)]
libiberty: Fix -Wimplicit-fallthrough warnings.
Adjust some comments, add some explicit fall through comments or explicit
returns where necessary to not get implicit-fallthrough warnings.
All fall throughs were deliberate. In one case I added an explicit return
false for clarity instead of falling through a default case (that also
would return false).
libiberty/ChangeLog:
* cplus-dem.c (demangle_signature): Move fall through comment.
(demangle_fund_type): Add fall through comment between 'G' and 'I'.
* hashtab.c (iterative_hash): Add fall through comments.
* regex.c (regex_compile): Add Fall through comment after '+'/'?'.
(byte_re_match_2_internal): Add Fall through comment after jump_n.
Change "Note fall through" to "Fall through".
(common_op_match_null_string_p): Return false after set_number_at
instead of fall through.
Jason Merrill [Wed, 2 Nov 2016 01:50:29 +0000 (01:50 +0000)]
Implement P0136R1, Rewording inheriting constructors.
libiberty/
* cp-demangle.c (d_ctor_dtor_name): Handle inheriting constructor.
Mark Wielaard [Tue, 1 Nov 2016 23:13:10 +0000 (23:13 +0000)]
libiberty: Fix memory leak in ada_demangle when symbol cannot be demangled.
When a symbol cannot be demangled in ada_demangle a new demangled VEC
will be allocated without deleting the demangled VEC already in use.
Running testsuite/test-demangle under valgrind will show the leak for
this entry in testsuite/demangle-expected:
# Elaborated flag (not demangled)
--format=gnat
x_E
<x_E>
11 bytes in 1 blocks are definitely lost in loss record 1 of 1
at 0x4C27BE3: malloc (vg_replace_malloc.c:299)
by 0x413FE7: xmalloc (xmalloc.c:148)
by 0x4025EC: ada_demangle (cplus-dem.c:930)
by 0x402C59: cplus_demangle (cplus-dem.c:892)
by 0x400FEC: main (test-demangle.c:317)
libiberty/ChangeLog:
* cplus-dem.c (ada_demangle): Initialize demangled to NULL and
XDELETEVEC demangled when unknown.
Marcel Böhme [Thu, 4 Aug 2016 16:53:18 +0000 (16:53 +0000)]
PR c++/71696 testcase.
Add libiberty/testsuite/demangle-expected testcase for:
PR c++/71696
* cplus-dem.c: Prevent infinite recursion when there is a cycle
in the referencing of remembered mangled types.
(work_stuff): New stack to keep track of the remembered mangled
types that are currently being processed.
(push_processed_type): New method to push currently processed
remembered type onto the stack.
(pop_processed_type): New method to pop currently processed
remembered type from the stack.
(work_stuff_copy_to_from): Copy values of new variables.
(delete_non_B_K_work_stuff): Free stack memory.
(demangle_args): Push/Pop currently processed remembered type.
(do_type): Do not demangle a cyclic reference and push/pop
referenced remembered type.
Szabolcs Nagy [Fri, 18 Nov 2016 10:02:16 +0000 (10:02 +0000)]
[AArch64] Add ARMv8.3 FCMLA and FCADD instructions
Add support for FCMLA and FCADD complex arithmetic SIMD instructions.
FCMLA has an indexed element variant where the index range has to be
treated specially because a complex number takes two elements and the
indexed vector size depends on the other operands.
These complex number SIMD instructions are part of ARMv8.3
https://community.arm.com/groups/processors/blog/2016/10/27/armv8-a-architecture-2016-additions
include/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* opcode/aarch64.h (enum aarch64_opnd): Add AARCH64_OPND_IMM_ROT1,
AARCH64_OPND_IMM_ROT2, AARCH64_OPND_IMM_ROT3.
(enum aarch64_op): Add OP_FCMLA_ELEM.
opcodes/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* aarch64-tbl.h (QL_V3SAMEHSD_ROT, QL_ELEMENT_ROT): Define.
(aarch64_feature_simd_v8_3, SIMD_V8_3): Define.
(aarch64_opcode_table): Add fcmla and fcadd.
(AARCH64_OPERANDS): Add IMM_ROT{1,2,3}.
* aarch64-asm.h (aarch64_ins_imm_rotate): Declare.
* aarch64-asm.c (aarch64_ins_imm_rotate): Define.
* aarch64-dis.h (aarch64_ext_imm_rotate): Declare.
* aarch64-dis.c (aarch64_ext_imm_rotate): Define.
* aarch64-opc.h (enum aarch64_field_kind): Add FLD_rotate{1,2,3}.
* aarch64-opc.c (fields): Add FLD_rotate{1,2,3}.
(operand_general_constraint_met_p): Rotate and index range check.
(aarch64_print_operand): Handle rotate operand.
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Likewise.
* aarch64-opc-2.c: Likewise.
gas/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/tc-aarch64.c (parse_operands): Handle AARCH64_OPND_IMM_ROT*.
* testsuite/gas/aarch64/advsimd-armv8_3.d: New.
* testsuite/gas/aarch64/advsimd-armv8_3.s: New.
* testsuite/gas/aarch64/illegal-fcmla.s: New.
* testsuite/gas/aarch64/illegal-fcmla.l: New.
* testsuite/gas/aarch64/illegal-fcmla.d: New.
Szabolcs Nagy [Fri, 18 Nov 2016 09:58:38 +0000 (09:58 +0000)]
[AArch64] Add ARMv8.3 weaker release consistency load instructions
Add support for ARMv8.3 LDAPRB, LDAPRH and LDAPR weak release
consistency load instructions. (They are equivalent to LDARB,
LDARH and LDAR instructions other than the weaker memory ordering
requirement.)
For more details about weak release consistency see
https://community.arm.com/groups/processors/blog/2016/10/27/armv8-a-architecture-2016-additions
opcodes/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* aarch64-tbl.h (arch64_opcode_table): Add ldaprb, ldaprh, ldapr.
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Regenerate.
* aarch64-opc-2.c: Regenerate.
gas/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* testsuite/gas/aarch64/ldst-exclusive-armv8_3.s: Add ldaprb, ldaprh, ldapr tests.
* testsuite/gas/aarch64/ldst-exclusive-armv8_3.d: Likewise.
* testsuite/gas/aarch64/illegal-ldapr.s: Likewise.
* testsuite/gas/aarch64/illegal-ldapr.d: Likewise.
* testsuite/gas/aarch64/illegal-ldapr.l: Likewise.
Szabolcs Nagy [Fri, 18 Nov 2016 09:53:45 +0000 (09:53 +0000)]
[AArch64] Add ARMv8.3 javascript floating-point conversion instruction
Add support for ARMv8.3 FJCVTZS floating-point conversion
instruction.
For details about javascript floating-point conversion see
https://community.arm.com/groups/processors/blog/2016/10/27/armv8-a-architecture-2016-additions
opcodes/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* aarch64-tbl.h (arch64_opcode_table): Add fjcvtzs.
(QL_FP2INT_W_D, aarch64_feature_fp_v8_3, FP_V8_3): Define.
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Regenerate.
* aarch64-opc-2.c: Regenerate.
gas/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* testsuite/gas/aarch64/fp-armv8_3.s: Add fjcvtzs test.
* testsuite/gas/aarch64/fp-armv8_3.d: Likewise.
* testsuite/gas/aarch64/illegal-fjcvtzs.s: Likewise.
* testsuite/gas/aarch64/illegal-fjcvtzs.d: Likewise.
* testsuite/gas/aarch64/illegal-fjcvtzs.l: Likewise.
* testsuite/gas/aarch64/illegal-nofp-armv8_3.s: Likewise.
* testsuite/gas/aarch64/illegal-nofp-armv8_3.d: Likewise.
* testsuite/gas/aarch64/illegal-nofp-armv8_3.l: Likewise.
Szabolcs Nagy [Fri, 18 Nov 2016 09:49:06 +0000 (09:49 +0000)]
[AArch64] Add ARMv8.3 combined pointer authentication load instructions
Add support for ARMv8.3 LDRAA and LDRAB combined pointer authentication and
load instructions.
These instructions authenticate the base register and load 8 byte from it plus
a scaled 10-bit offset with optional writeback to update the base register.
A new instruction class (ldst_imm10) and operand type (AARCH64_OPND_ADDR_SIMM10)
were introduced to handle the special addressing form.
include/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* opcode/aarch64.h (enum aarch64_opnd): Add AARCH64_OPND_ADDR_SIMM10.
(enum aarch64_insn_class): Add ldst_imm10.
opcodes/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* aarch64-tbl.h (QL_X1NIL): New.
(arch64_opcode_table): Add ldraa, ldrab.
(AARCH64_OPERANDS): Add "ADDR_SIMM10".
* aarch64-asm.h (aarch64_ins_addr_simm10): Declare.
* aarch64-asm.c (aarch64_ins_addr_simm10): Define.
* aarch64-dis.h (aarch64_ext_addr_simm10): Declare.
* aarch64-dis.c (aarch64_ext_addr_simm10): Define.
* aarch64-opc.h (enum aarch64_field_kind): Add FLD_S_simm10.
* aarch64-opc.c (fields): Add data for FLD_S_simm10.
(operand_general_constraint_met_p): Handle AARCH64_OPND_ADDR_SIMM10.
(aarch64_print_operand): Likewise.
* aarch64-asm-2.c: Regenerate.
* aarch64-dis-2.c: Regenerate.
* aarch64-opc-2.c: Regenerate.
gas/
2016-11-18 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config/tc-aarch64.c (parse_operands): Handle AARCH64_OPND_ADDR_SIMM10.
(fix_insn): Likewise.
(warn_unpredictable_ldst): Handle ldst_imm10.
* testsuite/gas/aarch64/pac.s: Add ldraa and ldrab tests.
* testsuite/gas/aarch64/pac.d: Likewise.
* testsuite/gas/aarch64/illegal-ldraa.s: New.
* testsuite/gas/aarch64/illegal-ldraa.l: New.
* testsuite/gas/aarch64/illegal-ldraa.d: New.
Nick Clifton [Fri, 18 Nov 2016 09:27:41 +0000 (09:27 +0000)]
Help diagnose problems with the metag target when mixing static and shared binaries.
PR ld/20675
* elf32-metag.c (elf_metag_relocate_section): Replace abort with
an informative error message.
GDB Administrator [Fri, 18 Nov 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Thu, 17 Nov 2016 17:02:32 +0000 (12:02 -0500)]
Makefile: Replace explicit subdir rules with pattern rules
When adding a .c file in subdirectory (e.g. mi/), the current practice
is to add an explicit rule, such as:
mi-cmd-break.o: $(srcdir)/mi/mi-cmd-break.c
$(COMPILE) $(srcdir)/mi/mi-cmd-break.c
$(POSTCOMPILE)
I find it a bit verbose and cumbersome. Since we now require GNU make,
we can change those rules with pattern rules, one for each subdirectory.
For example, the following rule works for all files under mi:
%.o: $(srcdir)/mi/%.c
$(COMPILE) $<
$(POSTCOMPILE)
Those pattern rules assume that the source and target files have the
same stem (foo.c and foo.o). In one case, common-agent.o is generated
from common/agent.c, to avoid a conflict with the agent.o in gdb/. In
this case, I kept the explicit rule, which takes precedence over the
pattern rule. We could also rename common/agent.c to
common/common-agent.c to get rid of the special case and still avoid the
clash, as it is done with common/common-regcache.c, for example.
This strategy was the least intrusive I found, as it only requires
changing the rules, not the target names.
I also considered two other solutions, which I did not like because I
would have had to change target names a bit everywhere.
- Replicate the source directory structure in the build directory,
which would generate common/agent.o from common/agent.c. However,
something was not right with the dependency tracking (the .deps
directory). It's probably not hard to fix, but I did not
investigate further.
- Name the object files after the directory they are in, so that
common/agent.c would generate common_agent.c.
GDBserver can benefit from the same treatment, but I'll do it in another
patch.
Built-tested with --enable-targets=all.
New in v2:
- Regroup pattern rules for .c -> .o compilation in a single place.
- Add comment about common-agent.o.
gdb/ChangeLog:
(PYTHON_CFLAGS): Move up.
(%.o: $(srcdir)/arch/%.c): New rule.
(%.o: $(srcdir)/cli/%.c): New rule.
(%.o: $(srcdir)/common/%.c): New rule.
(%.o: $(srcdir)/compile/%.c): New rule.
(%.o: $(srcdir)/gdbtk/generic/%.c): New rule.
(%.o: $(srcdir)/guile/%.c): New rule.
(%.o: $(srcdir)/mi/%.c): New rule.
(%.o: $(srcdir)/nat/%.c): New rule.
(%.o: $(srcdir)/python/%.c): New rule.
(%.o: $(srcdir)/target/%.c): New rule.
(%.o: $(srcdir)/tui/%.c): New rule.
(cli-cmds.o): Remove.
(cli-decode.o): Likewise.
(cli-dump.o): Likewise.
(cli-interp.o): Likewise.
(cli-logging.o): Likewise.
(cli-script.o): Likewise.
(cli-setshow.o): Likewise.
(cli-utils.o): Likewise.
(compile.o): Likewise.
(compile-c-types.o): Likewise.
(compile-c-symbols.o): Likewise.
(compile-object-load.o): Likewise.
(compile-object-run.o): Likewise.
(compile-loc2c.o): Likewise.
(compile-c-support.o): Likewise.
(gdbtk.o): Likewise.
(gdbtk-bp.o): Likewise.
(gdbtk-cmds.o): Likewise.
(gdbtk-hooks.o): Likewise.
(gdbtk-interp.o): Likewise.
(gdbtk-main.o): Likewise.
(gdbtk-register.o): Likewise.
(gdbtk-stack.o): Likewise.
(gdbtk-varobj.o): Likewise.
(gdbtk-wrapper.o): Likewise.
(mi-cmd-break.o): Likewise.
(mi-cmd-catch.o): Likewise.
(mi-cmd-disas.o): Likewise.
(mi-cmd-env.o): Likewise.
(mi-cmd-file.o): Likewise.
(mi-cmd-info.o): Likewise.
(mi-cmds.o): Likewise.
(mi-cmd-stack.o): Likewise.
(mi-cmd-target.o): Likewise.
(mi-cmd-var.o): Likewise.
(mi-console.o): Likewise.
(mi-getopt.o): Likewise.
(mi-interp.o): Likewise.
(mi-main.o): Likewise.
(mi-out.o): Likewise.
(mi-parse.o): Likewise.
(mi-symbol-cmds.o): Likewise.
(mi-common.o): Likewise.
(signals.o): Likewise.
(common-utils.o): Likewise.
(gdb_vecs.o): Likewise.
(xml-utils.o): Likewise.
(ptid.o): Likewise.
(buffer.o): Likewise.
(filestuff.o): Likewise.
(format.o): Likewise.
(vec.o): Likewise.
(print-utils.o): Likewise.
(rsp-low.o): Likewise.
(errors.o): Likewise.
(common-debug.o): Likewise.
(cleanups.o): Likewise.
(common-exceptions.o
(posix-strerror.o): Likewise.
(mingw-strerror.o): Likewise.
(btrace-common.o): Likewise.
(fileio.o): Likewise.
(common-regcache.o): Likewise.
(signals-state-save-restore.o): Likewise.
(new-op.o): Likewise.
(waitstatus.o): Likewise.
(arm.o): Likewise.
(arm-linux.o): Likewise.
(arm-get-next-pcs.o): Likewise.
(x86-dregs.o): Likewise.
(linux-btrace.o): Likewise.
(linux-osdata.o): Likewise.
(linux-procfs.o): Likewise.
(linux-ptrace.o): Likewise.
(linux-waitpid.o): Likewise.
(mips-linux-watch.o): Likewise.
(ppc-linux.o): Likewise.
(linux-personality.o): Likewise.
(x86-linux.o): Likewise.
(x86-linux-dregs.o): Likewise.
(amd64-linux-siginfo.o): Likewise.
(linux-namespaces.o): Likewise.
(aarch64-linux-hw-point.o): Likewise.
(aarch64-linux.o): Likewise.
(aarch64-insn.o): Likewise.
(tui.o): Likewise.
(tui-command.o): Likewise.
(tui-data.o): Likewise.
(tui-disasm.o): Likewise.
(tui-file.o): Likewise.
(tui-hooks.o): Likewise.
(tui-interp.o): Likewise.
(tui-io.o): Likewise.
(tui-layout.o): Likewise.
(tui-out.o): Likewise.
(tui-regs.o): Likewise.
(tui-source.o): Likewise.
(tui-stack.o): Likewise.
(tui-win.o): Likewise.
(tui-windata.o): Likewise.
(tui-wingeneral.o): Likewise.
(tui-winsource.o): Likewise.
(guile.o): Likewise.
(scm-arch.o): Likewise.
(scm-auto-load.o): Likewise.
(scm-block.o): Likewise.
(scm-breakpoint.o): Likewise.
(scm-cmd.o): Likewise.
(scm-disasm.o): Likewise.
(scm-exception.o): Likewise.
(scm-frame.o): Likewise.
(scm-gsmob.o): Likewise.
(scm-iterator.o): Likewise.
(scm-lazy-string.o): Likewise.
(scm-math.o): Likewise.
(scm-objfile.o): Likewise.
(scm-param.o): Likewise.
(scm-ports.o): Likewise.
(scm-pretty-print.o): Likewise.
(scm-progspace.o): Likewise.
(scm-safe-call.o): Likewise.
(scm-string.o): Likewise.
(scm-symbol.o): Likewise.
(scm-symtab.o): Likewise.
(scm-type.o): Likewise.
(scm-utils.o): Likewise.
(scm-value.o): Likewise.
(python.o): Likewise.
(py-arch.o): Likewise.
(py-auto-load.o): Likewise.
(py-block.o): Likewise.
(py-bpevent.o): Likewise.
(py-breakpoint.o): Likewise.
(py-cmd.o): Likewise.
(py-continueevent.o): Likewise.
(py-xmethods.o): Likewise.
(py-event.o): Likewise.
(py-evtregistry.o): Likewise.
(py-evts.o): Likewise.
(py-exitedevent.o): Likewise.
(py-finishbreakpoint.o): Likewise.
(py-frame.o): Likewise.
(py-framefilter.o): Likewise.
(py-function.o): Likewise.
(py-gdb-readline.o): Likewise.
(py-inferior.o): Likewise.
(py-infevents.o): Likewise.
(py-infthread.o): Likewise.
(py-lazy-string.o): Likewise.
(py-linetable.o): Likewise.
(py-newobjfileevent.o): Likewise.
(py-objfile.o): Likewise.
(py-param.o): Likewise.
(py-prettyprint.o): Likewise.
(py-progspace.o): Likewise.
(py-signalevent.o): Likewise.
(py-stopevent.o): Likewise.
(py-symbol.o): Likewise.
(py-symtab.o): Likewise.
(py-threadevent.o): Likewise.
(py-type.o): Likewise.
(py-unwind.o): Likewise.
(py-utils.o): Likewise.
(py-value.o): Likewise.
(py-varobj.o): Likewise.
Simon Marchi [Thu, 17 Nov 2016 17:02:13 +0000 (12:02 -0500)]
Makefile: Replace old suffix rules with pattern rules
As mentioned here [1], suffix rules are obsolete and have been
superseeded with pattern rules. People (myself included, before writing
this patch) are more likely to know what pattern rules are than suffix
rules.
AFAIK, .SUFFIXES targets are only used for those rules, and can be
removed as well.
New in v2:
- Replace rule in gdbserver/Makefile.in as well.
[1] https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html
gdb/ChangeLog:
* Makefile.in (.c.o): Replace rule with ...
(%.o: %.c): ... this one.
(.po.gmo): Replace rule with ...
(%.gmo: %.po): ... this one.
(.po.pox): Replace rule with ...
(%.pox: %.po): ... this one.
(.y.c): Replace rule with ...
(%.c: %.y): ... this one.
(.l.c): Replace rule with ...
(%.c: %.l): ... this one.
(.SUFFIXES): Remove all instances.
gdb/gdbserver/ChangeLog:
* Makefile.in (.c.o): Replace rule with ...
(%.o: %.c): ... this one.
Simon Marchi [Thu, 17 Nov 2016 17:00:10 +0000 (12:00 -0500)]
Remove code that checks for GNU/non-GNU make
Since GNU make is now required to build GDB, we can remove everything
that checks whether the current make implemention is the GNU one or
not. I simply removed the @GMAKE_TRUE@ prefixes and removed the whole
lines that were prefixed with @GMAKE_FALSE@.
I removed the code in the configure scripts that set those variables.
I also removed the following bits from the configure scripts:
AC_CHECK_PROGS(MAKE, make): GNU make already defines a MAKE variable
internally to be used when invoking Makefiles recursively. I don't see
this variable being used anywhere else (in scripts for example), so I
think it's safe for removal.
AC_PROG_MAKE_SET: This macro defines a SET_MAKE output variable, which
is meant to be used in Makefiles to define the MAKE variable when
using an implementation of make that doesn't already define it.
Since we are now requiring GNU make, we don't need it anymore.
Plus, I don't see SET_MAKE being used anywhere, so I don't think it
was actually doing anything...
gdb/ChangeLog:
* Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines
prefixed with @GMAKE_FALSE@. Update comment related to non-GNU
make.
* configure.ac: Remove checks for the make program.
* configure: Re-generate.
gdb/gdbserver/ChangeLog:
* Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines
prefixed with @GMAKE_FALSE@. Update comment related to non-GNU
make.
* configure.ac: Remove checks for the make program.
* configure: Re-generate.
gdb/testsuite/ChangeLog:
* Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines
prefixed with @GMAKE_FALSE@. Update comment related to non-GNU
make.
* configure.ac: Remove checks for the make program.
* configure: Re-generate.
Simon Marchi [Thu, 17 Nov 2016 16:59:18 +0000 (11:59 -0500)]
Document new hard requirement on GNU make
As discussed in [1], it would be benificial for the GDB project to start
requiring GNU make to build its software. It would allow using useful
GNU-specific constructs, such as pattern rules. It would also allow
removing the alternative code paths in the Makefiles (guarded by
GMAKE_TRUE/GMAKE_FALSE), simplifying the Makefile code.
[1] https://sourceware.org/ml/gdb-patches/2016-11/msg00331.html
gdb/ChangeLog:
* NEWS: Mention requirement of GNU make.
Pedro Alves [Thu, 17 Nov 2016 14:53:02 +0000 (14:53 +0000)]
gdb/c-exp.y: fprintf -> parser_fprintf
Switching GDB to make use of gnulib's C++ namespace support mode
revealed these direct uses of fprintf in the C parser, where
parser_fprintf should be used to handle rewiring stderr to gdb_stderr:
..../src/gdb/c-exp.y: In function ‘void c_print_token(FILE*, int, YYSTYPE)’:
..../src/gdb/c-exp.y:3220:45: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror]
pulongest (value.typed_val_int.val));
^
..../src/gdb/c-exp.y:3231:62: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror]
fprintf (file, "tsval<type=%d, %s>", value.tsval.type, copy);
^
..../src/gdb/c-exp.y:3237:57: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror]
fprintf (file, "sval<%s>", copy_name (value.sval));
^
..../src/gdb/c-exp.y:3243:39: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror]
copy_name (value.tsym.stoken));
^
..../src/gdb/c-exp.y:3254:39: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror]
value.ssym.is_a_field_of_this);
^
..../src/gdb/c-exp.y:3258:70: error: call to ‘fprintf’ declared with attribute warning: The symbol ::fprintf refers to the system function. Use gnulib::fprintf instead. [-Werror]
fprintf (file, "bval<%s>", host_address_to_string (value.bval));
^
gdb/ChangeLog:
2016-11-17 Pedro Alves <palves@redhat.com>
* c-exp.y (c_print_token): Use parser_fprintf instead of fprintf.
Pedro Alves [Thu, 17 Nov 2016 14:43:02 +0000 (14:43 +0000)]
gdb/ctf.c: Get rid of mkdir redefinition
Making GDB use gnulib's C++ namespace support shows this build error
on mingw:
../../src/gdb/ctf.c: In function 'void ctf_start(trace_file_writer*, const char*)':
../../src/gdb/ctf.c:309:46: error: no match for call to '(const gnulib::_gl_mkdir_wrapper) (const char*&)'
#define mkdir(pathname, mode) mkdir (pathname)
^
../../src/gdb/ctf.c:327:15: note: in expansion of macro 'mkdir'
if (gnulib::mkdir (dirname, hmode) && errno != EEXIST)
^
../../src/gdb/ctf.c:309:46: note: candidate: gnulib::_gl_mkdir_wrapper::type {aka int (*)(const char*, short unsigned int)} <conversion>
#define mkdir(pathname, mode) mkdir (pathname)
^
../../src/gdb/ctf.c:327:15: note: in expansion of macro 'mkdir'
if (gnulib::mkdir (dirname, hmode) && errno != EEXIST)
^
../../src/gdb/ctf.c:309:46: note: candidate expects 3 arguments, 2 provided
#define mkdir(pathname, mode) mkdir (pathname)
^
../../src/gdb/ctf.c:327:15: note: in expansion of macro 'mkdir'
if (gnulib::mkdir (dirname, hmode) && errno != EEXIST)
^
The problem is the '#define mkdir ...'
Fortunately, we can just remove it, since gnulib's sys/stat.h
replacement already takes care of the Windows mkdir prototype quirk:
~~~
/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
Additionally, it declares _mkdir (and depending on compile flags, an
alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
which are included above. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# if !GNULIB_defined_rpl_mkdir
static int
rpl_mkdir (char const *name, mode_t mode)
{
return _mkdir (name);
}
~~~
That's sys_stat.in.h, part of the sys_stat module, which we explictly
pull in nowadays. It wasn't being pulled when this macro was added:
https://sourceware.org/ml/gdb-patches/2013-03/msg00736.html
That patch was partially reverted meanwhile here:
https://sourceware.org/ml/gdb-patches/2013-12/msg00023.html
But the mkdir macro had been left behind unnoticed.
gdb/ChangeLog:
2016-11-17 Pedro Alves <palves@redhat.com>
* ctf.c [USE_WIN32API] (mkdir): Delete.
Pedro Alves [Wed, 16 Nov 2016 11:38:49 +0000 (11:38 +0000)]
gdb/ada-lang.c: one malloc -> unique_ptr<[]>
Switching gdb to use gnulib's C++ namespace mode reveals we're calling
malloc instead of xmalloc here:
..../src/gdb/ada-lang.c: In function ‘value* ada_value_primitive_packed_val(value*, const gdb_byte*, long int, int, int, type*)’:
..../src/gdb/ada-lang.c:2592:50: error: call to ‘malloc’ declared with attribute warning: The symbol ::malloc refers to the system function. Use gnulib::malloc instead. [-Werror]
staging = (gdb_byte *) malloc (staging_len);
^
We're unconditionaly using the result afterwards -- so it's not a case
of gracefully handling huge allocations.
Since we want to get rid of all cleanups, fix this by switching to
new[] and unique_ptr<[]> instead, while at it.
Regtested on Fedora 23.
gdb/ChangeLog:
2016-11-16 Pedro Alves <palves@redhat.com>
* ada-lang.c (ada_value_primitive_packed_val): Use unique_ptr and
new gdb_byte[] instead of malloc and cleanups.
Pedro Alves [Thu, 17 Nov 2016 00:23:17 +0000 (00:23 +0000)]
gdb/tracepoint.c: Don't use printf_vma
I noticed that bfd's printf_vma prints to stdout directly:
bfd-in2.h:202:#define printf_vma(x) fprintf_vma(stdout,x)
This is a bad idea in gdb, where we should use
gdb_stdout/gdb_stderr/gdb_stdlog, etc., to support redirection.
Eliminate uses of sprintf_vma too while at it.
Tested on Fedora 23, w/ gdbserver.
gdb/ChangeLog:
2016-11-17 Pedro Alves <palves@redhat.com>
* tracepoint.c (collection_list::add_memrange): Add gdbarch
parameter. Use paddress instead of printf_vma. Adjust recursive
calls.
(collection_list::stringify): Use paddress and phex_nz instead of
sprintf_vma. Adjust add_memrange call.
* tracepoint.h (collection_list::add_memrange): Add gdbarch
parameter.
GDB Administrator [Thu, 17 Nov 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in