• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


users/simark/user-selection-rfc
RSS
Rev. Tiempo Autor
44c04ee users/simark/user-selection-rfc 2017-02-24 07:25:30 Simon Marchi

Decouple user selection from internal selection

I am sending this as an RFC because it's far from complete and
definitive, but I'd like to gather some comments and opinions before
going further in this direction.

The goal of this patch is to decouple the notion of the user-selected
inferior/thread/frame from GDB's internally selected
inferior/thread/frame.

Currently, for example, the inferior_ptid variable has two jobs:

- it's the user-selected thread: it's changed by the "thread" command.
Other commands (continue, backtrace, etc) apply to this thread.
- it's the internally-selected thread: it defines the thread GDB is
currently "working" on. For example, implementations of
to_xfer_partial will refer to it to know from which thread to
read/write memory.

Because of this dual usage, if we want to do some operations on a thread
other than the currently selected one, we have to save the current
inferior/thread/frame and restore them when we're done. Failing to do
so would result in an unexpected selection switch for the user.

To improve this, Pedro suggested in [1] to decouple the two concepts. This
is essentially what this patch is trying to do.

A new "user_selection" object is introduced, which contains the selected
inferior/thread/frame from the point of view of the user. Before every
command, we "apply" this selection to the core of GDB to make sure the
internal selection matches the user selection.

