Tom Tromey [Mon, 26 Sep 2016 14:59:13 +0000 (08:59 -0600)]
Convert dwarf_expr_context_funcs to methods
This patch converts the function pointers in dwarf_expr_context_funcs
into methods on dwarf_expr_context, and then updates the various
implementations and callers to follow.
NB this patch uses "override" (which caught a couple of renaming bugs
during development) -- but this is C++11, so this patch at least has
to wait for Pedro's patch that adds the OVERRIDE macro.
After this patch it would be possible to do one more, that makes
various members of dwarf_expr_context "protected"; but I haven't done
this.
2016-10-21 Tom Tromey <tom@tromey.com>
* dwarf2loc.c (struct dwarf_expr_context_funcs): Don't declare.
(dwarf_expr_read_addr_from_reg, dwarf_expr_get_reg_value)
(dwarf_expr_read_mem, dwarf_expr_frame_base): Rename; turn into
methods.
(get_frame_pc_for_per_cu_dwarf_call): New function.
(dwarf_expr_frame_cfa, dwarf_expr_frame_pc)
(dwarf_expr_tls_address): Rename; turn into methods.
(per_cu_dwarf_call): Remove arguments. Use
get_frame_pc_for_per_cu_dwarf_call.
(dwarf_evaluate_loc_desc): New class.
(dwarf_expr_dwarf_call, dwarf_expr_context)
(dwarf_expr_push_dwarf_reg_entry_value)
(dwarf_expr_get_addr_index, dwarf_expr_get_obj_addr): Rename; turn
into methods.
(dwarf_expr_ctx_funcs): Remove.
(dwarf2_evaluate_loc_desc_full): Update.
(dwarf2_locexpr_baton_eval): Update.
(symbol_needs_eval_context): New class.
(symbol_needs_read_addr_from_reg, symbol_needs_get_reg_value)
(symbol_needs_read_mem, symbol_needs_frame_base)
(symbol_needs_frame_cfa, symbol_needs_tls_address)
(symbol_needs_dwarf_call, needs_dwarf_reg_entry_value): Rename;
turn into methods.
(needs_get_addr_index, needs_get_obj_addr): Remove; turn into
methods.
(symbol_needs_ctx_funcs): Remove.
(dwarf2_loc_desc_get_symbol_read_needs): Update.
* dwarf2expr.h (struct dwarf_expr_context_funcs): Remove; turn
contents into methods.
(struct dwarf_expr_context) <baton, funcs>: Remove.
<read_addr_from_reg, get_reg_value, read_mem, get_frame_base,
get_frame_cfa, get_frame_pc, get_tls_address, dwarf_call,
impl_get_base_type, push_dwarf_block_entry_value, get_addr_index,
get_object_address>: Declare new methods.
(ctx_no_get_frame_base, ctx_no_get_frame_cfa)
(ctx_no_get_frame_pc, ctx_no_get_tls_address, ctx_no_dwarf_call)
(ctx_no_get_base_type, ctx_no_push_dwarf_reg_entry_value)
(ctx_no_get_addr_index): Don't declare.
* dwarf2expr.c (get_base_type): Use impl_get_base_type.
(execute_stack_op): Update.
(ctx_no_get_frame_base, ctx_no_get_frame_cfa)
(ctx_no_get_frame_pc, ctx_no_get_tls_address, ctx_no_dwarf_call)
(ctx_no_get_base_type, ctx_no_push_dwarf_reg_entry_value)
(ctx_no_get_addr_index): Remove; now methods on
dwarf_expr_context.
* dwarf2-frame.c (read_addr_from_reg): Take a frame_info, not a
baton.
(class dwarf_expr_executor): New class.
(get_reg_value, read_mem): Rename, turn into methods.
(execute_stack_op): Use dwarf_expr_executor.
Tom Tromey [Sun, 25 Sep 2016 22:48:47 +0000 (16:48 -0600)]
Convert DWARF expr functions to methods
This converts various DWARF expr functions to be members on
dwarf_expr_context, then fixes up the various users. This results in
somewhat less wordy code and sets the stage for the next patch.
2016-10-21 Tom Tromey <tom@tromey.com>
* dwarf2loc.c (per_cu_dwarf_call)
(dwarf_expr_push_dwarf_reg_entry_value)
(dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval)
(needs_dwarf_reg_entry_value)
(dwarf2_loc_desc_get_symbol_read_needs): Update.
* dwarf2expr.h (dwarf_expr_context) <push_address, eval, fetch,
fetch_address, fetch_in_stack_memory, address_type, grow_stack,
push, stack_empty_p, add_piece, get_base_type, execute_stack_op,
pop>: New method declarations.
(dwarf_expr_push_address, dwarf_expr_eval, dwarf_expr_fetch)
(dwarf_expr_fetch_address, dwarf_expr_fetch_in_stack_memory):
Don't declare.
* dwarf2expr.c (address_type, grow_stack, push, push_address)
(pop, fetch, fetch_address, fetch_in_stack_memory)
(stack_empty_p, add_piece, eval, get_base_type)
(execute_stack_op): Rename. Turn into methods.
* dwarf2-frame.c (execute_stack_op): Update.
Tom Tromey [Sun, 25 Sep 2016 22:28:03 +0000 (16:28 -0600)]
Initial conversion of dwarf_expr_ctx
This is the first step in the conversion of dwarf_expr_ctx to a C++
class. This conversion is done in steps to make the patches, and the
reviews, a bit simpler. This patch changes dwarf_expr_ctx to be
stack-allocated and removes the associated cleanup.
2016-10-21 Tom Tromey <tom@tromey.com>
* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Stack-allocate
dwarf_expr_context. Remove cleanups.
(dwarf2_locexpr_baton_eval)
(dwarf2_loc_desc_get_symbol_read_needs): Likewise.
* dwarf2expr.h (dwarf_expr_context, ~dwarf_expr_context): Add
constructors and destructors.
(new_dwarf_expr_context, free_dwarf_expr_context)
(make_cleanup_free_dwarf_expr_context): Don't declare.
* dwarf2-frame.c (execute_stack_op): Stack-allocate
dwarf_expr_context. Remove cleanups.
(dwarf_expr_context): Rename from new_dwarf_expr_context. Turn
into constructor.
(free_dwarf_expr_context, free_dwarf_expr_context_cleanup):
Remove.
(~dwarf_expr_context): Rename from
make_cleanup_free_dwarf_expr_context. Turn into destructor.
Tom Tromey [Sun, 25 Sep 2016 22:17:15 +0000 (16:17 -0600)]
Some cleanup removal in dwarf2loc.c
This removes some cleanups and manual allocation handling in
dwarf2loc.c with std::vector. Note that this patch has a case where
the vector would normally fall into the "use gdb::unique_ptr"
guidelines -- but here because the vector is immediately initialized,
I moved the initialization into the constructor call, for further
code savings.
2016-10-21 Tom Tromey <tom@tromey.com>
* dwarf2loc.c: Include <vector>.
(read_pieced_value, write_pieced_value)
(dwarf2_compile_expr_to_ax): Use std::vector.
Tom Tromey [Sun, 25 Sep 2016 03:53:54 +0000 (21:53 -0600)]
Remove make_cleanup_restore_current_uiout
This removes make_cleanup_restore_current_uiout in favor of an
RAII-based class.
2016-10-21 Tom Tromey <tom@tromey.com>
* stack.c (print_stack_frame_to_uiout): Use scoped_restore.
* ui-out.c (make_cleanup_restore_current_uiout)
(restore_current_uiout_cleanup): Remove.
* infrun.c (print_stop_event): Use scoped_restore.
* ui-out.h (make_cleanup_restore_current_uiout): Don't declare.
Tom Tromey [Sun, 25 Sep 2016 03:31:36 +0000 (21:31 -0600)]
Use gdb::unique_ptr in elf_read_minimal_symbols
This changes elf_read_minimal_symbols to use gdb::unique_ptr rather
than an explicit allocation. This removes a cleanup.
2016-10-21 Tom Tromey <tom@tromey.com>
* elfread.c (elf_read_minimal_symbols): Use gdb::unique_ptr.
Tom Tromey [Sun, 25 Sep 2016 03:21:35 +0000 (21:21 -0600)]
Replace two xmallocs with unique_ptr
This replaces a couple of uses of xmalloc with gdb::unique_ptr, also
removing a couple of cleanups.
2016-10-21 Tom Tromey <tom@tromey.com>
* cli/cli-dump.c (dump_memory_to_file): Use gdb::unique_ptr.
(restore_binary_file): Likewise.
Tom Tromey [Sun, 25 Sep 2016 03:10:45 +0000 (21:10 -0600)]
Change command stats reporting to use class
This removes make_command_stats_cleanup in favor of an RAII class.
The patch is reasonably straightforward, but keeping the same
semantics without excessive reindentation required splitting
captured_main in two.
2016-10-21 Tom Tromey <tom@tromey.com>
* maint.h (scoped_command_stats): New class.
(make_command_stats_cleanup): Don't declare.
* maint.c (struct cmd_stats): Remove.
(~scoped_command_stats): Rename from report_command_stats. Now a
destructor.
(scoped_command_stats): Rename from make_command_stats_cleanup.
Now a constructor.
* main.c (captured_main_1): New function. Use
scoped_command_stats.
(captured_main): Call captured_main_1.
* event-top.c (command_handler): Use scoped_command_stats.
Tom Tromey [Sun, 25 Sep 2016 02:56:12 +0000 (20:56 -0600)]
Remove some cleanups in MI
This patch removes a couple of cleanups from MI by using
gdb::unique_ptr.
2016-10-21 Tom Tromey <tom@tromey.com>
* mi/mi-main.c (mi_cmd_data_read_memory): Use gdb::unique_ptr.
Remove some cleanups.
Tom Tromey [Sat, 24 Sep 2016 22:11:14 +0000 (16:11 -0600)]
Remove make_cleanup_restore_current_ui
This removes make_cleanup_restore_current_ui by converting the last
use. The last use was in a few functions used to iterate over all
UIs. This patch replaces these functions with a class, and arranges
for the class destructor to do the needed cleanup.
2016-10-21 Tom Tromey <tom@tromey.com>
* tui/tui-interp.c (tui_on_normal_stop, tui_on_signal_received)
(tui_on_end_stepping_range, tui_on_signal_exited, tui_on_exited)
(tui_on_no_history, tui_on_user_selected_context_changed):
Update.
* top.h (switch_thru_all_uis): New class.
(SWITCH_THRU_ALL_UIS): Rewrite.
(make_cleanup_restore_current_ui, switch_thru_all_uis_init)
(switch_thru_all_uis_cond, switch_thru_all_uis_next): Don't
declare.
* mi/mi-interp.c (mi_new_thread, mi_thread_exit)
(mi_record_changed, mi_inferior_added, mi_inferior_appeared)
(mi_inferior_exit, mi_inferior_removed, mi_on_signal_received)
(mi_on_end_stepping_range, mi_on_signal_exited, mi_on_exited)
(mi_on_no_history, mi_on_normal_stop, mi_traceframe_changed)
(mi_tsv_created, mi_tsv_deleted, mi_tsv_modified)
(mi_breakpoint_created, mi_breakpoint_deleted)
(mi_breakpoint_modified, mi_output_running_pid, mi_on_resume)
(mi_solib_loaded, mi_solib_unloaded, mi_command_param_changed)
(mi_memory_changed, mi_user_selected_context_changed): Update.
* infrun.c (all_uis_check_sync_execution_done)
(all_uis_on_sync_execution_starting, normal_stop): Update.
* event-top.c (restore_ui_cleanup)
(make_cleanup_restore_current_ui, switch_thru_all_uis_init)
(switch_thru_all_uis_cond, switch_thru_all_uis_next): Remove.
* cli/cli-interp.c (cli_on_normal_stop, cli_on_signal_received)
(cli_on_end_stepping_range, cli_on_signal_exited, cli_on_exited)
(cli_on_no_history, cli_on_user_selected_context_changed):
Update.
* breakpoint.c (watchpoint_check): Update.
Tom Tromey [Thu, 22 Sep 2016 20:25:08 +0000 (14:25 -0600)]
Record minimal symbols directly in reader.
This patch changes minimal symbol creation in two ways. First, it
removes global variables in favor of members of minimal_symbol_reader.
Second, it changes functions like prim_record_minimal_symbol to be
member functions of minimal_symbol_reader.
2016-10-21 Tom Tromey <tom@tromey.com>
* xcoffread.c (record_minimal_symbol, scan_xcoff_symtab): Add
"reader" argument. Update.
(xcoff_initial_scan): Update.
* symfile.h (mdebug_build_psymtabs): Add "reader" argument.
* mipsread.c (mipscoff_symfile_read): Update.
(read_alphacoff_dynamic_symtab): Add "reader" argument. Update.
* minsyms.h (minimal_symbol_reader) <record, record_full>:
Declare.
<m_msym_bunch, m_msym_bunch_index, m_msym_count>: New members.
<record_with_info>: New function, renamed from
prim_record_minimal_symbol_and_info.
* minsyms.c (msym_bunch, msym_bunch_index, msym_count): Remove
globals.
(minimal_symbol_reader): Initialize new members.
(minimal_symbol_reader::record): Renamed from
prim_record_minimal_symbol.
(minimal_symbol_reader::record_full): Renamed from
prim_record_minimal_symbol_full.
(prim_record_minimal_symbol_and_info): Move to minsyms.h; rename.
* mdebugread.c (mdebug_build_psymtabs, parse_partial_symbols)
(record_minimal_symbol): Add "reader" argument. Update.
(elfmdebug_build_psymtabs): Update.
* machoread.c (macho_symtab_add_minsym, macho_symtab_read): Add
"reader" argument. Update.
(macho_symfile_read): Update.
* elfread.c (record_minimal_symbol, elf_symtab_read)
(elf_rel_plt_read): Add "reader" argument. Update.
(elf_read_minimal_symbols): Update.
* dbxread.c (record_minimal_symbol, read_dbx_dynamic_symtab)
(read_dbx_symtab): Add "reader" argument. Update.
(dbx_symfile_read): Update.
* coffread.c (record_minimal_symbol, coff_symtab_read): Add
"reader" argument. Update.
(coff_symfile_read): Update.
* coff-pe-read.h (read_pe_exported_syms): Add "reader" argument.
* coff-pe-read.c (add_pe_exported_sym, add_pe_forwarded_sym)
(read_pe_exported_syms): Add "reader" argument. Update.
Tom Tromey [Thu, 22 Sep 2016 19:57:15 +0000 (13:57 -0600)]
Change minimal_symbol_reader to store objfile
This changes minimal_symbol_reader to require the objfile to be
passed to the constructor. The class now records the objfile and
automatically uses it later in "install".
This is a minor cleanup that will come in useful in the next patch.
It is separate from the first patch to keep that one a bit simpler to
understand.
2016-10-21 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_initial_scan): Update.
* mipsread.c (mipscoff_symfile_read): Update.
* minsyms.c (minimal_symbol_reader): Add obj argument.
Initialize member.
(install): Remove objfile argument. Update.
* mdebugread.c (elfmdebug_build_psymtabs): Update.
* machoread.c (macho_symfile_read): Update.
* elfread.c (elf_read_minimal_symbols): Update.
* dbxread.c (dbx_symfile_read): Update.
* coffread.c (coff_symfile_read): Update.
* minsyms.h (minimal_symbol_reader): Add m_objfile member.
(constructor): Add objfile argument.
(minimal_symbol_reader::install): Remove objfile argument.
Tom Tromey [Thu, 22 Sep 2016 19:47:48 +0000 (13:47 -0600)]
Introduce minimal_symbol_reader
This patch introduced minimal_symbol_reader, a RAII-based class which
replaces the current make_cleanup_discard_minimal_symbols.
2016-10-21 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_initial_scan): Use
minimal_symbol_reader.
* mipsread.c (mipscoff_symfile_read): Use
minimal_symbol_reader.
* minsyms.h (minimal_symbol_reader): New class.
(init_minimal_symbol_collection)
(make_cleanup_discard_minimal_symbols, install_minimal_symbols):
Don't declare.
* minsyms.c (minimal_symbol_reader): Renamed from
init_minimal_symbol_collection, turned into constructor.
(~minimal_symbol_reader): Renamed from
do_discard_minimal_symbols_cleanup, turned into destructor.
(make_cleanup_discard_minimal_symbols): Remove.
(minimal_symbol_reader::install): Rename form
install_minimal_symbols.
* mdebugread.c (elfmdebug_build_psymtabs): Use
minimal_symbol_reader.
* machoread.c (macho_symfile_read): Use
minimal_symbol_reader.
* elfread.c (elf_read_minimal_symbols): Use
minimal_symbol_reader.
* dbxread.c (dbx_symfile_read): Use minimal_symbol_reader.
* coffread.c (coff_symfile_read): Use
minimal_symbol_reader.
Tom Tromey [Fri, 23 Sep 2016 02:50:52 +0000 (20:50 -0600)]
Use scoped_restore for current_ui
This changes most uses of make_cleanup_restore_current_ui to use
scoped_restore. The use in switch_thru_all_uis_init still remains;
that is dealt with in a later patch by replacing this iterator with a
real class.
2016-10-21 Tom Tromey <tom@tromey.com>
* top.c (new_ui_command, wait_sync_command_done)
(gdb_readline_wrapper): Use scoped_restore.
* infrun.c (fetch_inferior_event): Use scoped_restore.
* infcall.c (call_thread_fsm_should_stop): Use scoped_restore.
Tom Tromey [Fri, 23 Sep 2016 02:33:30 +0000 (20:33 -0600)]
Use scoped_restore for ui_file
This replaces all the uses of make_cleanup_restore_ui_file with
scoped_restore.
2016-10-21 Tom Tromey <tom@tromey.com>
* utils.c (make_cleanup_restore_ui_file, do_restore_ui_file)
(struct restore_ui_file_closure): Remove.
* utils.h (make_cleanup_restore_ui_file): Don't declare.
* guile/scm-ports.c (ioscm_with_output_to_port_worker): Use
scoped_restore.
* top.c (execute_command_to_string): Use scoped_restore.
Tom Tromey [Fri, 23 Sep 2016 02:29:11 +0000 (20:29 -0600)]
Use RAII to save and restore scalars
This patch replaces many (but not all) uses of
make_cleanup_restore_integer with a simple RAII-based template class.
It also removes the similar restore_execution_direction cleanup in
favor of this new class. Subsequent patches will replace other
similar cleanups with this class.
The class is typically instantiated using make_scoped_restore. This
allows for template argument deduction.
2016-10-21 Tom Tromey <tom@tromey.com>
* common/scoped_restore.h: New file.
* utils.h: Include scoped_restore.h.
* top.c (execute_command_to_string): Use scoped_restore.
* python/python.c (python_interactive_command): Use
scoped_restore.
(python_command, execute_gdb_command): Likewise.
* printcmd.c (do_one_display): Use scoped_restore.
* mi/mi-main.c (exec_continue): Use scoped_restore.
* mi/mi-cmd-var.c (mi_cmd_var_assign): Use scoped_restore.
* linux-fork.c (checkpoint_command): Use scoped_restore.
* infrun.c (restore_execution_direction): Remove.
(fetch_inferior_event): Use scoped_restore.
* compile/compile.c (compile_file_command): Use
scoped_restore.
(compile_code_command, compile_print_command): Likewise.
* cli/cli-script.c (execute_user_command): Use
scoped_restore.
(while_command, if_command, script_from_file): Likewise.
* arm-tdep.c (arm_insert_single_step_breakpoint): Use
scoped_restore.
Tom Tromey [Fri, 21 Oct 2016 20:09:57 +0000 (14:09 -0600)]
Fix build failure in xcoffread.c
This changes read_xcoff_symtab to be const-correct. This fixes a
build failure.
2016-10-21 Tom Tromey <tom@tromey.com>
* xcoffread.c (read_xcoff_symtab): Make "filestring" const.
H.J. Lu [Fri, 21 Oct 2016 19:16:32 +0000 (12:16 -0700)]
X86: Remove pcommit instruction
Remove x86 pcommit instruction support, which has been deprecated:
https://software.intel.com/en-us/blogs/2016/09/12/deprecate-pcommit-instruction
gas/
* config/tc-i386.c (cpu_arch): Remove .pcommit.
* doc/c-i386.texi: Likewise.
* testsuite/gas/i386/i386.exp: Remove pcommit tests.
* testsuite/gas/i386/pcommit-intel.d: Removed.
* testsuite/gas/i386/pcommit.d: Likewise.
* testsuite/gas/i386/pcommit.s: Likewise.
* testsuite/gas/i386/x86-64-pcommit-intel.d: Likewise.
* testsuite/gas/i386/x86-64-pcommit.d: Likewise.
* testsuite/gas/i386/x86-64-pcommit.s: Likewise.
opcodes/
* i386-dis.c (PREFIX_RM_0_0FAE_REG_7): Removed.
(prefix_table): Remove the PREFIX_RM_0_0FAE_REG_7 entry.
(rm_table): Update the RM_0FAE_REG_7 entry.
* i386-gen.c (cpu_flag_init): Remove CPU_PCOMMIT_FLAGS.
(cpu_flags): Remove CpuPCOMMIT.
* i386-opc.h (CpuPCOMMIT): Removed.
(i386_cpu_flags): Remove cpupcommit.
* i386-opc.tbl: Remove pcommit.
* i386-init.h: Regenerated.
* i386-tbl.h: Likewise.
Gergely Nagy [Fri, 21 Oct 2016 18:08:20 +0000 (11:08 -0700)]
Fix PR 17704.
This fix keeps the section with the highest alignment when folding sections with ICF.
PR gold/17704
* icf.cc (match_sections): Add new parameter section_addraligns.
Check section alignment and keep the section with the strictest
alignment.
(find_identical_sections): New local variable section_addraligns.
Store each section's alignment.
* testsuite/pr17704a_test.s: New file.
* testsuite/Makefile.am (pr17704a_test): New test.
* testsuite/Makefile.in: Regenerate.
Ulrich Weigand [Fri, 21 Oct 2016 15:47:15 +0000 (17:47 +0200)]
Fix symbol table file name on AIX
When xlc -qfuncsect or gcc -ffunction-sections options is used in AIX,
each function csect is associated with each psymtab, so each psymtab
will have it's corresponding filename entries set.
If the pst filename isn't set then we will be seeing the below output
when we set a breakpoint.
(gdb) br main
Breakpoint 1 at 0x10000374: file _start_ , line 18.
With the fix it will be.
(gdb) br main
Breakpoint 1 at 0x10000518: file test.c, line 24.
Attached patch resolve this issue and correct filename will be set.
gdb/
2016-10-21 Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
* xcoffread.c (read_xcoff_symtab): Make name of current file as
pst->filename instead of _start_ in AIX.
Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Philipp Rudo [Fri, 21 Oct 2016 10:32:52 +0000 (12:32 +0200)]
Delete target_so_ops->special_symbol_handling hook
No one(!) actually implements this hook. So simply delete it.
gdb/ChangeLog:
* solist.h (struct target_so_ops): Delete special_symbol_handling
hook.
* solib.c (solib_add, reload_shared_libraries): Adjust.
* solib-aix.c (solib_aix_special_symbol_handling): Delete
(_initialize_solib_aix): Adjust
* solib-darwin.c (darwin_special_symbol_handling): Delete
(_initialize_darwin_solib): Adjust
* solib-dsbt.c (dsbt_special_symbol_handling): Delete
(_initialize_dsbt_solib): Adjust
* solib-frv.c (frv_special_symbol_handling): Delete
(_initialize_frv_solib): Adjust
* solib-svr4.c (svr4_special_symbol_handling): Delete
(_initialize_svr4_solib): Adjust
* solib-target.c (solib_target_special_symbol_handling): Delete
(_initialize_solib_target): Adjust
GDB Administrator [Fri, 21 Oct 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
H.J. Lu [Thu, 20 Oct 2016 22:07:42 +0000 (15:07 -0700)]
Check invalid mask registers
In 32-bit, the REX_B bit in the 3-byte VEX prefix is ignored and the
the highest bit in VEX.vvvv is either 1 or ignored. In 64-bit, we
need to check invalid mask registers.
gas/
PR binutis/20705
* testsuite/gas/i386/i386.exp: Run x86-64-opcode-bad.
* testsuite/gas/i386/x86-64-opcode-bad.d: New file.
* testsuite/gas/i386/x86-64-opcode-bad.s: Likewise.
opcodes/
PR binutis/20705
* i386-dis.c (get_valid_dis386): Ignore the REX_B bit and
the highest bit in VEX.vvvv for the 3-byte VEX prefix in
32-bit mode. Don't check vex.register_specifier in 32-bit
mode.
(OP_E_register): Check invalid mask registers.
(OP_G): Likewise.
(OP_VEX): Likewise.
Jan Kratochvil [Thu, 20 Oct 2016 19:58:54 +0000 (21:58 +0200)]
testsuite: Fix gcc_compiled for gcc 6 & 7
gdb/testsuite/ChangeLog
2016-10-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/gdb.exp (get_compiler_info): Generalize gcc_compile regexp.
Nick Clifton [Thu, 20 Oct 2016 10:44:51 +0000 (11:44 +0100)]
Regenerate bfd.pot.
Yao Qi [Thu, 20 Oct 2016 10:33:07 +0000 (11:33 +0100)]
Don't configure gdb for vxworks target
VxWorks support was removed in 2004.
commit
e84ecc995d6a5e4e9114d3cea61717b8a573afb6
Author: Andrew Cagney <cagney@redhat.com>
Date: Sat Nov 13 23:10:02 2004 +0000
2004-11-13 Andrew Cagney <cagney@gnu.org>
* configure.tgt: Delete i[34567]86-*-vxworks*, m68*-netx-*,
m68*-*-vxworks*, mips*-*-vxworks*, powerpc-*-vxworks*, and
sparc-*-vxworks*.
* NEWS: Mention that vxworks was deleted.
This patch adds *-*-vxworks* in a list of targets GDB doesn't
support.
gdb:
2016-10-20 Yao Qi <yao.qi@linaro.org>
* configure.tgt: Don't configure if target is *-*-vxworks*.
GDB Administrator [Thu, 20 Oct 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
Maciej W. Rozycki [Wed, 19 Oct 2016 17:20:54 +0000 (18:20 +0100)]
testsuite: Fix gdb.base/killed-outside.exp using irrelevant stale options
Fix a commit
4a556533cf02 ("Fix PR11094: JIT breakpoint is not properly
recreated on reruns") regression:
Running .../gdb/testsuite/gdb.base/killed-outside.exp ...
Executing on host: mips-mti-linux-gnu-gcc -Wl,--no-as-needed -c -g -o .../gdb/testsuite/outputs/gdb.base/killed-outside/killed-outside0.o .../gdb/testsuite/gdb.base/killed-outside.c .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so (timeout = 300)
spawn mips-mti-linux-gnu-gcc -Wl,--no-as-needed -c -g -o .../gdb/testsuite/outputs/gdb.base/killed-outside/killed-outside0.o .../gdb/testsuite/gdb.base/killed-outside.c .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so
mips-mti-linux-gnu-gcc: warning: .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so: linker input file unused because linking not done
output is:
mips-mti-linux-gnu-gcc: warning: .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so: linker input file unused because linking not done
gdb compile failed, mips-mti-linux-gnu-gcc: warning: .../gdb/testsuite/outputs/gdb.base/jit-simple/jit-simple-jit.so: linker input file unused because linking not done
UNTESTED: gdb.base/killed-outside.exp: failed to prepare
and adjust the call to `prepare_for_testing' by removing a reference to
`options', which is not set in this test case but a stale value is
carried over from `gdb.base/jit-simple.exp' previously executed in a
full test suite run.
gdb/testsuite/
* gdb.base/killed-outside.exp: Remove $options from a call to
`prepare_for_testing'.
Nick Clifton [Wed, 19 Oct 2016 13:04:34 +0000 (14:04 +0100)]
Add c-format tags to translatable strings with more than one argument-using formatting token.
* aout-adobe.c: Add missing c-format tags for translatable strings.
* aout-cris.c: Likewise.
* aoutx.h: Likewise.
* bfd.c: Likewise.
* binary.c: Likewise.
* cache.c: Likewise.
* coff-alpha.c: Likewise.
* coff-arm.c: Likewise.
* coff-i860.c: Likewise.
* coff-mcore.c: Likewise.
* coff-ppc.c: Likewise.
* coff-rs6000.c: Likewise.
* coff-sh.c: Likewise.
* coff-tic4x.c: Likewise.
* coff-tic54x.c: Likewise.
* coff-tic80.c: Likewise.
* coff64-rs6000.c: Likewise.
* coffcode.h: Likewise.
* coffgen.c: Likewise.
* cofflink.c: Likewise.
* coffswap.h: Likewise.
* cpu-arm.c: Likewise.
* dwarf2.c: Likewise.
* ecoff.c: Likewise.
* elf-attrs.c: Likewise.
* elf-eh-frame.c: Likewise.
* elf-ifunc.c: Likewise.
* elf-m10300.c: Likewise.
* elf-s390-common.c: Likewise.
* elf.c: Likewise.
* elf32-arc.c: Likewise.
* elf32-arm.c: Likewise.
* elf32-avr.c: Likewise.
* elf32-bfin.c: Likewise.
* elf32-cr16.c: Likewise.
* elf32-cr16c.c: Likewise.
* elf32-cris.c: Likewise.
* elf32-crx.c: Likewise.
* elf32-d10v.c: Likewise.
* elf32-d30v.c: Likewise.
* elf32-epiphany.c: Likewise.
* elf32-fr30.c: Likewise.
* elf32-frv.c: Likewise.
* elf32-gen.c: Likewise.
* elf32-hppa.c: Likewise.
* elf32-i370.c: Likewise.
* elf32-i386.c: Likewise.
* elf32-i960.c: Likewise.
* elf32-ip2k.c: Likewise.
* elf32-iq2000.c: Likewise.
* elf32-lm32.c: Likewise.
* elf32-m32c.c: Likewise.
* elf32-m32r.c: Likewise.
* elf32-m68hc11.c: Likewise.
* elf32-m68hc12.c: Likewise.
* elf32-m68hc1x.c: Likewise.
* elf32-m68k.c: Likewise.
* elf32-mcore.c: Likewise.
* elf32-mep.c: Likewise.
* elf32-metag.c: Likewise.
* elf32-microblaze.c: Likewise.
* elf32-moxie.c: Likewise.
* elf32-msp430.c: Likewise.
* elf32-mt.c: Likewise.
* elf32-nds32.c: Likewise.
* elf32-nios2.c: Likewise.
* elf32-or1k.c: Likewise.
* elf32-pj.c: Likewise.
* elf32-ppc.c: Likewise.
* elf32-rl78.c: Likewise.
* elf32-rx.c: Likewise.
* elf32-s390.c: Likewise.
* elf32-score.c: Likewise.
* elf32-score7.c: Likewise.
* elf32-sh-symbian.c: Likewise.
* elf32-sh.c: Likewise.
* elf32-sh64.c: Likewise.
* elf32-spu.c: Likewise.
* elf32-tic6x.c: Likewise.
* elf32-tilepro.c: Likewise.
* elf32-v850.c: Likewise.
* elf32-vax.c: Likewise.
* elf32-visium.c: Likewise.
* elf32-xgate.c: Likewise.
* elf32-xtensa.c: Likewise.
* elf64-alpha.c: Likewise.
* elf64-gen.c: Likewise.
* elf64-hppa.c: Likewise.
* elf64-ia64-vms.c: Likewise.
* elf64-mmix.c: Likewise.
* elf64-ppc.c: Likewise.
* elf64-s390.c: Likewise.
* elf64-sh64.c: Likewise.
* elf64-sparc.c: Likewise.
* elf64-x86-64.c: Likewise.
* elfcode.h: Likewise.
* elfcore.h: Likewise.
* elflink.c: Likewise.
* elfnn-aarch64.c: Likewise.
* elfnn-ia64.c: Likewise.
* elfxx-mips.c: Likewise.
* elfxx-sparc.c: Likewise.
* elfxx-tilegx.c: Likewise.
* ieee.c: Likewise.
* ihex.c: Likewise.
* libbfd.c: Likewise.
* linker.c: Likewise.
* m68klinux.c: Likewise.
* mach-o.c: Likewise.
* merge.c: Likewise.
* mmo.c: Likewise.
* oasys.c: Likewise.
* pdp11.c: Likewise.
* pe-mips.c: Likewise.
* peXXigen.c: Likewise.
* pei-x86_64.c: Likewise.
* peicode.h: Likewise.
* ppcboot.c: Likewise.
* reloc.c: Likewise.
* sparclinux.c: Likewise.
* srec.c: Likewise.
* stabs.c: Likewise.
* vms-alpha.c: Likewise.
* vms-lib.c: Likewise.
* xcofflink.c: Likewise.
Nick Clifton [Tue, 18 Oct 2016 11:02:52 +0000 (12:02 +0100)]
Remove spurious whitespace introduced by previous delta.
Pedro Alves [Wed, 19 Oct 2016 13:35:06 +0000 (14:35 +0100)]
Regen gdb/config.in
gdb/ChangeLog:
2016-10-19 Pedro Alves <palves@redhat.com>
* config.in: Regenerate.
Renlin Li [Wed, 19 Oct 2016 10:18:56 +0000 (11:18 +0100)]
[GAS][ARM]Generate unpredictable warning for pc used in data processing instructions with register-shifted register operand.
gas/
2016-10-19 Renlin Li <renlin.li@arm.com>
* config/tc-arm.c (encode_arm_shift): Generate unpredictable warning
for register-shifted register instructions.
* testsuite/gas/arm/shift-bad-pc.d: New.
* testsuite/gas/arm/shift-bad-pc.l: New.
* testsuite/gas/arm/shift-bad-pc.s: New.
GDB Administrator [Wed, 19 Oct 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
Pedro Alves [Tue, 18 Oct 2016 19:48:37 +0000 (20:48 +0100)]
gdb: no longer define __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS
My gnulib fix at:
https://lists.gnu.org/archive/html/bug-gnulib/2015-11/msg00010.html
was merged upstream meanwhile and our gnulib copy now includes it.
As a concidence, Kevin was telling me today that these macros are
causing a build problem on FreeBSD:
common/common-defs.h:47:0: error: "__STDC_CONSTANT_MACROS" redefined [-Werror]
#define __STDC_CONSTANT_MACROS 1
/usr/include/sys/cdefs.h:408:0: note: this is the location of the previous definition
#define __STDC_CONSTANT_MACROS
(and a similar error for __STDC_LIMIT_MACROS)
The problem seems to be that we should be defining these input macros
before including any system header, but, we're not.
So let's just revert
e063da67902e ([C++] Define __STDC_CONSTANT_MACROS
/ __STDC_LIMIT_MACROS for stdint.h). If this causes a problem
somewhere, we can re-define the macros higher up in the file, before
system headers are included.
gdb/ChangeLog:
2016-10-18 Pedro Alves <palves@redhat.com>
* common/common-defs.h (__STDC_CONSTANT_MACROS)
(__STDC_LIMIT_MACROS): Delete.
Pedro Alves [Tue, 18 Oct 2016 16:18:29 +0000 (17:18 +0100)]
Update gnulib to current upstream master
I tried building gdb with G++ 4.7 and CXX="g++ -std=gnu+11", and that
tripped on a build error:
In file included from build-gnulib/import/stdio.h:53:0,
from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/common/common-defs.h:31,
from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/defs.h:28,
from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/armobsd-tdep.c:20:
build-gnulib/import/stddef.h:104:3: error: conflicting declaration ‘typedef union max_align_t max_align_t’
In file included from build-gnulib/import/stddef.h:55:0,
from build-gnulib/import/stdio.h:53,
from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/common/common-defs.h:31,
from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/defs.h:28,
from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/armobsd-tdep.c:20:
/opt/gcc-4.7/lib/gcc/x86_64-unknown-linux-gnu/4.7.4/include/stddef.h:426:3: error: ‘max_align_t’ has a previous declaration as ‘typedef struct max_align_t max_align_t’
Updating gnulib to current master fixes it, since it brings in this
fix:
http://lists.gnu.org/archive/html/bug-gnulib/2016-04/msg00000.html
Our last update was in August 2015. This doesn't bring in much added
baggage, it's mostly bug fixes. It pulled in the "limits-h" module as
automatic dependency, and given that looks potentially useful I added
it to the set of modules we require.
Tested on x86_64 Fedora 23, with g++ 4.7 and g++ 5.3, native and gdbserver.
gdb/ChangeLog:
2016-10-18 Pedro Alves <palves@redhat.com>
* gnulib/update-gnulib.sh (GNULIB_COMMIT_SHA1): Set to
2692e23a48e21f6daa029e8af9f1a143b7532f47.
* gnulib/configure, gnulib/config.in, gnulib/aclocal.m4:
Regenerate.
* gnulib/import/Makefile: Update.
* gnulib/import/alloca: Update.
* gnulib/import/basename-lgpl: Update.
* gnulib/import/canonicalize-lgpl: Update.
* gnulib/import/config: Update.
* gnulib/import/dirent: Update.
* gnulib/import/dirfd: Update.
* gnulib/import/dirname-lgpl: Update.
* gnulib/import/dirname.h: Update.
* gnulib/import/dosname.h: Update.
* gnulib/import/errno: Update.
* gnulib/import/extra/snippet/arg-nonnull.h: Update.
* gnulib/import/extra/snippet/c++defs.h: Update.
* gnulib/import/extra/snippet/warn-on-use.h: Update.
* gnulib/import/extra/update-copyright: Update.
* gnulib/import/flexmember.h: Update.
* gnulib/import/float+.h: Update.
* gnulib/import/float: Update.
* gnulib/import/float: Update.
* gnulib/import/fnmatch: Update.
* gnulib/import/fnmatch: Update.
* gnulib/import/fnmatch_loop: Update.
* gnulib/import/fpucw.h: Update.
* gnulib/import/frexp: Update.
* gnulib/import/frexpl: Update.
* gnulib/import/gettimeofday: Update.
* gnulib/import/hard-locale: Update.
* gnulib/import/hard-locale.h: Update.
* gnulib/import/inttypes: Update.
* gnulib/import/isnan: Update.
* gnulib/import/isnand-nolibm.h: Update.
* gnulib/import/isnand: Update.
* gnulib/import/isnanl-nolibm.h: Update.
* gnulib/import/isnanl: Update.
* gnulib/import/itold: Update.
* gnulib/import/limits: Update.
* gnulib/import/localcharset: Update.
* gnulib/import/localcharset.h: Update.
* gnulib/import/lstat: Update.
* gnulib/import/m4/00gnulib: Update.
* gnulib/import/m4/absolute-header: Update.
* gnulib/import/m4/alloca: Update.
* gnulib/import/m4/canonicalize: Update.
* gnulib/import/m4/codeset: Update.
* gnulib/import/m4/configmake: Update.
* gnulib/import/m4/dirent_h: Update.
* gnulib/import/m4/dirfd: Update.
* gnulib/import/m4/dirname: Update.
* gnulib/import/m4/double-slash-root: Update.
* gnulib/import/m4/eealloc: Update.
* gnulib/import/m4/errno_h: Update.
* gnulib/import/m4/exponentd: Update.
* gnulib/import/m4/exponentl: Update.
* gnulib/import/m4/extensions: Update.
* gnulib/import/m4/extern-inline: Update.
* gnulib/import/m4/fcntl-o: Update.
* gnulib/import/m4/flexmember: Update.
* gnulib/import/m4/float_h: Update.
* gnulib/import/m4/fnmatch: Update.
* gnulib/import/m4/fpieee: Update.
* gnulib/import/m4/frexp: Update.
* gnulib/import/m4/frexpl: Update.
* gnulib/import/m4/gettimeofday: Update.
* gnulib/import/m4/glibc21: Update.
* gnulib/import/m4/gnulib-cache: Update.
* gnulib/import/m4/gnulib-common: Update.
* gnulib/import/m4/gnulib-comp: Update.
* gnulib/import/m4/gnulib-tool: Update.
* gnulib/import/m4/hard-locale: Update.
* gnulib/import/m4/include_next: Update.
* gnulib/import/m4/inttypes-pri: Update.
* gnulib/import/m4/inttypes: Update.
* gnulib/import/m4/isnand: Update.
* gnulib/import/m4/isnanl: Update.
* gnulib/import/m4/largefile: Update.
* gnulib/import/m4/limits-h: Update.
* gnulib/import/m4/localcharset: Update.
* gnulib/import/m4/locale-fr: Update.
* gnulib/import/m4/locale-ja: Update.
* gnulib/import/m4/locale-zh: Update.
* gnulib/import/m4/longlong: Update.
* gnulib/import/m4/lstat: Update.
* gnulib/import/m4/malloc: Update.
* gnulib/import/m4/malloca: Update.
* gnulib/import/m4/math_h: Update.
* gnulib/import/m4/mbrtowc: Update.
* gnulib/import/m4/mbsinit: Update.
* gnulib/import/m4/mbsrtowcs: Update.
* gnulib/import/m4/mbstate_t: Update.
* gnulib/import/m4/memchr: Update.
* gnulib/import/m4/memmem: Update.
* gnulib/import/m4/mmap-anon: Update.
* gnulib/import/m4/multiarch: Update.
* gnulib/import/m4/nocrash: Update.
* gnulib/import/m4/off_t: Update.
* gnulib/import/m4/pathmax: Update.
* gnulib/import/m4/rawmemchr: Update.
* gnulib/import/m4/readlink: Update.
* gnulib/import/m4/rename: Update.
* gnulib/import/m4/rmdir: Update.
* gnulib/import/m4/signal_h: Update.
* gnulib/import/m4/ssize_t: Update.
* gnulib/import/m4/stat: Update.
* gnulib/import/m4/stdbool: Update.
* gnulib/import/m4/stddef_h: Update.
* gnulib/import/m4/stdint: Update.
* gnulib/import/m4/stdio_h: Update.
* gnulib/import/m4/stdlib_h: Update.
* gnulib/import/m4/strchrnul: Update.
* gnulib/import/m4/string_h: Update.
* gnulib/import/m4/strstr: Update.
* gnulib/import/m4/strtok_r: Update.
* gnulib/import/m4/sys_socket_h: Update.
* gnulib/import/m4/sys_stat_h: Update.
* gnulib/import/m4/sys_time_h: Update.
* gnulib/import/m4/sys_types_h: Update.
* gnulib/import/m4/time_h: Update.
* gnulib/import/m4/unistd_h: Update.
* gnulib/import/m4/warn-on-use: Update.
* gnulib/import/m4/wchar_h: Update.
* gnulib/import/m4/wchar_t: Update.
* gnulib/import/m4/wctype_h: Update.
* gnulib/import/m4/wint_t: Update.
* gnulib/import/malloc: Update.
* gnulib/import/malloca: Update.
* gnulib/import/malloca.h: Update.
* gnulib/import/math: Update.
* gnulib/import/math: Update.
* gnulib/import/mbrtowc: Update.
* gnulib/import/mbsinit: Update.
* gnulib/import/mbsrtowcs-impl.h: Update.
* gnulib/import/mbsrtowcs-state: Update.
* gnulib/import/mbsrtowcs: Update.
* gnulib/import/memchr: Update.
* gnulib/import/memmem: Update.
* gnulib/import/pathmax.h: Update.
* gnulib/import/rawmemchr: Update.
* gnulib/import/readlink: Update.
* gnulib/import/ref-add.sin: Update.
* gnulib/import/ref-del.sin: Update.
* gnulib/import/rename: Update.
* gnulib/import/rmdir: Update.
* gnulib/import/same-inode.h: Update.
* gnulib/import/signal: Update.
* gnulib/import/stat: Update.
* gnulib/import/stdbool: Update.
* gnulib/import/stddef: Update.
* gnulib/import/stdint: Update.
* gnulib/import/stdio: Update.
* gnulib/import/stdlib: Update.
* gnulib/import/str-two-way.h: Update.
* gnulib/import/strchrnul: Update.
* gnulib/import/streq.h: Update.
* gnulib/import/string: Update.
* gnulib/import/stripslash: Update.
* gnulib/import/strnlen1: Update.
* gnulib/import/strnlen1.h: Update.
* gnulib/import/strstr: Update.
* gnulib/import/strtok_r: Update.
* gnulib/import/sys_stat: Update.
* gnulib/import/sys_time: Update.
* gnulib/import/sys_types: Update.
* gnulib/import/time: Update.
* gnulib/import/unistd: Update.
* gnulib/import/unistd: Update.
* gnulib/import/verify.h: Update.
* gnulib/import/wchar: Update.
* gnulib/import/wctype: Update.
* gnulib/import/flexmember.h: New file.
* gnulib/import/hard-locale.c: New file.
* gnulib/import/hard-locale.h: New file.
* gnulib/import/limits.in.h: New file.
* gnulib/import/m4/flexmember.m4: New file.
* gnulib/import/m4/hard-locale.m4: New file.
* gnulib/import/m4/limits-h.m4: New file.
H.J. Lu [Tue, 18 Oct 2016 16:06:27 +0000 (09:06 -0700)]
Check addr32flag instead of sizeflag for rip/eip
Since the address size prefix, 0x67, is ignored for MPX instructions in
64-bit mode, we should check addr32flag instead of sizeflag for rip/eip.
PR binutis/20699
* i386-dis.c (OP_E_memory): Check addr32flag instead of sizeflag
for rip/eip.
H.J. Lu [Tue, 18 Oct 2016 15:14:10 +0000 (08:14 -0700)]
Remove the remaining SSE5 support
PR binutis/20704
* i386-dis.c (three_byte_table): Remove the remaining SSE5 support.
Pedro Alves [Tue, 18 Oct 2016 10:42:35 +0000 (11:42 +0100)]
Introduce gdb::unique_ptr
Many make_cleanup uses in the code base are best eliminated by using a
"owning" smart pointer to manage ownership of the resource
automatically.
The question is _which_ smart pointer.
GDB currently supports building with a C++03 compiler. We have
std::auto_ptr in C++03, but, as is collective wisdom by now, that's
too easy to misuse, and has therefore been deprecated in C++11 and
finally removed in C++17.
It'd be nice to be able to use std::unique_ptr instead, which is the
modern, safe std::auto_ptr replacement in C++11.
In addition to extra safety -- moving (i.e., transfer of ownership of
the managed pointer between smart pointers) must be explicit --
std::unique_ptr has (among others) one nice feature that std::auto_ptr
doesn't --- ability to specify a custom deleter as template parameter.
In gdb's context, that allows easily creating a smart pointer for
memory allocated with xmalloc -- the smart pointer then knows to
release with xfree instead of delete. This is particularly
interesting when managing objects allocated in C libraries, and also,
for C++-fying parts of GDB that interact with other parts that still
return objects allocated with xmalloc.
Since std::unique_ptr's API is quite nice, and eventually we'd like to
move to C++11, this patch adds a C++03-compatible smart pointer that
exposes the subset of the std::unique_ptr API that we're interested
in. An advantage is that whenever we start requiring C++11, we won't
have to learn a new API. Meanwhile, this allows continuing to support
building with a C++03 compiler.
Since C++03 doesn't support rvalue references (boost gets close to
emulating them, but it's not fully transparent to user code), the
C++03 std::unique_ptr emulation here doesn't try hard to prevent
accidentally moving, which is where most of complication of a more
thorough emulation would be. Instead, we rely on the fact that GDB
will be usually compiled with a C++11 compiler, and use the real
std::unique_ptr in that case to catch such accidental moves. IOW, the
goal here is to allow code that would be correct using std::unique_ptr
to be equally correct in C++03 mode, and, just as efficient.
The C++03 version was originally based on GCC 7.0's std::auto_ptr and
then heavily customized to behave more like C++11's std::unique_ptr:
- Support for custom (stateless) deleters. (Support for stateful
deleters could be added, if necessary.)
- unique_ptr<T[]> partial specialization (auto_ptr<T> does not know
to use delete[]).
- Support for all of 'ptr != NULL', 'ptr == NULL' and 'if (ptr)'
using the safe bool idiom to emulate C++11's explicit bool
operator.
- There's no nullptr in C++03, so this allows initialization and
assignment from NULL instead (std::auto_ptr allows neither).
- Variable names un-uglified (ie., no leading __ prefix everywhere).
- Formatting made to follow GDB's coding conventions, including
comment style.
- Converting "move" constructors done differently in order to truly
support:
unique_ptr<Derived> func_returning_unique_ptr (.....);
...
unique_ptr<Base> ptr = func_returning_unique_ptr (.....);
At this point, it no longer shares much at all with the original file,
but, that's the history.
See comments in the code to find out more.
I thought of putting the "emulation" / shim in the "std" namespace, so
that when we start requiring C++11 at some point, no actual changes to
users of the smart pointer throughout would be necessary. Putting
things in the std namespace is technically undefined, however in
practice it doesn't cause any issue with any compiler. However,
thinking that people might be confused with seeing std::unique_ptr and
thinking that we're actually requiring C++11 already, I put the new
types in the "gdb" namespace instead.
For managing xmalloc pointers, this adds a gdb::unique_xmalloc_ptr<T>
"specialization" with a custom xfree deleter.
No actual use of any smart pointer is introduced in this patch.
That'll be done in following patches.
Tested (along with the rest of the series) on:
- NetBSD 5.1 (gcc70 on the compile farm), w/ gcc 4.1.3
- x86-64 Fedora 23, gcc 5.3.1 (gnu++03)
- x86-64 Fedora 23, and gcc 7.0 (gnu++14)
gdb/ChangeLog:
2016-10-18 Pedro Alves <palves@redhat.com>
* common/common-defs.h: Include "gdb_unique_ptr.h".
* common/gdb_unique_ptr.h: New.
Nick Clifton [Tue, 18 Oct 2016 09:56:12 +0000 (10:56 +0100)]
Updated Danish translation for the BFD library.
Mike Frysinger [Mon, 17 Oct 2016 02:34:08 +0000 (22:34 -0400)]
sim: avr: move changelog entries to subdir
Maciej W. Rozycki [Mon, 17 Oct 2016 15:15:33 +0000 (16:15 +0100)]
i386-tdep: Verify architecture before proceeding with `set/show mpx'
Make sure the architecture is `bfd_arch_i386' before handling the `set
mpx' and `show mpx' commands, avoiding the issue with `i386_mpx_enabled'
interpreting `gdbarch->tdep' according to the `struct gdbarch_tdep'
definition in i386-tdep.h while indeed in a multi-target configuration
it may have a different layout and cause GDB to crash or at least
misbehave.
gdb/
* i386-tdep.c (i386_mpx_info_bounds): Make sure the architecture
is `bfd_arch_i386' before proceeding.
(i386_mpx_set_bounds): Likewise.
Maciej W. Rozycki [Mon, 17 Oct 2016 15:18:06 +0000 (16:18 +0100)]
tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'
Fix a load of aliasing build errors:
cc1plus: warnings being treated as errors
.../gdb/tilegx-tdep.c: In function 'CORE_ADDR tilegx_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, tilegx_frame_cache*, frame_info*)':
.../gdb/tilegx-tdep.c:609: error: dereferencing pointer 'operands' does break strict-aliasing rules
.../gdb/tilegx-tdep.c:592: error: dereferencing pointer 'operands' does break strict-aliasing rules
.../gdb/tilegx-tdep.c:571: error: dereferencing pointer 'operands' does break strict-aliasing rules
[...]
.../gdb/tilegx-tdep.c:601: error: dereferencing pointer '<anonymous>' does break strict-aliasing rules
.../gdb/tilegx-tdep.c:601: note: initialized from here
cc1plus: error: dereferencing pointer 'operands' does break strict-aliasing rules
cc1plus: error: dereferencing pointer 'operands' does break strict-aliasing rules
.../gdb/tilegx-tdep.c:452: note: initialized from here
cc1plus: error: dereferencing pointer 'pretmp.896' does break strict-aliasing rules
cc1plus: note: initialized from here
cc1plus: error: dereferencing pointer 'pretmp.896' does break strict-aliasing rules
cc1plus: note: initialized from here
make[1]: *** [tilegx-tdep.o] Error 1
from an attempt to cast a `long long' pointer to an `int64_t' pointer,
which may not necessarily be compatible types. Use the `long long' type
for the auxiliary variable then as this is the type of the structure
member referred.
gdb/
* tilegx-tdep.c (tilegx_analyze_prologue): Use the `long long'
type for `operands'.
Maciej W. Rozycki [Tue, 18 Oct 2016 03:36:01 +0000 (04:36 +0100)]
AArch64/opcodes: Correct an `index' global shadowing error
Fix a commit
4df068de5214 ("Add support for SVE addressing modes") build
regression:
cc1: warnings being treated as errors
.../opcodes/aarch64-dis.c: In function 'aarch64_ext_sve_addr_rr_lsl':
.../opcodes/aarch64-dis.c:1324: error: declaration of 'index' shadows a global declaration
/usr/include/string.h:303: error: shadowed declaration is here
make[3]: *** [aarch64-dis.lo] Error 1
in a way following commit
91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").
opcodes/
* aarch64-dis.c (aarch64_ext_sve_addr_rr_lsl): Rename `index'
local variable to `index_regno'.
Maciej W. Rozycki [Tue, 18 Oct 2016 03:34:36 +0000 (04:34 +0100)]
NDS32/BFD: Correct an aliasing error in `nds32_elf_check_relocs'
Fix an aliasing build error:
cc1: warnings being treated as errors
.../bfd/elf32-nds32.c: In function 'nds32_elf_check_relocs':
.../bfd/elf32-nds32.c:6644: warning: dereferencing type-punned pointer will break strict-aliasing rules
make[3]: *** [elf32-nds32.lo] Error 1
in a way following commit
6edfbbad0864 ("Fix up gcc4.1 aliasing
warnings"), <https://sourceware.org/ml/binutils/2005-10/msg00071.html>.
bfd/
* elf32-nds32.c (nds32_elf_check_relocs): Avoid aliasing warning
from GCC.
Maciej W. Rozycki [Tue, 18 Oct 2016 03:28:34 +0000 (04:28 +0100)]
ARM/BFD: Correct an `index' global shadowing error
Fix a commit
5025eb7c0d87 ("Delete relocations associatesd with deleted
exidx entries.") build regression:
cc1: warnings being treated as errors
.../bfd/elf32-arm.c: In function 'elf32_arm_update_relocs':
.../bfd/elf32-arm.c:14951: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:304: warning: shadowed declaration is here
make[3]: *** [elf32-arm.lo] Error 1
in a way following commit
91d6fa6a035c ("Add -Wshadow to the gcc command
line options used when compiling the binutils.").
bfd/
* elf32-arm.c (elf32_arm_update_relocs): Rename `index' local
variable to `reloc_index'.
GDB Administrator [Tue, 18 Oct 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
Simon Marchi [Mon, 17 Oct 2016 21:05:46 +0000 (17:05 -0400)]
Fix duplicate test message in mi-trace-save.exp
gdb/testsuite/ChangeLog:
* gdb.trace/mi-trace-save.exp (test_trace_save_wrong_num_args):
Change test message.
Simon Marchi [Mon, 17 Oct 2016 20:54:24 +0000 (16:54 -0400)]
Fix comment in mi-trace-save.exp
This fixes a comment I forgot to update in the previous patch.
gdb/testsuite/ChangeLog:
* gdb.trace/mi-trace-save.exp (test_trace_save_wrong_num_args):
Update comment.
Simon Marchi [Mon, 17 Oct 2016 20:47:36 +0000 (16:47 -0400)]
Fix -trace-save crash when argument is missing
-trace-save doesn't check whether an argument is passed, leading to a
segfault if you pass nothing.
I added a small test, which only tests the error conditions of
-trace-save.
gdb/ChangeLog:
* mi/mi-main.c (mi_cmd_trace_save): Check if argument is present
before using it.
gdb/testsuite/ChangeLog:
* gdb.trace/mi-trace-save.exp: New file.
Pedro Alves [Mon, 17 Oct 2016 16:13:26 +0000 (17:13 +0100)]
gdb: Fix phony iconv build
Cross building gdb for mingw32 on Fedora 23 fails with:
x86_64-w64-mingw32-g++ -g -O2 [...] ../../src/gdb/charset.c
In file included from ../../src/gdb/charset.c:21:0:
../../src/gdb/charset.h:134:3: error: 'iconv_t' does not name a type
iconv_t m_desc;
^
../../src/gdb/charset.c: In constructor 'wchar_iterator::wchar_iterator(const gdb_byte*, size_t, const char*, size_t)':
../../src/gdb/charset.c:600:3: error: 'm_desc' was not declared in this scope
m_desc = iconv_open (INTERMEDIATE_ENCODING, charset);
^
../../src/gdb/charset.c: In destructor 'wchar_iterator::~wchar_iterator()':
../../src/gdb/charset.c:607:7: error: 'm_desc' was not declared in this scope
if (m_desc != (iconv_t) -1)
^
../../src/gdb/charset.c: In member function 'int wchar_iterator::iterate(wchar_iterate_result*, gdb_wchar_t**, const gdb_byte**, size_t*)':
../../src/gdb/charset.c:633:25: error: 'm_desc' was not declared in this scope
size_t r = iconv (m_desc, &inptr, &m_bytes, &outptr, &out_avail);
^
This is a regression caused by commit
cda6c55bd399 (Turn wchar
iterator into a class). The problem is that iconv_t is now exposed in
gdb/charset.h, while before it was only used in gdb/charset.c.
gdb/charset.c, under #ifdef PHONY_ICONV, does:
#undef iconv_t
#define iconv_t int
So it seems the simplest is to use 'int' in the header file too.
gdb/ChangeLog:
2016-10-17 Pedro Alves <palves@redhat.com>
* charset.h (class wchar_iterator) [PHONY_ICONV] <m_desc>: Use
'int' as type.
Cupertino Miranda [Mon, 17 Oct 2016 14:45:57 +0000 (16:45 +0200)]
Fixed matching in newly added test.
gas/ChangeLog:
2016-10-17 Cupertino Miranda <cmiranda@synopsys.com>
* testsuite/arc/dis-inv.d: Fixed target match.
Nick Clifton [Mon, 17 Oct 2016 14:29:43 +0000 (15:29 +0100)]
Display unknown notes. Decode NT_GNU_HWCAP notes.
* readelf.c (apply_relocations): Fail if the symbol table section
linked to by the reloc section does not have either the SHT_SYMTAB
or SHT_DYNSYM type.
(print_gnu_note): Decode the contents of NT_GNU_HWCAP notes.
Print the contents of unknown note types.
(process_note): Add the file and section to the parameter list.
Use print_symbol to display the note name.
Display the contents of unknown note types.
(process_corefile_note_segment): Rename to process_notes_at.
Add section parameter. Apply relocations to the notes when
loading from a section. Display section name when processing
notes in a section.
* testsuite/binutils-all/readelf.n: Update expected output.
Cupertino Miranda [Wed, 21 Sep 2016 11:07:46 +0000 (12:07 +0100)]
Removed pseudo invalid instructions opcodes.
The disassember was generating invXXX instructions for cases when in reality we
had llockd or scondd instrutions.
opcodes/ChangeLog:
Cupertino Miranda <cmiranda@synopsys.com>
arc-tbl.h: Removed any "inv.+" instructions from the table.
gas/ChangeLog:
Cupertino Miranda <cmiranda@synopsys.com>
testsuite/arc/dis-inv.s: Test to validate patch.
testsuite/arc/dis-inv.d: Likewise.
Nick Clifton [Mon, 17 Oct 2016 10:46:32 +0000 (11:46 +0100)]
Update list of ELF machine numbers.
include * elf/common.h (DT_SYMTAB_SHNDX): Define.
(EM_CLOUDSHIELD, EM_COREA_1ST, EM_COREA_2ND, EM_OPEN8): Define.
(EM_VIDEOCORE5, EM_56800EX, EM_BA1, EM_BA2, EM_XCORE): Define.
(EM_MCHP_PIC, EM_KM32, EM_KMX32, EM_KMX16, EM_KMX8): Define.
(EM_KVARC, EM_CDP, EM_COGE, EM_COOL, EM_NORC): Define.
(EM_CSR_KALIMBA, EM_Z80, EM_AMDGPU, EM_RISCV): Define.
(ELFOSABI_OPENVOS): Define.
(GRP_MASKOS, GRP_MASKPROC): Define.
binutils * readelf.c (get_dynamic_type): Add DT_SYMTAB_SHNDX.
(get_machine_type): Add EM_CLOUDSHIELD, EM_COREA_1ST,
EM_COREA_2ND, EM_OPEN8, EM_VIDEOCORE5, EM_56800EX, EM_BA1, EM_BA2,
EM_XCORE, EM_MCHP_PIC, EM_KM32, EM_KMX32, EM_KMX16, EM_KMX8,
EM_KVARC, EM_CDP, EM_COGE, EM_COOL, EM_NORC, EM_CSR_KALIMBA,
EM_Z80, EM_AMDGPU, EM_RISCV.
(get_osabi_name): Add ELFOSABI_CLOUDABI and ELFOSABI_OPENVS.
(get_group_flags): Update to handle flags in the
GRP_MASKOS and GRP_MASKPROC ranges.
Nick Clifton [Mon, 17 Oct 2016 09:26:56 +0000 (10:26 +0100)]
Sync libiberty sources with gcc mainline.
2016-09-19 Andrew Stubbs <ams@codesourcery.com>
* pex-win32.c (argv_to_cmdline): Quote zero-length parameters.
* testsuite/test-pexecute.c (main): Insert check for zero-length parameters.
2016-09-10 Mark Wielaard <mjw@redhat.com>
* cp-demangle.c (d_substitution): Change struct demangle_component
variable name from c to dc.
2016-08-12 Marek Polacek <polacek@redhat.com>
PR c/7652
* cp-demangle.c (d_print_mod): Add FALLTHRU.
2016-08-04 Marcel B?hme <boehme.marcel@gmail.com>
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.
GDB Administrator [Mon, 17 Oct 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
GDB Administrator [Sun, 16 Oct 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Sat, 15 Oct 2016 01:54:54 +0000 (12:24 +1030)]
Regenerate spu_ovl.o_c
No real changes here. This is just so that we match current spu_ovl.o
with .shstrtab moved.
* emultempl/spu_ovl.o_c: Regenerate.
GDB Administrator [Sat, 15 Oct 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in
Pedro Alves [Fri, 14 Oct 2016 16:03:16 +0000 (17:03 +0100)]
FINAL/OVERRIDE: Define to empty on g++ < 4.7
final/override were only implemented in g++ 4.7.
include/ChangeLog
2016-10-14 Pedro Alves <palves@redhat.com>
* ansidecl.h [__cplusplus >= 201103 && GCC_VERSION < 4007] (FINAL,
OVERRIDE): Define as empty.
[__cplusplus < 201103 && GCC_VERSION < 4007] (FINAL): Define as
__final.
[__cplusplus < 201103 && GCC_VERSION >= 4007] (OVERRIDE): Define as
empty.
Pedro Alves [Fri, 14 Oct 2016 16:03:16 +0000 (17:03 +0100)]
Move OVERRIDE/FINAL from gcc/coretypes.h to include/ansidecl.h
So that GDB and other projects that share the top level can use them.
Bootstrapped with all default languages + jit on x86-64 Fedora 23.
gcc/ChangeLog:
2016-10-14 Pedro Alves <palves@redhat.com>
* coretypes.h (OVERRIDE, FINAL): Delete, moved to
include/ansidecl.h.
include/ChangeLog:
2016-10-14 Pedro Alves <palves@redhat.com>
* ansidecl.h (GCC_FINAL): Delete.
(OVERRIDE, FINAL): New, moved from gcc/coretypes.h.
Simon Marchi [Fri, 14 Oct 2016 15:39:17 +0000 (11:39 -0400)]
Fix typos in trace commands doc
gdb/doc/ChangeLog:
* gdb.texinfo (Using Trace Files): Fix typo.
(GDB/MI Tracepoint Commands): Likewise.
Simon Marchi [Fri, 14 Oct 2016 15:39:16 +0000 (11:39 -0400)]
Document -ctf switch of -trace-save
The -trace-save MI command supports saving the trace in the CTF format,
as its CLI counterpart, but it's not documented.
gdb/doc/ChangeLog:
* gdb.texinfo (GDB/MI Tracepoint Commands): Document -ctf switch
of -trace-save.
Luis Machado [Fri, 14 Oct 2016 14:04:46 +0000 (09:04 -0500)]
Fix leftover remote test failures from PR binutils/19020
As pointed out in PR binutils/19020, those tests were still failing when doing
remote testing. This is because the binary files weren't being copied over to
the remote host for testing.
FAIL: binutils-all/pr19020a
FAIL: binutils-all/pr19020b
This small patch fixes this up to make things pass.
binutils/ChangeLog:
2016-10-14 Luis Machado <lgustavo@codesourcery.com>
* testsuite/lib/utils-lib.exp (run_dump_test): Call remote_download
to copy file to remote host.
Ulrich Weigand [Fri, 14 Oct 2016 13:04:04 +0000 (15:04 +0200)]
Fix set sysroot command on AIX
set sysroot command on AIX has no effect if a program depends on shared
library archives (.a). Fixed by using solib_find and solib_bfd_fopen
instead of gdb_bfd_open in solib_aix_bfd_open.
gdb/
2016-10-14 Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
Ulrich Weigand <uweigand@de.ibm.com>
* solib-aix.c (solib_aix_bfd_open): Call solib_find so that sysroot
path is set properly if program has a dependency on .a archive and
sysroot is set via set sysroot command.
Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Alan Modra [Fri, 14 Oct 2016 10:47:54 +0000 (21:17 +1030)]
Add separate debug info file section
* scripttempl/DWARF.sc: Add .debug_addr.
Claudiu Zissulescu [Thu, 13 Oct 2016 13:01:19 +0000 (15:01 +0200)]
[ARC] Disassembler: fix LIMM detection for short instructions.
The ARC (short) instructions are using a special register number to
indicate is the instruction uses a long immediate (LIMM). In the case
of short instruction, this LIMM indicator depends on the ISA version
used. Thus, for ARCv1 processors, the LIMM indicator is 0x3E, the same
value used in "long" instructions. However, for the ARCv2 processors,
this LIMM indicator is 0x1E.
This patch fixes the LIMM detection for ARCv1 ISA and adds two tests.
gas/
2016-10-13 Claudiu Zissulescu <claziss@synopsys.com>
* testsuite/gas/arc/shortlimm_a7.d: New file.
* testsuite/gas/arc/shortlimm_a7.s: Likewise.
* testsuite/gas/arc/shortlimm_hs.d: Likewise.
* testsuite/gas/arc/shortlimm_hs.s: Likewise.
include/
2016-10-13 Claudiu Zissulescu <claziss@synopsys.com>
* opcode/arc.h (ARC_OPCODE_ARCV2): New define.
opcodes/
2016-10-13 Claudiu Zissulescu <claziss@synopsys.com>
* arc-dis.c (find_format_from_table): Discriminate LIMM indicator
usage on ISA basis.
Markus Metzger [Thu, 13 Oct 2016 14:09:41 +0000 (16:09 +0200)]
btrace: remove leftover comment
Remove a leftover comment on a function that was removed with commit
0568462bbf0f666d5bf9f720e16147da71eec46a.
Eli Zaretskii [Fri, 14 Oct 2016 07:08:25 +0000 (10:08 +0300)]
Include strings.h where available
gdb/ChangeLog
2016-10-14 Eli Zaretskii <eliz@gnu.org>
* common/common-defs.h [HAVE_STRINGS_H]: Include strings.h if
available, to get prototypes of 'strcasecmp' and 'strncasecmp'.
GDB Administrator [Fri, 14 Oct 2016 00:00:22 +0000 (00:00 +0000)]
Automatic date update in version.in
Pedro Alves [Thu, 13 Oct 2016 16:59:26 +0000 (17:59 +0100)]
ARI: Remove true/false checks
These don't make sense with C++.
gdb/ChangeLog:
2016-10-13 Pedro Alves <palves@redhat.com>
* contrib/ari/gdb_ari.sh (boolean): Suggest bool instead.
(false, true): Remove checks.
Yao Qi [Thu, 13 Oct 2016 15:08:17 +0000 (16:08 +0100)]
Share proc get_var_address
This patch moves proc get_var_address into lib/gdb.exp, and remove the
duplicate copy in gdb.base/*.exp files.
gdb/testsuite:
2016-10-13 Yao Qi <yao.qi@linaro.org>
* gdb.base/code_elim.exp (get_var_address): Remove.
* gdb.base/relocate.exp: Likewise.
* gdb.base/shreloc.exp: Likewise.
* lib/gdb.exp (get_var_address): New.
Yao Qi [Thu, 13 Oct 2016 10:10:25 +0000 (11:10 +0100)]
Skip testing structures with floating points
This patch skips some tests related to floating point in structs.exp
if gdb_skip_float_test return false.
gdb/testsuite:
2016-10-13 Yao Qi <yao.qi@linaro.org>
* gdb.base/structs.exp: Invoke gdb_skip_float_test, and do
floating point tests if $skip_float_test is false.
Tom Tromey [Sun, 25 Sep 2016 03:28:52 +0000 (21:28 -0600)]
Use std::string in macho_symfile_read_all_oso
This changes macho_symfile_read_all_oso to use std::string. This
avoids a cleanup.
2016-10-12 Tom Tromey <tom@tromey.com>
* machoread.c (macho_symfile_read_all_oso): Use std::string.
Tom Tromey [Sun, 25 Sep 2016 03:14:14 +0000 (21:14 -0600)]
Remove unnecessary null_cleanup
This patch removes an unnecessary null_cleanup.
2016-10-12 Tom Tromey <tom@tromey.com>
* tracepoint.c (trace_dump_command): Remove unnecessary
null_cleanup.
Tom Tromey [Fri, 23 Sep 2016 03:16:53 +0000 (21:16 -0600)]
Turn wchar iterator into a class
This changes wchar_iterator from charset.c into a real C++ class, then
updates the users to use the class. This lets us remove some cleanups
in favor of the class' destructor.
2016-10-12 Tom Tromey <tom@tromey.com>
* valprint.c (generic_emit_char, count_next_character)
(generic_printstr): Update.
* charset.c (struct wchar_iterator): Move to charset.h.
(wchar_iterator::wchar_iterator): Rename from
make_wchar_iterator, turn into a constructor.
(wchar_iterator::~wchar_iterator): Rename from
do_cleanup_iterator, turn into a destructor.
(make_cleanup_wchar_iterator): Remove.
(wchar_iterator::iterate): Rename from wchar_iterate. Remove
"iter" argument. Update.
* charset.h: Include <vector>.
(class wchar_iterator): New class, from old struct
wchar_iterator.
(make_wchar_iterator, make_cleanup_wchar_iterator): Don't
declare.
Tom Tromey [Fri, 23 Sep 2016 03:32:03 +0000 (21:32 -0600)]
Change selttest.c to use use std::vector
This patch changes selftest.c to use std::vector rather than VEC.
I think this is a small net plus.
2016-10-12 Tom Tromey <tom@tromey.com>
* selftest.c: Include <vector>, not "vec.h".
(self_test_function_ptr): Remove.
(tests): Now a std::vector.
(register_self_test, run_self_tests): Update.
Pedro Alves [Thu, 13 Oct 2016 00:54:07 +0000 (01:54 +0100)]
Convert tid_range_parser and get_number_or_range to classes
This converts tid_range_parser and get_number_or_range to be classes.
The various tid_range_parser_* and get_number_or_range_* functions
become methods on the respective classes. Then it updates the users
to follow.
The rationale for the change is that this provides better
encapsulation. For example, this forced me to think of a better
interface between tid_range_parser and get_number_or_range, since the
former peeked into the latter's internals a bit too much. That ended
up resulting mostly in these two not-just-straight-1-1 changes:
void
-tid_range_parser_skip (struct tid_range_parser *parser)
+tid_range_parser::skip_range ()
{
...
- tid_range_parser_init (parser, parser->range_parser.end_ptr,
- parser->default_inferior);
+ m_range_parser.skip_range ();
+ init (m_range_parser.string (), m_default_inferior);
}
and:
/* If we successfully parsed a thread number or finished parsing a
thread range, switch back to assuming the next TID is
inferior-qualified. */
- if (parser->range_parser.end_ptr == NULL
- || parser->range_parser.string == parser->range_parser.end_ptr)
+ if (!m_range_parser.in_range ())
{
For the same reason (encapsulation), this moves the enum
tid_range_state definition to within the tid_parser class's scope,
since that is private implementation detail.
While at it, switch to use "bool" for booleans.
gdb/ChangeLog:
2016-10-13 Pedro Alves <palves@redhat.com>
Tom Tromey <tom@tromey.com>
* tid-parse.h (tid_range_parser): New class.
(enum tid_range_state): Move into tid_range_parser's scope.
Remove TID_RANGE_ prefix from all values.
(tid_range_parser_get_tid, tid_range_parser_get_tid_range)
(tid_range_parser_star_range, tid_range_parser_finished)
(tid_range_parser_skip, tid_range_parser_qualified): Don't
declare.
(tid_is_in_list): Update comment.
* tid-parse.c (tid_range_parser::tid_range_parser): New.
(init, finished, get_string, skip, tid_is_qualified)
(get_tid_or_range, get_tid_range, get_tid, star_range): Rename;
turn into methods.
(tid_is_in_list): Adjust.
* cli/cli-utils.h (number_or_range_parser): New class.
(init_number_or_range, get_number_or_range)
(number_range_setup_range): Don't declare.
* cli/cli-utils.c
(number_or_range_parser::number_or_range_parser): New.
(init_number_or_range, get_number_or_range)
(number_range_setup_range): Rename; turn into methods.
(number_is_in_list): Adjust.
* breakpoint.c (map_breakpoint_numbers): Adjust. Use bool.
(trace_pass_command, get_tracepoint_by_number): Adjust.
* breakpoint.h (get_tracepoint_by_number): Adjust.
* inferior.c (detach_inferior_command, kill_inferior_command)
(remove_inferior_command): Adjust.
* linespec.c (decode_line_2): Adjust.
* memattr.c (mem_enable_command, mem_disable_command)
(mem_delete_command): Adjust.
* printcmd.c (map_display_numbers): Adjust.
* reverse.c (delete_bookmark_command, bookmarks_info): Adjust.
* thread.c (thread_apply_command): Adjust.
GDB Administrator [Thu, 13 Oct 2016 00:00:20 +0000 (00:00 +0000)]
Automatic date update in version.in
Luis Machado [Wed, 12 Oct 2016 15:10:03 +0000 (10:10 -0500)]
Fixup gdb.python/py-value.exp for bare-metal aarch64-elf
I noticed that testing aarch64-elf gdb with a physical board
ran into issues with gdb.python/py-value.exp. Further investigation showed
that we were actually trying to dereference a NULL pointer (argv) when trying
to access argv[0].
Being bare-metal, argv is not guaranteed to be valid. So we need to make sure
argv is sane before accessing argv[0].
The following patch fixes up the test program to check for a NULL argv and also
improves the testcase a bit so it doesn't have to work with a hardcoded argc
value.
Regression-tested on x86-64 Ubuntu 16.04.
gdb/testsuite/ChangeLog:
2016-10-12 Luis Machado <lgustavo@codesourcery.com>
* gdb.python/py-value.c (main): Check if argv is NULL before using it.
* gdb.python/py-value.exp (test_value_in_inferior): Don't use hardcoded
argc values.
Add 1 to argc so we guarantee distinct initial/modified argc values.
Anton Kolesov [Wed, 12 Oct 2016 11:36:44 +0000 (14:36 +0300)]
arc: Add support for Newlib
Add support for Newlib as an OS/ABI. The only thing that is specific to it
relatively to "generic" baremetal target is location of PC register in jump
buffer for longjump support.
Sniffer uses .ivt section to decide if ELF file is for ARC Newlib or not.
gdb/ChangeLog:
* arc-newlib-tdep.c: New file.
* configure.tgt: Add newlib support for ARC.
Anton Kolesov [Wed, 12 Oct 2016 11:36:44 +0000 (14:36 +0300)]
arc: Add evaluation of long jump targets
Standard get_longjmp_target implementation, similar to what is in arm-tdep.c.
Actual value of jb_pc should be set in init_osabi methods of particular OS/ABI
implementations.
gdb/ChangeLog:
* arc-tdep.h (struct gdbarch_tdep) <jb_pc>: New field.
* arc-tdep.c (arc_get_longjmp_target): New function.
(arc_gdbarch_init): Set get_longjmp_target if jb_pc is non-negative.
(arc_dump_tdep): Print jb_pc.
Anton Kolesov [Wed, 12 Oct 2016 11:36:44 +0000 (14:36 +0300)]
arc: Add a gdbarch_tdep structure
Add target-specific structure gdbarch_tdep for ARC.
gdb/ChangeLog:
* arc-tdep.h (struct gdbarch_tdep): New.
* arc-tdep.c (arc_gdbarch_init): Allocate gdbarch_tdep.
Yao Qi [Tue, 11 Oct 2016 11:12:46 +0000 (12:12 +0100)]
[AArch64] Track FP registers in prologue analyzer
We don't track FP registers in aarch64 prologue analyzer, so this causes
an internal error when FP registers are saved by "stp" instruction in
prologue (stp d8, d9, [sp,#128]),
tbreak _Unwind_RaiseException^M
aarch64-tdep.c:335: internal-error: CORE_ADDR aarch64_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, aarch64_prologue_cache*): Assertion `inst.operands[0].type == AARCH64_OPND_Rt' failed.^M
A problem internal to GDB has been detected,
This patch teaches GDB to track FP registers (D registers) in prologue
analyzer.
gdb:
2016-10-12 Yao Qi <yao.qi@linaro.org>
PR tdep/20682
* aarch64-tdep.c: Replace 32 with AARCH64_D_REGISTER_COUNT.
(aarch64_analyze_prologue): Extend array 'regs' for D registers.
Assert that operand 0 and 1 can be X or D registers. Update
register number for D registers. Update registers in frame
cache.
* aarch64-tdep.h (AARCH64_D_REGISTER_COUNT): New macro.
GDB Administrator [Wed, 12 Oct 2016 00:00:19 +0000 (00:00 +0000)]
Automatic date update in version.in
Alan Modra [Tue, 11 Oct 2016 23:22:53 +0000 (09:52 +1030)]
missing changelog entry
Alan Modra [Tue, 11 Oct 2016 23:11:33 +0000 (09:41 +1030)]
BFD_FAKE_SECTION macro params
Order NAME, IDX, FLAGS as per STD_SECTION macro.
* section.c (BFD_FAKE_SECTION): Reorder parameters. Formatting.
(STD_SECTION): Adjust to suit.
* elf.c (_bfd_elf_large_com_section): Likewise.
* bfd-in2.h: Regenerate.
Alan Modra [Tue, 11 Oct 2016 23:01:24 +0000 (09:31 +1030)]
Update more tests for objdump change
* testsuite/ld-i386/pr19636-1d-nacl.d: Adjust for objdump change.
* testsuite/ld-i386/pr19636-2c-nacl.d: Likewise.
* testsuite/ld-tic6x/shlib-1r.dd: Likewise.
* testsuite/ld-x86-64/plt-nacl.pd: Likewise.
* testsuite/ld-x86-64/pr19636-2d-nacl.d: Likewise.
Jan Kratochvil [Tue, 11 Oct 2016 17:09:05 +0000 (19:09 +0200)]
testsuite: Fix gdb.arch/powerpc-prologue.c compilation
gcc-6.2.1
gdb compile failed, gdb/testsuite/gdb.arch/powerpc-prologue.c: In function 'main':
gdb/testsuite/gdb.arch/powerpc-prologue.c:32:3: warning: implicit declaration of function 'optimized_1' [-Wimplicit-function-declaration]
optimized_1 ();
^~~~~~~~~~~
gdb/testsuite/ChangeLog
2016-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/powerpc-prologue.c (optimized_1): New declaration.
Jan Kratochvil [Tue, 11 Oct 2016 14:43:58 +0000 (16:43 +0200)]
testsuite: Use standard_output_file
gdb/testsuite/ChangeLog
2016-10-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/powerpc-prologue.exp: Use standard_output_file.
* gdb.arch/ppc64-symtab-cordic.exp: Likewise.
* gdb.arch/vsx-regs.exp: Likewise.
Nick Clifton [Tue, 11 Oct 2016 12:50:10 +0000 (13:50 +0100)]
Enhance objdump so that it will use .got, .plt and .plt.got section symbols when disassembling, and it will use dynamic relocs to interpret entries in the PLT and GOT.
binutils * objdump.c (is_significant_symbol_name): New function.
(remove_useless_symbols): Do not remove significanr symbols.
(find_symbol_for_address): If an exact match for the specified
address has not been found, try scanning the dynamic relocs to see
if one of these matches the address. If so, use the symbol
associated with the reloc.
(objdump_print_addr_with_symbol): Do not print offsets to symbols
with no value.
(disassemble_section): Only use dynamic relocs if the user
requested this.
(disassemble_data): Always load dynamic relocs if they are
available.
ld * ld-aarch64/emit-relocs-515-be.d: Adjust output to match change
in objdump.
* ld-aarch64/emit-relocs-515.d: Likewise.
* ld-aarch64/emit-relocs-516-be.d: Likewise.
* ld-aarch64/emit-relocs-516.d: Likewise.
* ld-aarch64/farcall-b-plt.d: Likewise.
* ld-aarch64/farcall-bl-plt.d: Likewise.
* ld-aarch64/gc-plt-relocs.d: Likewise.
* ld-aarch64/tls-desc-ie.d: Likewise.
* ld-aarch64/tls-tiny-desc.d: Likewise.
* ld-aarch64/tls-tiny-gd.d: Likewise.
* ld-aarch64/tls-tiny-ie.d: Likewise.
* ld-arm/arm-app-abs32.d: Likewise.
* ld-arm/arm-app.d: Likewise.
* ld-arm/arm-lib-plt32.d: Likewise.
* ld-arm/arm-lib.d: Likewise.
* ld-arm/armthumb-lib.d: Likewise.
* ld-arm/cortex-a8-fix-b-plt.d: Likewise.
* ld-arm/cortex-a8-fix-bcc-plt.d: Likewise.
* ld-arm/cortex-a8-fix-bl-plt.d: Likewise.
* ld-arm/cortex-a8-fix-bl-rel-plt.d: Likewise.
* ld-arm/cortex-a8-fix-blx-plt.d: Likewise.
* ld-arm/farcall-mixed-app-v5.d: Likewise.
* ld-arm/farcall-mixed-app.d: Likewise.
* ld-arm/farcall-mixed-app2.d: Likewise.
* ld-arm/farcall-mixed-lib-v4t.d: Likewise.
* ld-arm/farcall-mixed-lib.d: Likewise.
* ld-arm/ifunc-10.dd: Likewise.
* ld-arm/ifunc-14.dd: Likewise.
* ld-arm/ifunc-15.dd: Likewise.
* ld-arm/ifunc-3.dd: Likewise.
* ld-arm/ifunc-4.dd: Likewise.
* ld-arm/ifunc-9.dd: Likewise.
* ld-arm/long-plt-format.d: Likewise.
* ld-arm/mixed-app-v5.d: Likewise.
* ld-arm/mixed-app.d: Likewise.
* ld-arm/mixed-lib.d: Likewise.
* ld-arm/tls-lib-loc.d: Likewise.
* ld-cris/dso-pltdis1.d: Likewise.
* ld-cris/dso-pltdis2.d: Likewise.
* ld-cris/dso12-pltdis.d: Likewise.
* ld-elf/symbolic-func.r: Likewise.
* ld-frv/fdpic-pie-1.d: Likewise.
* ld-frv/fdpic-pie-2.d: Likewise.
* ld-frv/fdpic-pie-6.d: Likewise.
* ld-frv/fdpic-pie-7.d: Likewise.
* ld-frv/fdpic-pie-8.d: Likewise.
* ld-frv/fdpic-shared-1.d: Likewise.
* ld-frv/fdpic-shared-2.d: Likewise.
* ld-frv/fdpic-shared-3.d: Likewise.
* ld-frv/fdpic-shared-4.d: Likewise.
* ld-frv/fdpic-shared-5.d: Likewise.
* ld-frv/fdpic-shared-6.d: Likewise.
* ld-frv/fdpic-shared-7.d: Likewise.
* ld-frv/fdpic-shared-8.d: Likewise.
* ld-frv/fdpic-shared-local-2.d: Likewise.
* ld-frv/fdpic-shared-local-8.d: Likewise.
* ld-frv/fdpic-static-1.d: Likewise.
* ld-frv/fdpic-static-2.d: Likewise.
* ld-frv/fdpic-static-6.d: Likewise.
* ld-frv/fdpic-static-7.d: Likewise.
* ld-frv/fdpic-static-8.d: Likewise.
* ld-frv/tls-dynamic-2.d: Likewise.
* ld-frv/tls-initial-shared-2.d: Likewise.
* ld-frv/tls-relax-shared-2.d: Likewise.
* ld-frv/tls-shared-2.d: Likewise.
* ld-i386/plt-nacl.pd: Likewise.
* ld-i386/plt-pic-nacl.pd: Likewise.
* ld-i386/plt-pic.pd: Likewise.
* ld-i386/plt.pd: Likewise.
* ld-i386/pr19636-1d-nacl.d: Likewise.
* ld-i386/pr19636-1d.d: Likewise.
* ld-i386/pr19636-2c-nacl.d: Likewise.
* ld-i386/pr19636-2c.d: Likewise.
* ld-ifunc/ifunc-21-x86-64.d: Likewise.
* ld-ifunc/ifunc-22-x86-64.d: Likewise.
* ld-ifunc/pr17154-i386.d: Likewise.
* ld-ifunc/pr17154-x86-64.d: Likewise.
* ld-m68k/plt1-68020.d: Likewise.
* ld-m68k/plt1-cpu32.d: Likewise.
* ld-m68k/plt1-isab.d: Likewise.
* ld-m68k/plt1-isac.d: Likewise.
* ld-metag/shared.d: Likewise.
* ld-metag/stub_pic_app.d: Likewise.
* ld-metag/stub_pic_shared.d: Likewise.
* ld-metag/stub_shared.d: Likewise.
* ld-s390/tlsbin_64.dd: Likewise.
* ld-s390/tlspic_64.dd: Likewise.
* ld-tic6x/shlib-1.dd: Likewise.
* ld-tic6x/shlib-1b.dd: Likewise.
* ld-tic6x/shlib-1rb.dd: Likewise.
* ld-tic6x/shlib-app-1.dd: Likewise.
* ld-tic6x/shlib-app-1b.dd: Likewise.
* ld-tic6x/shlib-app-1r.dd: Likewise.
* ld-tic6x/shlib-app-1rb.dd: Likewise.
* ld-tic6x/shlib-noindex.dd: Likewise.
* ld-vax-elf/export-class-data.dd: Likewise.
* ld-vax-elf/plt-local-lib.dd: Likewise.
* ld-vax-elf/plt-local.dd: Likewise.
* ld-x86-64/bnd-ifunc-2.d: Likewise.
* ld-x86-64/bnd-plt-1.d: Likewise.
* ld-x86-64/gotpcrel1.dd: Likewise.
* ld-x86-64/libno-plt-1b.dd: Likewise.
* ld-x86-64/load1c-nacl.d: Likewise.
* ld-x86-64/load1c.d: Likewise.
* ld-x86-64/load1d-nacl.d: Likewise.
* ld-x86-64/load1d.d: Likewise.
* ld-x86-64/mov1a.d: Likewise.
* ld-x86-64/mov1b.d: Likewise.
* ld-x86-64/mov1c.d: Likewise.
* ld-x86-64/mov1d.d: Likewise.
* ld-x86-64/mov2a.d: Likewise.
* ld-x86-64/mov2b.d: Likewise.
* ld-x86-64/mov2c.d: Likewise.
* ld-x86-64/mov2d.d: Likewise.
* ld-x86-64/mpx3.dd: Likewise.
* ld-x86-64/mpx4.dd: Likewise.
* ld-x86-64/no-plt-1a.dd: Likewise.
* ld-x86-64/no-plt-1b.dd: Likewise.
* ld-x86-64/no-plt-1c.dd: Likewise.
* ld-x86-64/no-plt-1e.dd: Likewise.
* ld-x86-64/no-plt-1f.dd: Likewise.
* ld-x86-64/no-plt-1g.dd: Likewise.
* ld-x86-64/plt-main-bnd.dd: Likewise.
* ld-x86-64/plt-nacl.pd: Likewise.
* ld-x86-64/plt.pd: Likewise.
* ld-x86-64/pr18591.d: Likewise.
* ld-x86-64/pr19609-1c.d: Likewise.
* ld-x86-64/pr19609-1e.d: Likewise.
* ld-x86-64/pr19609-1j.d: Likewise.
* ld-x86-64/pr19609-1l.d: Likewise.
* ld-x86-64/pr19609-1m.d: Likewise.
* ld-x86-64/pr19609-5b.d: Likewise.
* ld-x86-64/pr19609-5c.d: Likewise.
* ld-x86-64/pr19609-5e.d: Likewise.
* ld-x86-64/pr19609-6b.d: Likewise.
* ld-x86-64/pr19609-7b.d: Likewise.
* ld-x86-64/pr19609-7d.d: Likewise.
* ld-x86-64/pr19636-2d.d: Likewise.
* ld-x86-64/pr20093-1.d: Likewise.
* ld-x86-64/pr20093-2.d: Likewise.
* ld-x86-64/pr20253-1b.d: Likewise.
* ld-x86-64/pr20253-1d.d: Likewise.
* ld-x86-64/pr20253-1f.d: Likewise.
* ld-x86-64/pr20253-1h.d: Likewise.
* ld-x86-64/pr20253-1j.d: Likewise.
* ld-x86-64/pr20253-1l.d: Likewise.
* ld-x86-64/protected3.d: Likewise.
* ld-x86-64/tlsbin.dd: Likewise.
* ld-x86-64/tlsbin2.dd: Likewise.
* ld-x86-64/tlsbindesc.dd: Likewise.
* ld-x86-64/tlsdesc-nacl.pd: Likewise.
* ld-x86-64/tlsdesc.dd: Likewise.
* ld-x86-64/tlsdesc.pd: Likewise.
* ld-x86-64/tlsgd10.dd: Likewise.
* ld-x86-64/tlsgd5.dd: Likewise.
* ld-x86-64/tlsgd6.dd: Likewise.
* ld-x86-64/tlsgd8.dd: Likewise.
* ld-x86-64/tlsgdesc.dd: Likewise.
* ld-x86-64/tlspic.dd: Likewise.
* ld-x86-64/tlspic2.dd: Likewise.
2016-10-11 Nick Clifton <nickc@redhat.com>
PR ld/20535
* emultempl/elf32.em (_search_needed): Add support for pseudo
environment variables supported by ld.so. Namely $ORIGIN, $LIB
and $PLATFORM.
* configure.ac: Add getauxval to list AC_CHECK_FUNCS list.
* config.in: Regenerate.
* configure: Regenerate.
2016-10-11 Alan Modra <amodra@gmail.com>
* ldlang.c (lang_do_assignments_1): Descend into output section
statements that do not yet have bfd sections. Set symbol section
temporarily for symbols defined in such statements to the undefined
section. Don't error on data or reloc statements until final phase.
* ldexp.c (exp_fold_tree_1 <etree_assign>): Handle bfd_und_section
in expld.section.
* testsuite/ld-mmix/bpo-10.d: Adjust.
* testsuite/ld-mmix/bpo-11.d: Adjust.
2016-10-10 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* emulparams/elf64_s390.sh: Move binary start to 16M.
* testsuite/ld-s390/tlsbin_64.dd: Adjust testcases accordingly.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.
2016-10-07 Alan Modra <amodra@gmail.com>
* ldexp.c (MAX): Define.
(exp_unop, exp_binop, exp_trinop): Alloc at least enough for
etree_type.value.
2016-10-07 Alan Modra <amodra@gmail.com>
* testsuite/lib/ld-lib.exp (is_generic_elf): New, extracted from..
* testsuite/ld-elf/elf.exp: ..here.
2016-10-06 Ludovic Court?s <ludo@gnu.org>
* emulparams/elf32bmipn32-defs.sh: Shift quote of
"x$EMULATION_NAME" to the left to work around
<http://ftp.gnu.org/gnu/bash/bash-4.2-patches/bash42-007>.
2016-10-06 Alan Modra <amodra@gmail.com>
* lexsup.c: Spell fall through comments consistently and add
missing fall through comments.
2016-10-06 Alan Modra <amodra@gmail.com>
* plugin.c (asymbol_from_plugin_symbol): Avoid compiler warning
by adding return.
2016-10-04 Alan Modra <amodra@gmail.com>
* ld.texinfo (Expression Section): Update result of arithmetic
expressions.
* ldexp.c (arith_result_section): New function.
(fold_binary): Use it.
2016-10-04 Alan Modra <amodra@gmail.com>
* ldexp.c (exp_value_fold): New function.
(exp_unop, exp_binop, exp_trinop): Use it.
2016-09-30 Alan Modra <amodra@gmail.com>
* scripttempl/v850.sc: Don't reference __ctbp, __ep, __gp when
not relocating.
* scripttempl/v850_rh850.sc: Likewise.
2016-09-30 Alan Modra <amodra@gmail.com>
PR ld/20528
* testsuite/ld-elf/pr20528a.d: xfail generic elf targets. Allow
multiple .text sections for hppa-linux.
* testsuite/ld-elf/pr20528b.d: Likewise.
2016-09-30 Alan Modra <amodra@gmail.com>
* ldmain.c (default_bfd_error_handler): New function pointer.
(ld_bfd_error_handler): New function.
(main): Arrange to call it on bfd errors/warnings.
(ld_bfd_assert_handler): Enable tail call.
2016-09-30 Alan Modra <amodra@gmail.com>
* ldlang.c (ignore_bfd_errors): Update params.
2016-09-29 H.J. Lu <hongjiu.lu@intel.com>
PR ld/20528
* emultempl/elf32.em (gld${EMULATION_NAME}_place_orphan): Don't
merge 2 sections with different SHF_EXCLUDE.
* testsuite/ld-elf/pr20528a.d: New file.
* testsuite/ld-elf/pr20528a.s: Likewise.
* testsuite/ld-elf/pr20528b.d: Likewise.
* testsuite/ld-elf/pr20528b.s: Likewise.
2016-09-28 Christophe Lyon <christophe.lyon@linaro.org>
PR ld/20608
* testsuite/ld-arm/arm-elf.exp: Handle new testcase.
* testsuite/ld-arm/farcall-mixed-app2.d: New file.
* testsuite/ld-arm/farcall-mixed-app2.r: Likewise.
* testsuite/ld-arm/farcall-mixed-app2.s: Likewise.
* testsuite/ld-arm/farcall-mixed-app2.sym: Likewise.
2016-09-26 Vlad Zakharov <vzakhar@synopsys.com>
* Makefile.in: Regenerate.
* configure: Likewise.
2016-09-26 Alan Modra <amodra@gmail.com>
* testsuite/ld-powerpc/attr-gnu-4-4.s: Delete.
* testsuite/ld-powerpc/attr-gnu-4-14.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-24.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-34.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-41.d: Delete.
* testsuite/ld-powerpc/attr-gnu-4-32.d: Adjust expected warning.
* testsuite/ld-powerpc/attr-gnu-8-23.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-01.d: Adjust expected output.
* testsuite/ld-powerpc/attr-gnu-4-02.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-03.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-10.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-11.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-20.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-22.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-4-33.d: Likewise.
* testsuite/ld-powerpc/attr-gnu-8-11.d: Likewise.
* testsuite/ld-powerpc/powerpc.exp: Don't run deleted tests.
2016-09-23 Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
PR ld/20595
* testsuite/ld-arm/unwind-4.d: Add -q option to linker command
line and -r option to objdump command line. Match emitted relocs
to make sure that superflous relocs are not generated.
2016-09-23 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* emulparams/elf64_s390.sh: Change TEXT_START_ADDR to 256MB.
* testsuite/ld-s390/tlsbin_64.dd: Adjust testcase accordingly.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.
2016-09-22 Nick Clifton <nickc@redhat.com>
* emultempl/elf32.em (_try_needed): In verbose mode, report failed
attempts to find a needed library.
2016-09-21 Richard Sandiford <richard.sandiford@arm.com>
* testsuite/ld-aarch64/emit-relocs-28.d: Expect spaces after ","
in addresses.
* testsuite/ld-aarch64/emit-relocs-301-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-301.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-302-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-302.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-310-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-310.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-313.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-515-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-515.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-516-be.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-516.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-531.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-532.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-533.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-534.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-535.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-536.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-537.d: Likewise.
* testsuite/ld-aarch64/emit-relocs-538.d: Likewise.
* testsuite/ld-aarch64/erratum835769.d: Likewise.
* testsuite/ld-aarch64/erratum843419.d: Likewise.
* testsuite/ld-aarch64/farcall-b-plt.d: Likewise.
* testsuite/ld-aarch64/farcall-bl-plt.d: Likewise.
* testsuite/ld-aarch64/gc-plt-relocs.d: Likewise.
* testsuite/ld-aarch64/ifunc-21.d: Likewise.
* testsuite/ld-aarch64/ifunc-7c.d: Likewise.
* testsuite/ld-aarch64/tls-desc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-large-desc-be.d: Likewise.
* testsuite/ld-aarch64/tls-large-desc.d: Likewise.
* testsuite/ld-aarch64/tls-large-ie-be.d: Likewise.
* testsuite/ld-aarch64/tls-large-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-all.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gd-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gdesc-ie-2.d: Likewise.
* testsuite/ld-aarch64/tls-relax-gdesc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-relax-large-desc-ie-be.d: Likewise.
* testsuite/ld-aarch64/tls-relax-large-desc-ie.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-desc.d: Likewise.
* testsuite/ld-aarch64/tls-tiny-gd.d: Likewise.
gas * gas/arm/tls.d: Adjust output to match change in objdump.
Nick Clifton [Tue, 11 Oct 2016 11:04:42 +0000 (12:04 +0100)]
Add support to the static linker for the tokens accepted by the dynamic linker when resolving search paths.
PR ld/20535
* emultempl/elf32.em (_search_needed): Add support for pseudo
environment variables supported by ld.so. Namely $ORIGIN, $LIB
and $PLATFORM.
* configure.ac: Add getauxval to list AC_CHECK_FUNCS list.
* config.in: Regenerate.
* configure: Regenerate.
Jiong Wang [Tue, 11 Oct 2016 10:24:44 +0000 (11:24 +0100)]
[AArch64] PR target/20666, fix wrong encoding of new introduced BFC pseudo
opcode/
PR target/20666
* aarch64-asm.c (convert_bfc_to_bfm): Fix dest index.
gas/
* testsuite/gas/aarch64/alias-2.d: Update expected results.
Alan Modra [Tue, 11 Oct 2016 07:43:04 +0000 (18:13 +1030)]
Always descend into output section statements in lang_do_assignments
See https://sourceware.org/ml/binutils/2016-07/msg00091.html
This patch stop --gc-sections elf_gc_sweep_symbol localizing symbols
that ought to remain global.
The difficulty with always descending into output section statements
is that symbols defined by the script in such statements don't have
a bfd section when lang_do_assignments runs early in the link process.
There are two approaches to curing this problem. Either we can
create the bfd section early, or we can use a special section. This
patch takes the latter approach and uses bfd_und_section. (Creating
bfd sections early results in changed output section order, and thus
lots of testsuite failures. You can't create all output sections
early to ensure proper ordering as KEEP then stops empty sections
from being stripped.)
The wrinkle with this approach is that some code that runs at
gc-sections time needs to be made aware of the odd defined symbols
using bfd_und_section.
bfd/
* elf64-x86-64.c (elf_x86_64_convert_load_reloc): Handle symbols
defined temporarily with bfd_und_section.
* elflink.c (_bfd_elf_gc_keep): Don't set SEC_KEEP for bfd_und_section.
* elfxx-mips.c (mips_elf_local_pic_function_p): Exclude defined
symbols with bfd_und_section.
ld/
* ldlang.c (lang_do_assignments_1): Descend into output section
statements that do not yet have bfd sections. Set symbol section
temporarily for symbols defined in such statements to the undefined
section. Don't error on data or reloc statements until final phase.
* ldexp.c (exp_fold_tree_1 <etree_assign>): Handle bfd_und_section
in expld.section.
* testsuite/ld-mmix/bpo-10.d: Adjust.
* testsuite/ld-mmix/bpo-11.d: Adjust.
GDB Administrator [Tue, 11 Oct 2016 00:00:21 +0000 (00:00 +0000)]
Automatic date update in version.in
Andreas Krebbel [Mon, 10 Oct 2016 15:09:03 +0000 (17:09 +0200)]
S/390: Move binary start to 16M.
Turned out that by moving the binary start to 256M I've hit a case with
potentially a lot of aliasing in the branch target buffer between
binaries and shared libs. So moving on.
Tested on s390x. No regressions.
ld/ChangeLog:
2016-10-10 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* emulparams/elf64_s390.sh: Move binary start to 16M.
* testsuite/ld-s390/tlsbin_64.dd: Adjust testcases accordingly.
* testsuite/ld-s390/tlsbin_64.rd: Likewise.
Maciej W. Rozycki [Mon, 10 Oct 2016 13:49:00 +0000 (14:49 +0100)]
bfd/ChangeLog: Add missing PR ld/19908 reference
Andreas Krebbel [Mon, 10 Oct 2016 12:06:35 +0000 (14:06 +0200)]
MIPS64: Adjust cfi* testcases.
The CFI* testcases fail on MIPS64 because the augmentation string does
not match the regexp. This is because MIPS64 doesn't use the default of
4 for DWARF2_FDE_RELOC_SIZE which ends up as "b" in the augmentation
string. MIPS64 uses the address size which is 8 resulting in "c".
Adding c to the regexp fixes a couple of them. Others also need
adjustments in the FDE header lines due to different
sizes/offsets.
gas/ChangeLog:
2016-10-10 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* testsuite/gas/cfi/cfi-common-1.d: Adjust regexps for mips64.
* testsuite/gas/cfi/cfi-common-2.d: Likewise.
* testsuite/gas/cfi/cfi-common-3.d: Likewise.
* testsuite/gas/cfi/cfi-common-4.d: Likewise.
* testsuite/gas/cfi/cfi-common-5.d: Likewise.
* testsuite/gas/cfi/cfi-common-7.d: Likewise.
* testsuite/gas/cfi/cfi-common-8.d: Likewise.
* testsuite/gas/cfi/cfi-common-9.d: Likewise.
* testsuite/gas/cfi/cfi-mips-1.d: Likewise.
Yao Qi [Mon, 10 Oct 2016 10:11:25 +0000 (11:11 +0100)]
Share enum arm_breakpoint_kinds
This patch shares "enum arm_breakpoint_kinds", and use ARM_BP_KIND_THUMB2
in GDB.
gdb:
2016-10-10 Yao Qi <yao.qi@linaro.org>
* arch/arm.h (enum arm_breakpoint_kinds): New.
* arm-tdep.c (arm_remote_breakpoint_from_pc): Use
ARM_BP_KIND_THUMB2.
gdb/gdbserver:
2016-10-10 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c (enum arm_breakpoint_kinds): Remove.
Yao Qi [Mon, 10 Oct 2016 09:32:46 +0000 (10:32 +0100)]
Rename 'arch' by 'gdbarch' in m32c_gdbarch_init
This patch renames local 'arch' by 'gdbarch' in m32c_gdbarch_init, so
that I can use macros in the following patch.
gdb:
2016-10-10 Yao Qi <yao.qi@linaro.org>
* m32c-tdep.c (m32c_gdbarch_init): Rename local 'arch' by
'gdbarch'.