• R/O
  • HTTP
  • SSH
  • HTTPS

List of commits

標籤
無標籤

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/ccoutant/experimental-relr
RSS
修訂. 時間 作者
8c13bcd users/ccoutant/experimental-relr 2017-04-26 12:07:52 Cary Coutant

Experimental implementation of RELR-style relocations.

For x86-64 only. Instead of R_X86_64_RELATIVE relocations, we
write the offsets of the relocation targets to a new section,
.relr.dyn, with section type SHT_RELR.

4658f12 2017-04-26 05:32:05 Yao Qi

Change readonly_p to bool

This patch changes readonly_p type to bool.

gdb:

2017-04-25 Yao Qi <yao.qi@linaro.org>

* regcache.c (struct regcache) <readonly_p>: Change its type
to bool.
(regcache_xmalloc_1): Update parameter type and callers update.

c4ab950 2017-04-26 05:11:49 Maciej W. Rozycki

MIPS/readelf: Simplify GOT[1] data availability check

Unavailable data is handled gracefully in MIPS GOT processing done by
`print_mips_got_entry', so all that is needed in special GOT[1] handling
is to verify whether data can be retrieved for the purpose of the GNU
marker check done with `byte_get'. Remove the extra error reporting
code then, introduced with commit 75ec1fdbb797 ("Fix runtime seg-fault
in readelf when parsing a corrupt MIPS binary.") in the course of
addressing PR binutils/21344, and defer the error case to regular local
GOT entry processing.

binutils/
* readelf.c (process_mips_specific): Remove error reporting from
GOT[1] processing.

919383a 2017-04-26 05:10:53 Maciej W. Rozycki

MIPS/readelf: Remove extraneous null GOT data check

Null data is handled gracefully throughout in MIPS GOT processing, with
addresses printed normally and unavailable data shown as `<unknown>' by
`print_mips_got_entry', and special processing code for GOT[1] doing an
explicit check. Remove an unwanted null GOT data check then, introduced
with commit 592458412fb2 in the course of addressing PR binutils/12855.

binutils/
* readelf.c (process_mips_specific): Remove null GOT data check.

126124c 2017-04-26 00:07:00 Claudiu Zissulescu

[ARC] Enhance enter/leave mnemonics.

enter/leave mnemonics are enhanced to not only accept register ranges
but also single register (i.e., r13) or even no GPR register at all.

gas/
2017-04-25 Claudiu Zissulescu <claziss@synopsys.com>

* testsuite/gas/arc/leave_enter.d: Update test.
* testsuite/gas/arc/leave_enter.s: Likewise.

opcodes/
2017-04-25 Claudiu Zissulescu <claziss@synopsys.com>

* arc-dis.c (print_insn_arc): Smartly print enter/leave mnemonics.
* arc-opc.c (insert_r13el): New function.
(R13_EL): Define.
* arc-tbl.h: Add new enter/leave variants.

be6a24d 2017-04-26 00:07:00 Claudiu Zissulescu

[ARC] Prefer NOP instead of MOV 0,0

NOP and MOV 0,0 are having the same encoding. As MOV mnemonic is
located before NOP in the instruction table, the disassembler prints
MOV 0,0 for NOP. Reorder the instructions such that NOP is first.

gas/
2017-04-25 Claudiu Zissulescu <claziss@synopsys.com>

* testsuite/gas/arc/b.d: Update test.
* testsuite/gas/arc/noargs_hs.d: Likewise.

opcode/
2017-04-25 Claudiu Zissulescu <claziss@synopsys.com>

* arc-tbl.h: Reorder NOP entry to be before MOV instructions.

d581dda 2017-04-25 23:15:54 Yao Qi

Change gdbarch_wchar_bit for AArch64 and ARM

The size of wchar_t on AArch64 and ARM is 4-byte, so we can use the
default value (4*TARGET_CHAR_BIT).

This patch fixes some fails in gdb.cp/wide_char_types.exp on
aarch64-linux.

gdb:

2017-04-25 Yao Qi <yao.qi@linaro.org>

* aarch64-tdep.c (aarch64_gdbarch_init): Don't call
set_gdbarch_wchar_bit.
* arm-tdep.c (arm_gdbarch_init): Likewise.

0348fd7 2017-04-25 19:57:57 Maciej W. Rozycki

MIPS16/opcodes: Add `-M no-aliases' disassembler option help text

Complement commit 986e18a5a9fd ("Add a second 'pinfo' member to
mips_opcode to extend number of available bits"),
<https://sourceware.org/ml/binutils/2005-01/msg00261.html>, and add a
help text for the `-M no-aliases' disassembler option.

opcodes/
* mips-dis.c (print_mips_disassembler_options): Add
`no-aliases'.

6e3d1f0 2017-04-25 19:55:34 Maciej W. Rozycki

MIPS16/opcodes: Annotate instruction aliases

Complement commit 986e18a5a9fd ("Add a second 'pinfo' member to
mips_opcode to extend number of available bits"),
<https://sourceware.org/ml/binutils/2005-01/msg00261.html>, and annotate
MIPS16 NOP, LA, DLA and the synthetic forms of LD and LW instructions as
aliases. These correspond to MOVE, and the PC-relative ADDIU, DADDIU,
LD and LW hardware instructions respectively.

binutils/
* testsuite/binutils-all/mips/mips16-alias.d: New test.
* testsuite/binutils-all/mips/mips16-noalias.d: New test.
* testsuite/binutils-all/mips/mips16-alias.s: New test source.
* testsuite/binutils-all/mips/mips.exp: Run the new tests.

opcodes/
* mips16-opc.c (AL): New macro.
(mips16_opcodes): Mark "nop", "la", "dla", and synthetic forms
of "ld" and "lw" as aliases.

adc1273 2017-04-25 19:53:45 Maciej W. Rozycki

MIPS/GAS: Correct BFD_RELOC_MIPS16_16_PCREL_S1 fixup size

Correct the size of a BFD_RELOC_MIPS16_16_PCREL_S1 fixup made in
`md_convert_frag', fixing a bug introduced with commit c9775dde3277
("MIPS16: Add R_MIPS16_PC16_S1 branch relocation support)". Add test
cases to verify that the overflow of this fixup's in-place addend is
still correctly detected.

gas/
* config/tc-mips.c (md_convert_frag): Correct
BFD_RELOC_MIPS16_16_PCREL_S1 fixup size.
* testsuite/gas/mips/mips16-branch-addend-4.d: New test.
* testsuite/gas/mips/mips16-branch-addend-5.d: New test.
* testsuite/gas/mips/mips16-branch-addend-5.l: New stderr
output.
* testsuite/gas/mips/mips16-branch-addend-4.s: New test source.
* testsuite/gas/mips/mips16-branch-addend-5.s: New test source.
* testsuite/gas/mips/mips.exp: Run the new tests.

debed3d 2017-04-25 18:58:57 Pedro Alves

Fix build on gcc < 5 (std::is_trivially_copyable missing)

Ref: https://sourceware.org/ml/gdb-patches/2017-04/msg00660.html

Simply skip the poisoning on older compilers.

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

* common/poison.h [!HAVE_IS_TRIVIALLY_COPYABLE] (IsRelocatable)
(BothAreRelocatable, memcopy, memmove): Don't define.
* common/traits.h (__has_feature, HAVE_IS_TRIVIALLY_COPYABLE): New
macros.

d28b636 2017-04-25 18:40:43 Jose E. Marchesi

gas: sparc: fix relaxation of CALL instruction into branches in a.out targets

This patch avoids CALL instructions to be optimized into branches if
the symbols referred to in the CALL instruction are not fully resolved
at the time the assembler writes its output.

Tested in sparc64-linux-gnu and sparc-sun-sunos4.1.3 targets.
No regressions.

gas/ChangeLog:

2017-04-25 Jose E. Marchesi <jose.marchesi@oracle.com>

PR gas/21407
* config/tc-sparc.c (md_apply_fix): Do not transform `call'
instructions into branch instructions in fixups generating
additional relocations.
* testsuite/gas/sparc/call-relax.s: New file.
* testsuite/gas/sparc/call-relax.d: Likewise.
* testsuite/gas/sparc/call-relax-aout.d: Likewise.
* testsuite/gas/sparc/sparc.exp: Test call-relax and call-relax-aout.

b0b92ae 2017-04-25 09:46:19 Pedro Alves

Poison non-POD memset & non-trivially-copyable memcpy/memmove

This patch catches invalid initialization of non-POD types with
memset, at compile time.

This is what I used to catch the problems fixed by the previous
patches in the series:

$ make -k 2>&1 | grep "deleted function"
src/gdb/breakpoint.c:951:53: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = bp_location; <template-parameter-1-2> = void; size_t = long unsigned int]’
src/gdb/breakpoint.c:7325:32: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = bp_location; <template-parameter-1-2> = void; size_t = long unsigned int]’
src/gdb/btrace.c:1153:42: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = btrace_insn; <template-parameter-1-2> = void; size_t = long unsigned int]’
...

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

* common/common-defs.h: Include "common/poison.h".
* common/function-view.h: (Not, Or, Requires): Move to traits.h
and adjust.
* common/poison.h: New file.
* common/traits.h: Include <type_traits>.
(Not, Or, Requires): New, moved from common/function-view.h.

16c4d54 2017-04-25 09:45:21 Pedro Alves

Don't memset non-POD types: struct breakpoint

Eh, struct breakpoint was made non-POD just today, with commit
d28cd78ad820e3 ("Change breakpoint event locations to
event_location_up"). :-)

src/gdb/breakpoint.c: In function ‘void init_raw_breakpoint_without_location(breakpoint*, gdbarch*, bptype, const breakpoint_ops*)’:
src/gdb/breakpoint.c:7447:28: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = breakpoint; <template-parameter-1-2> = void; size_t = long unsigned int]’
memset (b, 0, sizeof (*b));
^
In file included from src/gdb/common/common-defs.h:85:0,
from src/gdb/defs.h:28,
from src/gdb/breakpoint.c:20:
src/gdb/common/poison.h:56:7: note: declared here
void *memset (T *s, int c, size_t n) = delete;
^

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

* breakpoint.h (struct breakpoint): In-class initialize all
fields. Make boolean fields "bool".
* breakpoint.c (init_raw_breakpoint_without_location): Remove
memset call and initializations no longer necessary.

b5c3668 2017-04-25 09:43:52 Pedro Alves

Don't memset non-POD types: struct btrace_insn

struct btrace_insn is not a POD [1] so we shouldn't be using memset to
initialize it [2].

Use list-initialization instead, wrapped in a "pt insn to btrace insn"
function, which looks like just begging to be added next to the
existing pt_reclassify_insn/pt_btrace_insn_flags functions.

[1] - because its field "flags" is not POD, because enum_flags has a
non-trivial default ctor.

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

* btrace.c (pt_btrace_insn_flags): Change parameter type to
reference.
(pt_btrace_insn): New function.
(ftrace_add_pt): Remove memset call and use pt_btrace_insn.

5625a28 2017-04-25 09:43:06 Pedro Alves

Don't memset non-POD types: struct bp_location

struct bp_location is not a POD, so we shouldn't be using memset to
initialize it.

Caught like this:

src/gdb/breakpoint.c: In function ‘bp_location** get_first_locp_gte_addr(CORE_ADDR)’:
src/gdb/breakpoint.c:950:53: error: use of deleted function ‘void* memset(T*, int, size_t) [with T = bp_location; <template-parameter-1-2> = void; size_t = long unsigned int]’
memset (&dummy_loc, 0, sizeof (struct bp_location));
^
In file included from src/gdb/defs.h:28:0,
from src/gdb/breakpoint.c:20:
src/gdb/common/common-defs.h:126:7: note: declared here
void *memset (T *s, int c, size_t n) = delete;
^

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

* ada-lang.c (ada_catchpoint_location): Now a "class". Remove
"base" field and inherit from "bp_location" instead. Add
non-default ctor.
(allocate_location_exception): Use new non-default ctor.
* breakpoint.c (get_first_locp_gte_addr): Remove memset call.
(init_bp_location): Convert to ...
(bp_location::bp_location): ... this new ctor, and remove memset
call.
(base_breakpoint_allocate_location): Use the new non-default ctor.
* breakpoint.h (bp_location): Now a class. Declare default and
non-default ctors. In-class initialize all members.
(init_bp_location): Remove declaration.

23bcc18 2017-04-25 09:42:03 Pedro Alves

Don't memcpy non-trivially-copyable types: Make enum_flags triv. copyable

The delete-memcpy-with-non-trivial-types patch exposed many instances
of this problem:

src/gdb/btrace.h: In function ‘btrace_insn_s* VEC_btrace_insn_s_quick_insert(VEC_btrace_insn_s*, unsigned int, const btrace_insn_s*, const char*, unsigned int)’:
src/gdb/common/vec.h:948:62: error: use of deleted function ‘void* memmove(T*, const U*, size_t) [with T = btrace_insn; U = btrace_insn; <template-parameter-1-3> = void; size_t = long unsigned int]’
memmove (slot_ + 1, slot_, (vec_->num++ - ix_) * sizeof (T)); \
^
src/gdb/common/vec.h:436:1: note: in expansion of macro ‘DEF_VEC_FUNC_O’
DEF_VEC_FUNC_O(T) \
^
src/gdb/btrace.h:84:1: note: in expansion of macro ‘DEF_VEC_O’
DEF_VEC_O (btrace_insn_s);
^
[...]
src/gdb/common/vec.h:1060:31: error: use of deleted function ‘void* memcpy(T*, const U*, size_t) [with T = btrace_insn; U = btrace_insn; <template-parameter-1-3> = void; size_t = long unsigned int]’
sizeof (T) * vec2_->num); \
^
src/gdb/common/vec.h:437:1: note: in expansion of macro ‘DEF_VEC_ALLOC_FUNC_O’
DEF_VEC_ALLOC_FUNC_O(T) \
^
src/gdb/btrace.h:84:1: note: in expansion of macro ‘DEF_VEC_O’
DEF_VEC_O (btrace_insn_s);
^

So, VECs (given it's C roots) rely on memcpy/memcpy of VEC elements to
be well defined, in order to grow/reallocate its internal elements
array. This means that we can only put trivially copyable types in
VECs. E.g., if a type requires using a custom copy/move ctor to
relocate, then we can't put it in a VEC (so we use std::vector
instead). But, as shown above, we're violating that requirement.

btrace_insn is currently not trivially copyable, because it contains
an enum_flags field, and that is itself not trivially copyable. This
patch corrects that, by simply removing the user-provided copy
constructor and assignment operator. The compiler-generated versions
work just fine.

Note that std::vector relies on std::is_trivially_copyable too to know
whether it can reallocate its elements with memcpy/memmove instead of
having to call copy/move ctors and dtors, so if we have types in
std::vectors that weren't trivially copyable because of enum_flags,
this will make such vectors more efficient.

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

* common/enum-flags.h (enum_flags): Don't implement copy ctor and
assignment operator.

a49abe0 2017-04-25 09:00:36 GDB Administrator

Automatic date update in version.in

9e9821d 2017-04-25 06:37:12 H.J. Lu

x86-64: Force symbol dynamic if it isn't undefined weak

Force symbol dynamic if it isn't undefined weak. Generate relative
relocation for GOT reference against non-dynamic symbol in PIC to
avoid unnecessary dynamic symbols.

bfd/

* elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
no_finish_dynamic_symbol.
(elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
0.
(elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
weak symbol, don't make it dynamic.
(elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
relocation for GOT reference.
(elf_x86_64_finish_dynamic_symbol): Abort if
no_finish_dynamic_symbol isn't 0.

ld/

* testsuite/ld-x86-64/no-plt.exp: Also check no-plt-1e.nd.
* testsuite/ld-x86-64/no-plt-1e.nd: New file.

0dc9a30 2017-04-25 05:42:33 H.J. Lu

i386: Force symbol dynamic if it isn't undefined weak

Force symbol dynamic if it isn't undefined weak. Generate R_386_RELATIVE
relocation for R_386_GOT32 relocation against non-dynamic symbol in PIC.

PR ld/21402
* elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
undefined weak symbol, don't make it dynamic.
(elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
set no_finish_dynamic_symbol and generate R_386_RELATIVE
relocation for R_386_GOT32.

e1ba305 2017-04-25 05:29:12 Yao Qi

Use floatformat_totalsize_bytes

The code can be replaced by floatformat_totalsize_bytes.

gdb:

2017-04-24 Yao Qi <yao.qi@linaro.org>

* doublest.c (convert_doublest_to_floatformat): Call
floatformat_totalsize_bytes.

e662f84 2017-04-25 01:46:04 H.J. Lu

i386: Skip pr12570 tests for nacl targets

commit f129e49f4d07f4d36319ac757fdcf3a8ce7d605b
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Jan 10 11:30:25 2017 -0800

Don't use elf_i386_eh_frame_plt directly

fixed i386 PLT eh_frame generation. Skip pr12570 tests since they are
for non-nacl targets.

* testsuite/ld-i386/pr12570a.d: Skip for nacl targets.
* testsuite/ld-i386/pr12570b.d: Likewise.

1587442 2017-04-25 01:37:10 H.J. Lu

i386: Set ELF_MAXPAGESIZE to 0x1000 for VxWorks

commit a27e437177412e5b52999723f3c5d5d0d37b9087
Author: Roland McGrath <roland@gnu.org>
Date: Thu Jul 28 22:35:15 2011 +0000

BFD vector for elf32-i386-nacl:

changed ELF_MAXPAGESIZE to 0x10000 for VxWorks. This patch fixes it
and updated testsuite/ld-i386/vxworks2.sd to add space for program
headers.

bfd/

PR ld/21425
* elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.

ld/

PR ld/20815
* testsuite/ld-i386/vxworks2.sd: Add space for program headers.

5344555 2017-04-24 22:51:24 Thomas Preud'homme

[GAS/ARM] Fix expansion of ldr pseudo instruction

The LDR rX, =cst pseudo-instruction suffers from two issues for loading
integer constants in Thumb mode:

- movs is used if the constant and register can be encoded using that
instruction which leads to unexpected behavior due to its flag-setting
behavior
- mov.w, movw and mvn are used for r13 (sp) and r15 (pc) but these
encoding are marked as UNPREDICTABLE

This patch fixes those issues and update testing accordingly.

2017-04-24 Thomas Preud'homme <thomas.preudhomme@arm.com>

gas/
* config/tc-arm.c (move_or_literal_pool): Remove code generating MOVS.
Forbid MOV.W and MOVW if destination is SP or PC.
* testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.s: Explain
expectation of LDR not generating a MOVS for low registers and small
constants. Add tests of MOVW generation.
* testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.d: Update
expected disassembly.

8b353c4 2017-04-24 21:31:31 Jose E. Marchesi

ld: fix regressions with rett instructions in sparc tests.

A few tests in the ld testsuite were expecting the disassembler to
emit `rett' instructions in V9. This patch updates the tests to
expect `return' instead.

ld/ChangeLog:

2017-04-24 Jose E. Marchesi <jose.marchesi@oracle.com>

* testsuite/ld-sparc/tlssunbin64.dd: Expect `return' instructions
instead of `rett' in V9.
* testsuite/ld-sparc/tlssunnopic64.dd: Likewise.
* testsuite/ld-sparc/tlssunpic64.dd: Likewise.

957f6b3 2017-04-24 19:55:44 Tamar Christina

Fix snafu in aarch64 opcodes debugging statement.

* aarch64-opc.c (aarch64_logical_immediate_p): Update DEBUG_TRACE
arguments.

9ad8982 2017-04-24 09:00:39 GDB Administrator

Automatic date update in version.in

4235484 2017-04-23 20:03:35 Alan Modra

PR 21418, ar -N lacks arg check

PR 21418
* ar.c (main): Check -a, -b, -i and -N args are given.

7034215 2017-04-23 20:03:35 Alan Modra

PR 21417, ar arg check failure

PR 21417
* ar.c (main): Check that an archive file is given after options.

b02cd3e 2017-04-23 20:03:35 Alan Modra

PR 21415, objdump fails to check bfd_get_section_contents status

PR 21415
* objdump.c (disassemble_section): Check bfd_get_section_contents
status.