There is a single user selection for the whole GDB (named "global
user-selection"), but as was mentioned in the linked thread, it opens
the door to having different selections for different UIs. This means
that each UI would have its own user-selection object, which would be
applied to the core prior to executing commands from this UI.

The global user-selection object only gets modified when we really
intend to change it. It can be because of the thread / -thread-select /
up / down / frame / inferior commands, a breakpoint hit in all-stop, an
inferior exit, etc.

The problem that initially prompted this effort is that the "--thread"
flag of MI commands changes the user-selected thread under the user's
feet. My initial attempt to fix it was to restore the selection after
the MI command execution. However, some cases are hard to get right.
For example:

(thread 1 is currently selected)
-interpreter-exec --thread 2 console "thread 3"

Restoring the selected thread to thread 1 after the MI command execution
wrongfully cancels the switch to thread 3. So it's hard to determine
when we should or shouldn't restore. With the current patch, it works
naturally: the --thread flag doesn't touch the user-selected thread,
only the internal one. The "thread 3" command updates the user
selection.

Another difficulty is to send the right notifications to MI when the
user selection changes. That means to not miss any, but not send too
many either. Getting it somewhat right lead to ugly hacks (see the
command_notifies_uscc_observer function) and even then it's not perfect
(see the kfails in user-selected-context-sync.exp test). With the
proposed method, it's easy to know when the user-selection changes and
send notifications.

With this patch, there are probably a few usage of
make_cleanup_restore_current_thread that are not needed anymore, if they
are only used to restore the user selection. I kept removing them for a
later time though.

In the current state, there are a few minor regressions in the testsuite
(especially some follow-fork stuff I'm not sure how to handle), but the
vast majority of the previously passing tests still pass.

Comments are welcome!

Thanks,

Simon

[1] https://sourceware.org/ml/gdb-patches/2016-08/msg00031.html

a567769 2017-02-24 06:58:45 Jan Kratochvil

DWARF-5: testcase

binutils/
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>

* testsuite/binutils-all/dw5.S: New file.
* testsuite/binutils-all/dw5.W: New file.
* testsuite/binutils-all/readelf.exp (readelf -wiaoRlL): New test.

2f6cd59 2017-02-24 06:58:20 Jan Kratochvil

DWARF-5: DW_FORM_data16

binutils/
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>

* dwarf.c (read_and_display_attr_value): Support DW_FORM_data16.

7a7e106 2017-02-24 06:57:52 Jan Kratochvil

DWARF-5: Macros

binutils/
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>

* dwarf.c (display_debug_macro): Support DWARF-5. Rename
DW_MACRO_GNU_*.

bc0a77d 2017-02-24 06:57:22 Jan Kratochvil

DWARF-5: call sites

binutils/
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>

* dwarf.c (decode_location_expression): Support DW_OP_implicit_pointer,
DW_OP_const_type, DW_OP_regval_type, DW_OP_deref_type, DW_OP_convert
and DW_OP_reinterpret.
(read_and_display_attr_value): Support DW_AT_call_value,
DW_AT_call_data_value, DW_AT_call_target and
DW_AT_call_target_clobbered.

7714557 2017-02-24 06:56:47 Jan Kratochvil

DWARF-5 basic functionality

binutils/
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>

* dwarf.c (fetch_indirect_line_string): New function.
(abbrev_attr): New field implicit_const.
(add_abbrev_attr): New parameter implicit_const.
(process_abbrev_section): Support DW_FORM_implicit_const.
(decode_location_expression): Support DW_OP_entry_value.
(read_and_display_attr_value): Add parameter implicit_const. Support
DW_FORM_line_strp and DW_FORM_implicit_const.
(read_and_display_attr): Add parameter implicit_const.
(process_debug_info): Support line_str and DWARF-5.
(read_debug_line_header): Support DWARF-5.
(display_formatted_table): New function.
(display_debug_lines_raw): New parameter file. Support DWARF-5.
(display_debug_lines_decoded): New parameter fileptr. Support DWARF-5.
(display_debug_lines): Pass file parameter.
(display_debug_macro): Update read_and_display_attr_value caller.
(display_debug_abbrev): Support DW_FORM_implicit_const.
(display_loclists_list): New function.
(display_loc_list): Support .debug_loclists.
(display_debug_ranges_list): New function from display_debug_ranges.
(display_debug_rnglists_list): New function.
(display_debug_ranges): Support .debug_rnglists.
(debug_displays): Add .debug_line_str, .debug_loclists and
.debug_rnglists.
* dwarf.h: Include dwarf2.h
(DWARF2_Internal_LineInfo): Add li_offset_size.
(DWARF2_Internal_CompUnit): Add cu_unit_type.
(enum dwarf_section_display_enum): Add line_str.
* readelf.c (process_section_headers): Add rnglists and loclists.

ef0b5f1 2017-02-24 06:54:00 Jan Kratochvil

DWARF attrs: add delimiter

binutils/
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>

* dwarf.c (display_block): Add parameter delimiter.
(decode_location_expression): Update display_block callers.
(read_and_display_attr_value): Add parameter delimiter.
(read_and_display_attr, display_debug_macro): Update
read_and_display_attr_value caller.

17cd494 2017-02-24 05:39:16 Luis Machado

PR21166: Validate rdrand/rdseed support separately in gdb.reverse/insn-reverse-x86.c

As reported in PR21166, there are Intel processors out there that support
rdrand but not rdseed. The fix is to verify both features separately and only
run rdrand/rdseed tests if supported.

gdb/testsuite/ChangeLog:
2017-02-23 Luis Machado <lgustavo@codesourcery.com>

* gdb.reverse/insn-reverse.x86.c (check_rdrand_support): Renamed to ...
(check_supported_features): ... this. Changed return type to void.
(supports_rdseed): New static global.
(rdseed): Check supports_rdseed.
(initialize): Call check_supported_features.

359ca07 2017-02-24 05:37:31 Jan Kratochvil

dwarf.c: Use more dwarf_vma

binutils/
2017-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>

* dwarf.c (display_loc_list): Use dwarf_vma for offset, base_address
and off.
(display_loc_list_dwo): Use dwarf_vma for offset.
(display_debug_loc): Use dwarf_vma for offset, base_address.
(struct range_entry, range_entry_compar): Use dwarf_vma for
ranges_offset.
(display_debug_ranges): Use dwarf_vma for ranges_offset, offset and
base_address.

64025b4 2017-02-24 02:27:38 Andreas Krebbel

S/390: Add support for new cpu architecture - arch12.

This adds support of new instructions to the S/390 specific parts.

The important feature of the new instruction set is the support of
single and extended precision floating point vector operations.

Note: arch12 is NOT the official name of the new CPU. It just
continues the series of archXX options supported as alternate names.
The archXX terminology refers to the edition number of the Principle
of Operations manual. The official CPU name will be added later while
keeping support of the arch12 for backwards compatibility.

No testsuite regressions.

Committed to mainline.

Bye,

-Andreas-

opcodes/ChangeLog:

2017-02-23 Andreas Krebbel <krebbel@linux.vnet.ibm.com>

* s390-mkopc.c (main): Accept arch12 as cpu string and vx2 as
facility.
* s390-opc.c: Add new operand description macros, new instruction
types, instruction masks, and new .insn instruction types.
* s390-opc.txt: Add new arch12 instructions.

include/ChangeLog:

2017-02-23 Andreas Krebbel <krebbel@linux.vnet.ibm.com>

* opcode/s390.h (enum s390_opcode_cpu_val): New value
S390_OPCODE_ARCH12.
(S390_INSTR_FLAG_VX2): New macro definition.

gas/ChangeLog:

2017-02-23 Andreas Krebbel <krebbel@linux.vnet.ibm.com>

* config/tc-s390.c (s390_parse_cpu): New entry for arch12.
* doc/as.texinfo: Document arch12 as cpu type.
* doc/c-s390.texi: Likewise.
* testsuite/gas/s390/s390.exp: Run arch12 specific tests.
* testsuite/gas/s390/zarch-arch12.d: New test.
* testsuite/gas/s390/zarch-arch12.s: New test.
* testsuite/gas/s390/zarch-z13.d: Rename some mnemonics in the
output patterns.

14bc53a 2017-02-24 01:16:06 Pedro Alves

Use gdb::function_view in iterate_over_symtabs & co

I wanted to pass a lambda to iterate_over_symtabs (see following
patch), so I converted it to function_view, and then the rest is
cascaded from that.

This gets rid of a bunch of single-use callback functions and
corresponding manually managed callback capture types
(add_partial_datum, search_symbols_data, etc.) in favor of letting the
compiler generate them for us by using lambdas with a capture. In a
couple cases, it was more natural to convert the existing function
callbacks to function objects (i.e., operator(), e.g.,
decode_compound_collector).

gdb/ChangeLog:
2017-02-23 Pedro Alves <palves@redhat.com>

* ada-lang.c: Include "common/function-view.h".
(ada_iterate_over_symbols): Adjust to use function_view as
callback type.
(struct add_partial_datum, ada_complete_symbol_matcher): Delete.
(ada_make_symbol_completion_list): Use a lambda.
(ada_exc_search_name_matches): Delete.
(name_matches_regex): New.
(ada_add_global_exceptions): Use a lambda and name_matches_regex.
* compile/compile-c-support.c: Include "common/function-view.h".
(print_one_macro): Change prototype to accept a ui_file pointer.
(write_macro_definitions): Use a lambda.
* dwarf2read.c: Include "common/function-view.h".
(dw2_map_expand_apply, dw2_map_symtabs_matching_filename)
(dw2_expand_symtabs_matching): Adjust to use function_view as
callback type.
* language.h: Include "common/function-view.h".
(struct language_defn) <la_iterate_over_symbols>: Adjust to use
function_view as callback type.
(LA_ITERATE_OVER_SYMBOLS): Remove DATA parameter.
* linespec.c: Include "common/function-view.h".
(collect_info::add_symbol): New method.
(struct symbol_and_data_callback, iterate_inline_only, struct
symbol_matcher_data, iterate_name_matcher): Delete.
(iterate_over_all_matching_symtabs): Adjust to use function_view
as callback type and lambdas.
(iterate_over_file_blocks): Adjust to use function_view as
callback type.
(decode_compound_collector): Now a class with private fields.
(decode_compound_collector::release_symbols): New method.
(collect_one_symbol): Rename to...
(decode_compound_collector::operator()): ... this and adjust.
(lookup_prefix_sym): decode_compound_collector construction bits
move to decode_compound_collector ctor. Pass the
decode_compound_collector object directly as callback. Remove
cleanups and use decode_compound_collector::release_symbols
instead.
(symtab_collector): Now a class with private fields.
(symtab_collector::release_symtabs): New method.
(add_symtabs_to_list): Rename to...
(symtab_collector::operator()): ... this and adjust.
(collect_symtabs_from_filename): symtab_collector construction
bits move to symtab_collector ctor. Pass the symtab_collector
object directly as callback. Remove cleanups and use
symtab_collector::release_symtabs instead.
(collect_symbols): Delete.
(add_matching_symbols_to_info): Use lambdas.
* macrocmd.c (print_macro_callback): Delete.
(info_macro_command): Use a lambda.
(info_macros_command): Pass print_macro_definition as callable
directly.
(print_one_macro): Remove 'ignore' parameter.
(macro_list_command): Adjust.
* macrotab.c (macro_for_each_data::fn): Now a function_view.
(macro_for_each_data::user_data): Delete field.
(foreach_macro): Adjust to call the function_view.
(macro_for_each): Adjust to use function_view as callback type.
(foreach_macro_in_scope): Adjust to call the function_view.
(macro_for_each_in_scope): Adjust to use function_view as callback
type.
* macrotab.h: Include "common/function-view.h".
(macro_callback_fn): Declare a prototype instead of a pointer.
Remove "user_data" parameter.
(macro_for_each, macro_for_each_in_scope): Adjust to use
function_view as callback type.
* psymtab.c (partial_map_expand_apply)
(psym_map_symtabs_matching_filename, recursively_search_psymtabs):
Adjust to use function_view as callback type and to return bool.
(psym_expand_symtabs_matching): Adjust to use function_view as
callback types.
* symfile-debug.c (debug_qf_map_symtabs_matching_filename): Adjust
to use function_view as callback type and to return bool.
(debug_qf_expand_symtabs_matching): Adjust to use function_view as
callback types.
* symfile.c (expand_symtabs_matching): Adjust to use function_view
as callback types.
* symfile.h: Include "common/function-view.h".
(expand_symtabs_file_matcher_ftype)
(expand_symtabs_symbol_matcher_ftype)
(expand_symtabs_exp_notify_ftype): Remove "data" parameter and
return bool.
(quick_symbol_functions::map_symtabs_matching_filename)
(quick_symbol_functions::expand_symtabs_matching): Adjust to use
function_view as callback type and return bool.
(expand_symtabs_matching): Adjust to use function_view as callback
type.
(maintenance_expand_name_matcher)
(maintenance_expand_file_matcher): Delete.
(maintenance_expand_symtabs): Use lambdas.
* symtab.c (iterate_over_some_symtabs): Adjust to use
function_view as callback types and return bool.
(iterate_over_symtabs): Likewise. Use unique_xmalloc_ptr instead
of a cleanup.
(lookup_symtab_callback): Delete.
(lookup_symtab): Use a lambda.
(iterate_over_symbols): Adjust to use function_view as callback
type.
(struct search_symbols_data, search_symbols_file_matches)
(search_symbols_name_matches): Delete.
(search_symbols): Use a pair of lambdas.
(struct add_name_data, add_macro_name, symbol_completion_matcher)
(symtab_expansion_callback): Delete.
(default_make_symbol_completion_list_break_on_1): Use lambdas.
* symtab.h: Include "common/function-view.h".
(iterate_over_some_symtabs): Adjust to use function_view as
callback type and return bool.
(iterate_over_symtabs): Adjust to use function_view as callback
type.
(symbol_found_callback_ftype): Remove 'data' parameter and return
bool.
(iterate_over_symbols): Adjust to use function_view as callback
type.

07e253a 2017-02-24 01:14:08 Pedro Alves

Introduce gdb::function_view

This commit adds a new function_view type. This type holds a
non-owning reference to a callable. It is meant to be used as
callback type of functions, instead of using the C-style pair of
function pointer and 'void *data' arguments. function_view allows
passing references to stateful function objects / lambdas with
captures as callbacks efficiently, while function pointer + 'void *'
does not.

See the intro in the new function-view.h header for more.

Unit tests included, put into a new gdb/unittests/ subdir.

gdb/ChangeLog:
2017-02-23 Pedro Alves <palves@redhat.com>

* Makefile.in (SUBDIR_UNITTESTS_SRCS, SUBDIR_UNITTESTS_OBS): New.
(%.o) <unittests/%.c>: New pattern.
* configure.ac ($development): Add $(SUBDIR_UNITTESTS_OBS) to
CONFIG_OBS, and $(SUBDIR_UNITTESTS_SRCS) to CONFIG_SRCS.
* common/function-view.h: New file.
* unittests/function-view-selftests.c: New file.
* configure: Regenerate.

1e9d41d 2017-02-24 00:53:16 Sheldon Lobo

opcodes,gas: associate SPARC ASIs with an architecture level.

With this change an architecture level bump due to assembly ASIs will show
up as a warning/error depending on options passed to gas.

Tested with sparc64-linux-gnu, and it does not introduce any regressions.

gas/ChangeLog:

Add support for associating SPARC ASIs with an architecture level.
* config/tc-sparc.c (parse_sparc_asi): New encode SPARC ASIs.

opcodes/ChangeLog:

Add support for associating SPARC ASIs with an architecture level.
* include/opcode/sparc.h (sparc_asi): New sparc_asi struct.
* opcodes/sparc-opc.c (asi_table): Updated asi_table and encoding/
decoding of SPARC ASIs.

8eaf532 2017-02-24 00:36:20 Simon Marchi

Fix usage of inferior_ptid in two thread_alive implementations

While inspecting some target code, I noticed that in these two
implementations of thread_alive, inferior_ptid is referenced directly
instead of using the ptid passed as parameters. I guess that it is
wrong, although I can't really test it in both cases.

gdb/ChangeLog:

* bsd-uthread.c (bsd_uthread_thread_alive): Use ptid instead of
inferior_ptid.
* go32-nat.c (go32_thread_alive): Likewise.

60abdbe 2017-02-23 22:45:21 Nick Clifton

Add support to readelf for displaying gnu attributes in architectures not known to support them.

* readelf.c (display_tag_value): Use an explicit signed type for
the tag parameter.
(display_gnu_attributes): Use an unsigned integer type for
attribute tags.
(display_power_gnu_attribute): Likewise.
(display_s390_gnu_attribute): Likewise.
(display_sparc_hwcaps): Likewise.
(display_sparc_hwcaps2): Likewise.
(display_sparc_gnu_attribute): Likewise.
(display_mips_gnu_attribute): Likewise.
(display_tic6x_attribute): Likewise.
(display_raw_attribute): Likewise.
(process_attributes): Likewise.
(process_arm_specific): Delete redundant function.
(process_power_specific): Likewise.
(process_s390_specific): Likewise.
(process_sparc_specific): Likewise.
(process_tic6x_specific): Likewise.
(process_msp430x_specific): Likewise.
(display_public_gnu_attributes): New function. Displays known
information about an unknown gnu attribute.
(display_generic_attribute): New function. Calls
display_tag_value for non-nul tags.
(process_arch_specific): Call process_attributes even for
architectures not known to specifically support gnu attributes.

3876875 2017-02-23 20:57:46 Yao Qi

Use xfree rather than delete for varobj_iter

ASAN reports an error,

-var-create container @ c^M
=================================================================^M
^[[1m^[[31m==21639==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x6030000805c0^M
^[[1m^[[0m #0 0x7f2449b01b2a in operator delete(void*) (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x99b2a)^M
#1 0xbb601d in update_dynamic_varobj_children ../../binutils-gdb/gdb/varobj.c:794^M
#2 0xbb6556 in varobj_get_num_children(varobj*) ../../binutils-gdb/gdb/varobj.c:854^M
#3 0x580cb4 in print_varobj ../../binutils-gdb/gdb/mi/mi-cmd-var.c:61^M
#4 0x58138b in mi_cmd_var_create(char*, char**, int) ../../binutils-gdb/gdb/mi/mi-cmd-var.c:145^M
#5 0x5967ce in mi_cmd_execute ../../binutils-gdb/gdb/mi/mi-main.c:2301^M
#6 0x594b05 in captured_mi_execute_command ../../binutils-gdb/gdb/mi/mi-main.c:2001
....
^M
^[[1m^[[32m0x6030000805c0 is located 0 bytes inside of 32-byte region [0x6030000805c0,0x6030000805e0)^M
^[[1m^[[0m^[[1m^[[35mallocated by thread T0 here:^[[1m^[[0m^M
#0 0x7f2449b00602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)^M
#1 0x7d1596 in xmalloc ../../binutils-gdb/gdb/common/common-utils.c:43^M
#2 0x604176 in py_varobj_iter_new ../../binutils-gdb/gdb/python/py-varobj.c:159^M
#3 0x6042da in py_varobj_get_iterator(varobj*, _object*) ../../binutils-gdb/gdb/python/py-varobj.c:198^M
#4 0xbb5806 in varobj_get_iterator ../../binutils-gdb/gdb/varobj.c:720^M
#5 0xbb5b9b in update_dynamic_varobj_children ../../binutils-gdb/gdb/varobj.c:758^M

gdb:

2017-02-23 Yao Qi <yao.qi@linaro.org>

* varobj-iter.h (varobj_iter_delete): Call xfree instead of
delete.

0a8beab 2017-02-23 20:05:03 Yao Qi

Use delete instead of xfree for varobj_item

In commit 2f408ec (Use ui_file_as_string throughout more), we start to
new varobj_item,

> - vitem = XNEW (struct varobj_item);
> + vitem = new varobj_item ();

but we still use xfree. This causes some ASAN errors,

-var-update container^M
=================================================================^M
^[[1m^[[31m==20660==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new vs free) on 0x602000090c10^M
^[[1m^[[0m #0 0x2baa77d03631 in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54631)^M
#1 0x80e0c8 in xfree(void*) /home/yao/SourceCode/gnu/gdb/git/gdb/common/common-utils.c:100^M
#2 0xc13670 in varobj_clear_saved_item /home/yao/SourceCode/gnu/gdb/git/gdb/varobj.c:727^M
#3 0xc13957 in update_dynamic_varobj_children /home/yao/SourceCode/gnu/gdb/git/gdb/varobj.c:752^M
#4 0xc1841c in varobj_update(varobj**, int) /home/yao/SourceCode/gnu/gdb/git/gdb/varobj.c:1699^M
#5 0x5a2bf7 in varobj_update_one /home/yao/SourceCode/gnu/gdb/git/gdb/mi/mi-cmd-var.c:712^M
#6 0x5a2a41 in mi_cmd_var_update(char*, char**, int) /home/yao/SourceCode/gnu/gdb/git/gdb/mi/mi-cmd-var.c:695^
........
^M
^[[1m^[[32m0x602000090c10 is located 0 bytes inside of 16-byte region [0x602000090c10,0x602000090c20)^M
^[[1m^[[0m^[[1m^[[35mallocated by thread T0 here:^[[1m^[[0m^M
#0 0x2baa77d0415f in operator new(unsigned long) (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5515f)^M
#1 0x63613e in py_varobj_iter_next /home/yao/SourceCode/gnu/gdb/git/gdb/python/py-varobj.c:112^M
#2 0xc13b89 in update_dynamic_varobj_children /home/yao/SourceCode/gnu/gdb/git/gdb/varobj.c:776^M
#3 0xc1841c in varobj_update(varobj**, int) /home/yao/SourceCode/gnu/gdb/git/gdb/varobj.c:1699^M
#4 0x5a2bf7 in varobj_update_one /home/yao/SourceCode/gnu/gdb/git/gdb/mi/mi-cmd-var.c:712^M
#5 0x5a2a41 in mi_cmd_var_update(char*, char**, int) /home/yao/SourceCode/gnu/gdb/git/gdb/mi/mi-cmd-var.c:695^M

gdb:

2017-02-23 Yao Qi <yao.qi@linaro.org>

* varobj.c (varobj_clear_saved_item): Use delete instead of
xfree.
(update_dynamic_varobj_children): Likewise.

946416f 2017-02-23 19:21:10 Jan Beulich

gas: slightly relax .startof.()/.sizeof.() testcase

53c4d62 2017-02-23 19:03:55 Jan Beulich

x86: drop stray VEX opcode 82 references

No such ModR/M-less opcode has ever existed in public documentation
afaict, so I can't see why it had been added in the first place.
Furthermore opcode 77 is special only with implied prefix 0F.

4c5b8d1 2017-02-23 19:00:44 Jan Beulich

x86: extend 64-bit invalid MPX insn forms testcase

5499c7c 2017-02-23 11:03:51 Alan Modra

Correct VLE 16D and SDAREL relocations

PR 20744
bfd/
* elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
16D relocations.
(ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
(ppc_elf_relocate_section): Correct calculation for VLE SDAREL
relocs.
ld/
* testsuite/ld-powerpc/vle-reloc-2.s: Use r6 for last insn of
each group.
* testsuite/ld-powerpc/vle-reloc-2.d: Update for above change
and sdarel reloc fix.

d826042 2017-02-23 09:00:41 GDB Administrator

Automatic date update in version.in

0502a2b 2017-02-23 04:22:59 Jan Kratochvil

Display user op byte

binutils/
2017-02-22 Jan Kratochvil <jan.kratochvil@redhat.com>

* dwarf.c (decode_location_expression): Display also OP.

233f82c 2017-02-23 03:16:28 Maciej W. Rozycki

readelf: Restore a lost new line in version information

Fix a commit 74e1a04b9787 ("More fixes for reading corrupt ELF files.")
`readelf --version-info' output formatting regression where a dropped
new line caused section header information from the `.gnu.version_d'
version definition section to be printed on the same line as this
section's first entry.

For example with the `mips-linux' target we get:

$ cat ver_def.s
.data
.globl new_foo
.type new_foo, %object
new_foo:
.symver new_foo, foo@@ver_foo
$ cat ver_def.ver
{ global: *foo*; local: *; };
$ as -o ver_def.o ver_def.s
$ ld -e 0 --export-dynamic --version-script=ver_def.ver -o ver_def ver_def.o
$ readelf -V ver_def

Version symbols section '.gnu.version' contains 4 entries:
Addr: 000000000000007e Offset: 0x01007e Link: 2 (.dynsym)
000: 0 (*local*) 2 (ver_foo) 1 (*global*) 2 (ver_foo)

Version definition section '.gnu.version_d' contains 2 entries:
Addr: 0x0000000000000088 Offset: 0x010088 Link: 3 (.dynstr) 000000: Rev: 1 Flags: BASE Index: 1 Cnt: 1 Name: ver_def
0x001c: Rev: 1 Flags: none Index: 2 Cnt: 1 Name: ver_foo
Version definition past end of section
$

Add the new line then, to get:

$ readelf -V ver_def

Version symbols section '.gnu.version' contains 4 entries:
Addr: 000000000000007e Offset: 0x01007e Link: 2 (.dynsym)
000: 0 (*local*) 2 (ver_foo) 1 (*global*) 2 (ver_foo)

Version definition section '.gnu.version_d' contains 2 entries:
Addr: 0x0000000000000088 Offset: 0x010088 Link: 3 (.dynstr)
000000: Rev: 1 Flags: BASE Index: 1 Cnt: 1 Name: ver_def
0x001c: Rev: 1 Flags: none Index: 2 Cnt: 1 Name: ver_foo
Version definition past end of section
$

instead.

binutils/
* readelf.c (process_version_sections) <SHT_GNU_verdef>: Print a
new line between the heading and the first version definition
entry.

902e9fc 2017-02-23 03:16:28 Maciej W. Rozycki

PR ld/20828: Move symbol version processing ahead of GC symbol sweep

Complement commit b531344c34b0 ("PR ld/20828: Reorder the symbol sweep
stage of section GC") and commit 81ff47b3a546 ("PR ld/20828: Fix linker
script symbols wrongly forced local with section GC") and move symbol
version processing ahead of the symbol sweep stage of section GC, all in
`bfd_elf_size_dynamic_sections', so that version symbols created stay in
the global scope and are not output as local symbols to the dynamic
symbol table in the presence of corresponding symbol definitions pulled
from a DSO involved in a link.

Consolidate the whole of symbol version processing into a single block
from all parts scattered across the function and rearranging the local
variables used as necessary, however leaving the setting of dynamic
entries associated with the DT_VERDEF, DT_VERDEFNUM, DT_VERNEED and
DT_VERNEEDNUM tags and the SEC_EXCLUDE flag for unused `.gnu.version'
section in the original places.

With the rearrangement of code blocks `Elf_Internal_Verneed *t' would
shadow the previous definition of `struct bfd_elf_version_tree *t', so
rename the former variable to `vn'.

bfd/
PR ld/20828
* elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
processing ahead of the call to `elf_gc_sweep_symbol'.

ld/
PR ld/20828
* testsuite/ld-elf/pr20828-d.sd: New test.
* testsuite/ld-elf/pr20828-e.sd: New test.
* testsuite/ld-elf/pr20828-v.od: New test.
* testsuite/ld-elf/pr20828-v.ver: New test version script.
* testsuite/ld-elf/pr20828-v.ld: New test linker script.
* testsuite/ld-elf/pr20828.ld: Add `.gnu.version' and
`.gnu.version_d'.
* testsuite/ld-elf/shared.exp: Run the new tests.

5ff6a06 2017-02-23 03:15:33 Maciej W. Rozycki

GAS: Consistently fix labels at the `.end' pseudo-op

Fix a functional regression with the `.end' pseudo-op, introduced with
commit ecb4347adecd ("Last take: approval for MIPS_STABS_ELF killing"),
<https://sourceware.org/ml/binutils/2002-06/msg00443.html>, and commit
dcd410fe1544 ("GNU as 2.14 on IRIX 6: crashes with shared libs"),
<https://sourceware.org/ml/binutils/2003-07/msg00415.html>, which caused
symbol values for labels placed between the end of a function's contents
and its terminating `.end' followed by one of the alignment pseudo-ops
to be different depending on whether either `-mdebug', or `-mno-pdr', or
neither of the command-line options is in effect, be it implied or
specified.

Given debug-label-end.s as follows and the `mips-linux' target we have:

$ cat debug-label-end.s
.text

.globl foo
.globl bar
.align 4, 0
.ent foo
foo:
nop
.aent bar
bar:
.insn
.end foo
.align 4, 0
.space 16

.globl baz
.ent baz
baz:
nop
.end baz
.align 4, 0
.space 16
$ as -o debug-label-end.o debug-label-end.s
$ readelf -s debug-label-end.o | grep bar
9: 00000004 0 FUNC GLOBAL DEFAULT 1 bar
$ as -mdebug -o debug-label-end.o debug-label-end.s
$ readelf -s debug-label-end.o | grep bar
9: 00000010 0 FUNC GLOBAL DEFAULT 1 bar
$ as -mno-pdr -o debug-label-end.o debug-label-end.s
$ readelf -s debug-label-end.o | grep bar
8: 00000010 0 FUNC GLOBAL DEFAULT 1 bar
$

The reason is the call to `md_flush_pending_output', which in the case
of `mips*-*-*' targets expands to `mips_emit_delays', which in turn
calls `mips_no_prev_insn', which calls `mips_clear_insn_labels', which
clears the list of outstanding labels. That list is in turn consulted
in `mips_align', called in the interpretation of alignment directives,
and the labels adjusted to the current location.

A call to `md_flush_pending_output' is only made from `s_mips_end' and
then only if `-mpdr' is in effect, which is the default for `*-*-linux*'
and some other `mips*-*-*' targets. A call to `md_flush_pending_output'
is never made from `ecoff_directive_end', which is used in place of
`s_mips_end' when `-mdebug' is in effect. Consequently if `-mno-pdr' or
`-mdebug' is in effect the list of outstanding labels makes it through
to any alignment directive that follows and the labels are differently
interpreted depending on the command-lines options used. And we want
code produced to be always the same.

Call `md_flush_pending_output' unconditionally then in `s_mips_end' and
add such a call from `ecoff_directive_end' as well, as long as the macro
is defined. While `ecoff_directive_end' is shared among targets, the
only one other than `mips*-*-*' actually using it is `alpha*-*-*' and it
does not define `md_flush_pending_output'. So the semantics isn't going
to change for it and neither it has to have its `s_alpha_end' updated
or have code in `ecoff_directive_end' conditionalized.

gas/
* ecoff.c (ecoff_directive_end) [md_flush_pending_output]: Call
`md_flush_pending_output'.
* config/tc-mips.c (s_mips_end) [md_flush_pending_output]: Call
`md_flush_pending_output' unconditionally.
* testsuite/gas/mips/debug-label-end-1.d: New test.
* testsuite/gas/mips/debug-label-end-2.d: New test.
* testsuite/gas/mips/debug-label-end-3.d: New test.
* testsuite/gas/mips/debug-label-end.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.

758d96d 2017-02-23 02:28:33 Nick Clifton

Align .gnu_debuglink sections on a 4-byte boundary.

PR binutils/21193
* opncls.c (bfd_create_gnu_debuglink_section): Give the newly
created section 4-byte alignment.

25890fc 2017-02-22 22:17:33 Hans-Peter Nilsson

Fix gas/all/err-sizeof.s for cris*-*-*

5ffbd92 2017-02-22 21:00:01 Nick Clifton

Skip ARM vcmp-noprefix-imm test on non-ELF targets

b0c5349 2017-02-22 18:37:52 Jan Beulich

gas: require an operand to .startof.()/.sizeof.()