• R/O
  • HTTP
  • SSH
  • HTTPS

Liste der Commits

Tags
Keine 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/template-suffix
RSS
Rev. Zeit Autor
e61b4af users/simark/template-suffix 2018-02-05 12:21:08 Simon Marchi

Don't trust templates from DW_AT_name

With gcc 8 (and clang?) the non-type template arguments (constants)
don't include the integer suffixes anymore. For example, with

template <unsigned int X>
class foo
{
...
};

foo<10u>

used to generate foo<10u> as the DW_AT_name, now it generates foo<10>.
This is a problem when things look up "foo<10u>" and don't find it. For
example, when trying to print an instance of that class through a base
class pointer, GDB would first demangle the symbol for that class'
vtable, which would give "vtable for foo<10u>". GDB would then take the
"foo<10u>" from that string and try to look up the type. With the new
DW_AT_name, it would fail to look it up, and fail to print the value.

This patch makes it so GDB doesn't trust the templates contained in
DW_AT_name. Instead, it re-builds the name from the DW_AT_template_*
DIES in the format that it expects (with the integer suffixes).

9f7393d 2018-02-05 00:51:10 H.J. Lu

ld/testsuite: Replace -Sw with -SW for readelf

-Sw is a typo. It should be -SW for readelf.

* testsuite/ld-i386/lea1d.d: Replace -Sw with -SW.
* testsuite/ld-i386/lea1e.d: Likewise.
* testsuite/ld-i386/lea1f.d: Likewise.
* testsuite/ld-x86-64/lea1g.d: Likewise.
* testsuite/ld-x86-64/lea1h.d: Likewise.
* testsuite/ld-x86-64/lea1i.d: Likewise.
* testsuite/ld-x86-64/lea1j.d: Likewise.
* testsuite/ld-x86-64/lea1k.d: Likewise.
* testsuite/ld-x86-64/lea1l.d: Likewise.

c5b47a4 2018-02-04 09:01:03 GDB Administrator

Automatic date update in version.in

f721678 2018-02-04 01:56:04 Andrew Burgess

gdb/testsuite: Remove use of dejagnu cleanup proc

The 'cleanup' proc has been removed from dejagnu (Feb 15 2016). The
proc has not done anything useful since at least 2001 so removing
these calls should be harmless.

gdb/testsuite/ChangeLog:

* config/sid.exp (gdb_target_sid): Remove use of cleanup.
* config/sim.exp (gdb_target_sim): Remove use of cleanup.

b0daac8 2018-02-03 22:11:35 Nick Clifton

Remove PROVIDE() qualifiers from definition of __CTOR_LIST__ and __DTOR_LIST__ symbols in PE linker scripts.

PR 22762
* scripttempl/pe.sc: Remove PROVIDE()s from __CTOR_LIST__ and
__DTOR_LIST__ symbols. Add a comment explaining why this is
necessary.
* scripttemp/pep.sc: Likewise.
* ld.texinfo (PROVIDE): Add a note about the effect of common
symbols.

138a158 2018-02-03 16:00:02 Sandra Loosemore

Disable -shared support in nios2-elf-ld.

2018-02-03 Sandra Loosemore <sandra@codesourcery.com>

* emulparams/nios2elf.sh (GENERATE_SHLIB_SCRIPT): Don't set.

c833445 2018-02-03 10:44:27 Cary Coutant

Add support for DWARF-4 line number tables.

Reads the maximum_operations_per_instruction field, added in DWARF-4 to the
line number program header.

gold/
* PR gold/22776
* dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog): Add
support for DWARF-4 line number tables.
* dwarf_reader.h (Sized_dwarf_line_info::max_ops_per_insn): New field.

d73daf8 2018-02-03 09:00:31 GDB Administrator

Automatic date update in version.in

7f02625 2018-02-03 05:43:09 Jim Wilson

RISC-V: Fix --wrap and relaxation conflict.

bfd/
PR ld/22756
* elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
If link_info->wrap_hash, check for a duplicate symbol and ignore.
(_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
Pass new argument to riscv_relax_delete_bytes.
(_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise. Remove
ATTRIBUTE_UNUSED from link_info parameter.

0625771 2018-02-03 04:03:25 Leszek Swirski via gdb-patches

MI: Allow non-raw varobj evaluation

Make the MI variable object expression evaluation, with the
-var-evaluate-expression command, recursively call pretty printers, to
match the output of normal expression printing.

Consider the following code:

struct Foo { int val; };
struct Wrapper { Foo foo; };

int main() {
Wrapper w;
w.foo.val = 23;
}

and this pretty printer file:

import gdb.printing

class FooPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
return "Foo" + str(self.val["val"])

class WrapperPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
return self.val["foo"]

test_printer = gdb.printing.RegexpCollectionPrettyPrinter("test")
test_printer.add_printer('Foo', '^Foo$', FooPrinter)
test_printer.add_printer('Wrapper', '^Wrapper$', WrapperPrinter)

gdb.printing.register_pretty_printer(None, test_printer)

Setting a breakpoint at the end of the function, we call the following commands:

-enable-pretty-printing
^done

-var-create var_w @ w
^done,name="var_w",numchild="0",value="{val = 23}",type="Wrapper",dynamic="1",has_more="0"
-var-create var_w_foo @ w.foo
^done,name="var_w_foo",numchild="0",value="Foo23",type="Foo",dynamic="1",has_more="0"

-var-evaluate-expression var_w
^done,value="{val = 23}"
-var-evaluate-expression var_w_foo
^done,value="Foo23"

-data-evaluate-expression w
^done,value="Foo23"
-data-evaluate-expression w.foo
^done,value="Foo23"

So, in the -var-evaluate-expression var_w case, we print the "raw" value
of w.foo, while in the -data-evaluate-expression w case, we print the
pretty printed w.foo value. After this patch, all of the above print
"Foo23".

gdb/ChangeLog:

* varobj.c (varobj_formatted_print_options): Allow recursive
pretty printing if pretty printing is enabled.

gdb/testsuite/ChangeLog:

* gdb.python/py-prettyprint.c
(struct to_string_returns_value_inner,
struct to_string_returns_value_wrapper): New.
(main): Add tsrvw variable.
* gdb.python/py-prettyprint.py (ToStringReturnsValueInner,
ToStringReturnsValueWrapper): New classes.
(register_pretty_printers): Register new pretty-printers.
* gdb.python/py-prettyprint.exp (run_lang_tests): Test printing
recursive pretty printer.
* gdb.python/py-mi.exp: Likewise.

5bb0830 2018-02-03 03:50:40 Andrew Burgess

binutils/riscv: Register names in DWARF output

Adds a register name table for RiscV so that objdump and readelf can
both use better register names.

binutils/ChangeLog:

* dwarf.c (dwarf_regnames_riscv): New register name table.
(init_dwarf_regnames_riscv): New function.
(init_dwarf_regnames): Add call to initialise RiscV register
names.
* dwarf.h (init_dwarf_regnames_riscv): Declare.
* objdump.c (dump_dwarf): Add call to initialise RiscV register
names.

e54d3c9 2018-02-03 03:08:04 Maciej W. Rozycki

LD/testsuite: Pass $AFLAGS_PIC to GAS for PIC assembly

Add $AFLAGS_PIC flags for PIC assembly to a number of tests missing them
and remove `tic6x-*-*' XFAIL annotations from them, previously added to
paper over:

.../ld-new: warning: generating a shared library containing non-PID code

error messages produced due to `-mpic -mpid=near' GAS options having not
been used. Such errors now do not happen anymore, removing:

XFAIL: Build shared library for pr14170
XFAIL: PR ld/21703 shared
XFAIL: Build shared library for broken linker script test
XFAIL: Build pr17068.so
XFAIL: -Bsymbolic-functions
XFAIL: Build pr20995.so
XFAIL: Build pr22374 shared library

with `tic6x-elf' and `tic6x-uclinux' targets. These tests now pass all
except for:

FAIL: PR ld/21703 shared

which is now due to a different reason, as follows:

extra regexps in .../ld/testsuite/ld-elf/pr21703-shared.sd starting with "^Symbol table '\.dynsym' contains [0-9]+ entries:$"
EOF from dump.out
FAIL: PR ld/21703 shared

The addition of $AFLAGS_PIC requires the affected test cases to use the
`list' command rather than `{}' characters to create a list, to avoid
the quoting property `{}' also have in TCL. Consequently the change is
slightly more extensive than it could otherwise be.

ld/
* testsuite/ld-elf/shared.exp: Add $AFLAGS_PIC throughout to PIC
assembly builds where missing and remove `tic6x-*-*' XFAIL
markings accordingly.

d830549 2018-02-02 21:16:40 Alan Modra

PowerPC64, don't relocate nops

This fixes a "bug" in that nops emitted as part of code optimization
were being relocated. As it happens the relocation value was always
zero so the nop wasn't changed. Whew! I've also moved the use of
"howto" later since I was caught out in some recent code changes with
the howto not matching r_type.

* elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
emitted for toc sequence optimization. Set and use "howto" later.

59498c3 2018-02-02 12:34:20 Leszek Swirski

Do not classify C struct members as a filename

There is existing logic in C/C++ expression parsing to avoid classifying
names as a filename when they are a field on the this object. This
change extends this logic to also avoid classifying names after a
struct-op (-> or .) as a filename, which otherwise causes a syntax
error.

Thus, it is now possible in the file

#include <map>
struct D {
void map();
}
D d;

to call

(gdb) print d.map()

where previously this would have been a syntax error.

Tested on gdb.cp/*.exp

gdb/ChangeLog:

* c-exp.y (lex_one_token, classify_name, yylex): Don't classify
names after a structop as a filename

gdb/testsuite/ChangeLog:

* gdb.cp/filename.cc, gdb.cp/filename.exp: Test that member
functions with the same name as an include file are parsed
correctly.

17545aa 2018-02-02 09:00:29 GDB Administrator

Automatic date update in version.in

2d9e6ac 2018-02-02 00:51:01 Yao Qi

Rewrite arm_record_coproc_data_proc and arm_record_data_proc_misc_ld_str

When I triage some reverse debugging test fails on arm-linux, I find
arm_record_coproc_data_proc and arm_record_data_proc_misc_ld_str is not
friendly to instruction encoding on ARM ARM. This patch rewrites them, in
a way match more closely to the manual.

gdb:

2018-02-01 Yao Qi <yao.qi@linaro.org>

* arm-tdep.c (arm_record_data_proc_misc_ld_str): Rewrite it.
(arm_record_coproc_data_proc): Likewise.

df95a9c 2018-02-02 00:09:44 Yao Qi

set ret signed in arm_record_extension_space

Variable 'ret' should be int rather than unsigned, as it can be -1.

gdb:

2018-02-01 Yao Qi <yao.qi@linaro.org>

* arm-tdep.c (arm_record_extension_space): Change ret to signed.

d4d3884 2018-02-01 23:50:23 Yao Qi

Fix gdb.base/attach.exp fails when gdb is configured --with-sysroot=/

I see some test fails in gdb.base/attach.exp when gdb is configured
--with-sysroot=/.

FAIL: gdb.base/attach.exp: attach2, with no file
FAIL: gdb.base/attach.exp: load file manually, after attach2 (re-read) (got interactive prompt)
FAIL: gdb.base/attach.exp: attach when process' a.out not in cwd

If gdb is configured this way, sysroot is "/" in default, and if binfile
is a absolute path, the regexp pattern $sysroot$escapedbinfile is
incorrect.

There are different ways to fix it, but I don't want to complicate the
test, so I choose this naive way.

gdb/testsuite:

2018-02-01 Yao Qi <yao.qi@linaro.org>

* gdb.base/attach.exp (do_attach_tests): Set sysroot to
"\[^\r\n\]*".

e99955c 2018-02-01 22:21:41 Simon Marchi

Fix compile time warnings building the binutils with clang.

bfdI would like to fix instances of the following warning, when building
with clang with no special CFLAGS other than -g3 -O0.

/home/emaisin/src/binutils-gdb/bfd/elflink.c:5425:45: error: performing pointer arithmetic on a null pointer has undefined behavior [-Werror,-Wnull-pointer-arithmetic]
return (struct elf_link_hash_entry *) 0 - 1;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

Replacing those with "(struct elf_link_hash_entry *) -1" gets rid of the
warning. I wanted to check that it didn't change the resulting code, so
I tried to build this:

$ cat test.c
int *before()
{
return (int *) 0 - 1;
}

int *after()
{
return (int *) - 1;
}

$ gcc -c test.c -g
$ objdump -d test.o

test.o: file format elf64-x86-64

Disassembly of section .text:

0000000000000000 <before>:
0: 55 push %rbp
1: 48 89 e5 mov %rsp,%rbp
4: 48 c7 c0 fc ff ff ff mov $0xfffffffffffffffc,%rax
b: 5d pop %rbp
c: c3 retq

000000000000000d <after>:
d: 55 push %rbp
e: 48 89 e5 mov %rsp,%rbp
11: 48 c7 c0 ff ff ff ff mov $0xffffffffffffffff,%rax
18: 5d pop %rbp
19: c3 retq

This shows that the previous code doesn't actually return -1 as the
function documentation says, but the new one does, so it's kind of a
bugfix.

bfd * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
arithmetic on NULL pointer.
* elflink.c (_bfd_elf_archive_symbol_lookup,
elf_link_add_archive_symbols): Likewise.

ld * ldexp.c (fold_name, exp_fold_tree_1): Avoid pointer arithmetic
on NULL pointer.

f2023ce 2018-02-01 20:08:02 Alan Modra

PR22769, crash when running 32-bit objdump on corrupted file

PR 22769
* objdump.c (load_specific_debug_section): Check for overflow
when adding one to section size for a string section terminator.

35f48e2 2018-02-01 09:00:21 GDB Administrator

Automatic date update in version.in

f000c2b 2018-02-01 05:42:28 H.J. Lu

Fix testsuite/ld-elf/pr21964-5.c

Mark my_var as used. Otherwise it fails at -O2.

* testsuite/ld-elf/pr21964-5.c (my_var): Mark as used.

07e5f5c 2018-02-01 03:24:05 Nikola Prica

Fix for prologue processing on PowerPC

One of conditions in skip_prologue() was never visited if there was mflr
instruction that moves the link register to a register different than r0.
This condition expects non shifted value of `lr_reg`. Previously offset
of link register was never saved for registers different than r0.

gdb/ChangeLog:

2018-01-31 Nikola Prica <nikola.prica@rt-rk.com>

* rs6000-tdep.c (skip_prologue): Remove shifting for lr_reg and
assign shifted lr_reg to fdata->lr_register when lr_reg is set.

gdb/testsuite/ChangeLog:

2018-01-31 Nikola Prica <nikola.prica@rt-rk.com>

* gdb.arch/powerpc-prologue-frame.s: New file.
* gdb.arch/powerpc-prologue-frame.c: Likewise.
* gdb.arch/powerpc-prologue-frame.exp: Likewise.

450b631 2018-01-31 23:47:12 Maciej W. Rozycki

LD/testsuite: Fix a typo s/scrip/script/ in `note-3.so' build test name

ld/
* testsuite/ld-elf/shared.exp: Fix a typo s/scrip/script/.

8988502 2018-01-31 23:47:12 Maciej W. Rozycki

MIPS/LD/testsuite: Correct dynamic links with VR4100, VR4300 and VR5000

Correct LD test suite failures with VR4100, VR4300 and VR5000 bare metal
MIPS/ELF targets which do not default to linking with shared libraries,
which leads to link failures like:

.../ld/ld-new: cannot find -lcomm-data
FAIL: Common symbol override test

or:

.../ld/ld-new: attempted static link of dynamic object `tmpdir/pr14170.so'
FAIL: PR ld/14170

removing:

FAIL: Build pr22471b.so
FAIL: Build pr22471
FAIL: Build pr22649-2b.so
FAIL: Build pr22649-2d.so
FAIL: Build pr22150
FAIL: PR ld/14170
FAIL: --gc-sections with __gxx_personality

test failures.

ld/
* testsuite/ld-elf/comm-data.exp: Pass `-call_shared' to links
involving a shared library for `mips*vr4100*-*-elf*',
`mips*vr4300*-*-elf*' and `mips*vr5000*-*-elf*' targets.
* testsuite/ld-elf/provide-hidden.exp: Likewise.
* testsuite/ld-elf/shared.exp: Likewise.
* testsuite/ld-gc/gc.exp: Likewise.
* testsuite/ld-mips-elf/comm-data.exp: Likewise.

f3a9baf 2018-01-31 23:47:12 Maciej W. Rozycki

LD/testsuite: Move ELF shared library tests from elf.exp to shared.exp

Move those ELF shared library tests that are in ld-elf/elf.exp over to
ld-elf/shared.exp, to keep them all together and make the maintenance of
extra flags needed with some targets and shared library builds easier,
and also removing the need for the large:

if { [check_shared_lib_support] } then {
[...]
}

conditional block and consequently reducing indentation, which always
helps with TCL code. No functional change, except for the order of
individual test case execution which has changed accordingly, i.e. the
test results are shuffled.

ld/
* testsuite/ld-elf/elf.exp: Move shared library tests over to...
* testsuite/ld-elf/shared.exp: ... here.

3045b47 2018-01-31 22:50:35 Pedro Alves

gdb: Fix remote-sim/MinGW/Darwin builds

(Add missing ChangeLog entry)

The recent commit e671cd59 ("Per-inferior target_terminal state, fix
PR gdb/13211, more") missed adjusting a few targets to the new
target_ops->to_interrupt interface, breaking the build for those
targets. This fixes it.

Note: remote-sim doesn't really support async execution, so I don't
think gdbsim_interrupt is ever reached via target_interrupt. (It is
reached via gdbsim_cntrl_c though).

The inflow.c changes are a bit ugly, but they're just doing what other
parts of the file already do to handle the same missing functions.
Targets that don't have 'kill', like mingw have their own
target_ops->to_interrupt implementation, so it's fine to make
child_interrupt be a nop.

gdb/ChangeLog:
2018-01-31 Pedro Alves <palves@redhat.com>

* darwin-nat.c (darwin_interrupt): Remove ptid_t parameter.
* inflow.c (child_terminal_save_inferior): Wrap reference to
tcgetpgrp in HAVE_TERMIOS_H.
(child_interrupt, child_pass_ctrlc): Wrap references to signal in
_WIN32.
* remote-sim.c (gdbsim_interrupt): Remove ptid_t parameter and
always iterate over all inferiors.
(gdbsim_cntrl_c): Adjust.
* windows-nat.c (windows_interrupt): Remove 'ptid_t' parameter.

f6cfb42 2018-01-31 22:45:06 Pedro Alves

gdb: Fix remote-sim/MinGW/Darwin builds

The recent commit e671cd59 ("Per-inferior target_terminal state, fix
PR gdb/13211, more") missed adjusting a few targets to the new
target_ops->to_interrupt interface, breaking the build for those
targets. This fixes it.

Note: remote-sim doesn't really support async execution, so I don't
think gdbsim_interrupt is ever reached via target_interrupt. (It is
reached via gdbsim_cntrl_c though).

The inflow.c changes are a bit ugly, but they're just doing what other
parts of the file already do to handle the same missing functions.
Targets that don't have 'kill', like mingw have their own
target_ops->to_interrupt implementation, so it's fine to make
child_interrupt be a nop.

gdb/ChangeLog:
2018-01-31 Pedro Alves <palves@redhat.com>

* darwin-nat.c (darwin_interrupt): Remove ptid_t parameter.
* inflow.c (child_terminal_save_inferior): Wrap reference to
tcgetpgrp in HAVE_TERMIOS_H.
(child_interrupt, child_pass_ctrlc): Wrap references to signal in
_WIN32.
* remote-sim.c (gdbsim_interrupt): Remove ptid_t parameter and
always iterate over all inferiors.
(gdbsim_cntrl_c): Adjust.
* windows-nat.c (windows_interrupt): Remove 'ptid_t' parameter.

bf3077a 2018-01-31 22:37:32 Michael Matz

bfd_elf_define_start_stop: Fix check

We really need to check for a dynamic def, not only a ref.
See added testcase.

bfd/
* elflink.c (bfd_elf_define_start_stop): Fix check of
def_dynamic.

ld/
* testsuite/ld-elf/pr21964-5.c: New test.
* testsuite/ld-elf/shared.exp: Run it.

823143c 2018-01-31 22:10:53 H.J. Lu

Check if __start/__stop symbols are referenced by shared objects

Define __start/__stop symbols if they are referenced by shared objects,
not if they are also defined in shared objects.

bfd/

PR ld/21964
* elflink.c (bfd_elf_define_start_stop): Check if __start and
__stop symbols are referenced by shared objects.

ld/

PR ld/21964
* testsuite/ld-elf/pr21964-4.c: New file.
* testsuite/ld-elf/shared.exp: Run pr21964-4 test on Linux.