• 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/hjl/pr19818
RSS
修訂. 時間 作者
2159c3f users/hjl/pr19818 2016-03-14 21:38:24 H.J. Lu

Properly handle relocs against absolute symbols

Relocations against absolute symbols in shared object should be resolved
at link-time if symbols are bounded locally. For PC-relative relocation
against absolute symbols, they should be converted to non-PC-relative
relocation in target backend. If conversion can't be performed, target
backend should detect it and issue an error. This patch only fixes x86
backends.

bfd/

PR ld/19818
* bfd-in.h (bfd_elf_record_link_assignment): Add a bfd_boolean.
* bfd-in2.h: Regenerated.
* elf-bfd.h (elf_link_hash_entry): Add def_linker and
def_linker_abs.
(RESOLVED_TO_ABS_IN_PIC): New macro.
* elf32-i386.c (RESOLVED_TO_ZERO_OR_ABS): New macro.
(elf_i386_allocate_dynrelocs): Replace
UNDEFINED_WEAK_RESOLVED_TO_ZERO with RESOLVED_TO_ZERO_OR_ABS.
Discard space for non-pc-relative relocs against symbols which
are always resolved at link-time.
(elf_i386_convert_load): Replace UNDEFINED_WEAK_RESOLVED_TO_ZERO
with RESOLVED_TO_ZERO_OR_ABS.
(elf_i386_relocate_section): Replace
UNDEFINED_WEAK_RESOLVED_TO_ZERO with RESOLVED_TO_ZERO_OR_ABS.
Properly handle R_386_32 relocation against absolute symbol.
* elf64-x86-64.c (RESOLVED_TO_ZERO_OR_ABS): New macro.
(elf_x86_64_need_pic): Updated to check absolute symbol.
(elf_x86_64_check_relocs): Don't check R_X86_64_32 nor
R_X86_64_32S in shared object here. Use elf_x86_64_need_pic.
(elf_x86_64_allocate_dynrelocs): Replace
UNDEFINED_WEAK_RESOLVED_TO_ZERO with RESOLVED_TO_ZERO_OR_ABS.
Discard space for non-pc-relative relocs against symbols which
are always resolved at link-time.
(elf_x86_64_convert_load): Replace UNDEFINED_WEAK_RESOLVED_TO_ZERO
with RESOLVED_TO_ZERO_OR_ABS. Check def_linker for linker
defined symbol.
(elf_x86_64_relocate_section): Replace
UNDEFINED_WEAK_RESOLVED_TO_ZERO with RESOLVED_TO_ZERO_OR_ABS.
Properly handle R_X86_64_PC32, R_X86_64_32, R_X86_64_32S amd
R_X86_64_64 relocations against absolute symbol.
* elflink.c (bfd_elf_record_link_assignment): Updated. Set
def_linker and defsym.

ld/

PR ld/19818
* emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment):
Pass "exp->assign.defsym || !expld.rel_from_abs" to
bfd_elf_record_link_assignment.
(gld${EMULATION_NAME}_before_allocation): Set def_linker for
"__ehdr_start".
* testsuite/ld-i386/i386.exp: Run PR ld/19818 tests.
* testsuite/ld-x86-64/x86-64.exp: Likewise.
* testsuite/ld-elf/pr19818a.d: New file.
* testsuite/ld-elf/pr19818a.s: Likewise.
* testsuite/ld-elf/pr19818b.d: Likewise.
* testsuite/ld-elf/pr19818b.s: Likewise.
* testsuite/ld-i386/pr19818-1.t: Likewise.
* testsuite/ld-i386/pr19818-1a.d: Likewise.
* testsuite/ld-i386/pr19818-1a.s: Likewise.
* testsuite/ld-i386/pr19818-1b.d: Likewise.
* testsuite/ld-i386/pr19818-1b.s: Likewise.
* testsuite/ld-i386/pr19818-1c.d: Likewise.
* testsuite/ld-i386/pr19818-1c.s: Likewise.
* testsuite/ld-i386/pr19818-1d.d: Likewise.
* testsuite/ld-i386/pr19818-1e.d: Likewise.
* testsuite/ld-i386/pr19818-1f.d: Likewise.
* testsuite/ld-i386/pr19818-1g.d: Likewise.
* testsuite/ld-i386/pr19818-1h.d: Likewise.
* testsuite/ld-i386/pr19818-1i.d: Likewise.
* testsuite/ld-i386/pr19818-1j.d: Likewise.
* testsuite/ld-i386/pr19818-1k.d: Likewise.
* testsuite/ld-i386/pr19818-1l.d: Likewise.
* testsuite/ld-i386/pr19818-2.s: Likewise.
* testsuite/ld-i386/pr19818-2a.d: Likewise.
* testsuite/ld-i386/pr19818-2b.d: Likewise.
* testsuite/ld-i386/pr19818-2c.d: Likewise.
* testsuite/ld-i386/pr19818-2d.d: Likewise.
* testsuite/ld-i386/pr19818-2e.d: Likewise.
* testsuite/ld-i386/pr19818-2f.d: Likewise.
* testsuite/ld-i386/pr19818-2g.d: Likewise.
* testsuite/ld-i386/pr19818-2h.d: Likewise.
* testsuite/ld-x86-64/pr19818-1.t: Likewise.
* testsuite/ld-x86-64/pr19818-1a.d: Likewise.
* testsuite/ld-x86-64/pr19818-1a.s: Likewise.
* testsuite/ld-x86-64/pr19818-1b.d: Likewise.
* testsuite/ld-x86-64/pr19818-1b.s: Likewise.
* testsuite/ld-x86-64/pr19818-1c.d: Likewise.
* testsuite/ld-x86-64/pr19818-1c.s: Likewise.
* testsuite/ld-x86-64/pr19818-1d.d: Likewise.
* testsuite/ld-x86-64/pr19818-1e.d: Likewise.
* testsuite/ld-x86-64/pr19818-1f.d: Likewise.
* testsuite/ld-x86-64/pr19818-1g.d: Likewise.
* testsuite/ld-x86-64/pr19818-1h.d: Likewise.
* testsuite/ld-x86-64/pr19818-1i.d: Likewise.
* testsuite/ld-x86-64/pr19818-1j.d: Likewise.
* testsuite/ld-x86-64/pr19818-1k.d: Likewise.
* testsuite/ld-x86-64/pr19818-1l.d: Likewise.
* testsuite/ld-x86-64/pr19818-1m.d: Likewise.
* testsuite/ld-x86-64/pr19818-1n.d: Likewise.
* testsuite/ld-x86-64/pr19818-1o.d: Likewise.
* testsuite/ld-x86-64/pr19818-1p.d: Likewise.
* testsuite/ld-x86-64/pr19818-1q.d: Likewise.
* testsuite/ld-x86-64/pr19818-1r.d: Likewise.
* testsuite/ld-x86-64/pr19818-1s.d: Likewise.
* testsuite/ld-x86-64/pr19818-1t.d: Likewise.
* testsuite/ld-x86-64/pr19818-1u.d: Likewise.
* testsuite/ld-x86-64/pr19818-1v.d: Likewise.
* testsuite/ld-x86-64/pr19818-1w.d: Likewise.
* testsuite/ld-x86-64/pr19818-1x.d: Likewise.
* testsuite/ld-x86-64/pr19818-1y.d: Likewise.
* testsuite/ld-x86-64/pr19818-2.s: Likewise.
* testsuite/ld-x86-64/pr19818-2a.d: Likewise.
* testsuite/ld-x86-64/pr19818-2b.d: Likewise.
* testsuite/ld-x86-64/pr19818-2c.d: Likewise.
* testsuite/ld-x86-64/pr19818-2d.d: Likewise.
* testsuite/ld-x86-64/pr19818-3.s: Likewise.
* testsuite/ld-x86-64/pr19818-3a.d: Likewise.
* testsuite/ld-x86-64/pr19818-3b.d: Likewise.
* testsuite/ld-x86-64/pr19818-3c.d: Likewise.
* testsuite/ld-x86-64/pr19818-3d.d: Likewise.
* testsuite/ld-x86-64/pr19818-4.s: Likewise.
* testsuite/ld-x86-64/pr19818-4a.d: Likewise.
* testsuite/ld-x86-64/pr19818-4b.d: Likewise.
* testsuite/ld-x86-64/pr19818-5.s: Likewise.
* testsuite/ld-x86-64/pr19818-5a.d: Likewise.
* testsuite/ld-x86-64/pr19818-5b.d: Likewise.

d834e63 2016-03-14 09:00:10 GDB Administrator

Automatic date update in version.in

3ab94f9 2016-03-14 00:57:10 H.J. Lu

Add more tests for PR ld/19539

PR ld/19539
* testsuite/ld-i386/i386.exp: Run pr19539.
* testsuite/ld-i386/pr19539.d: New file.
* testsuite/ld-i386/pr19539.s: Likewise.
* testsuite/ld-i386/pr19539.t: Likewise.
* testsuite/ld-x86-64/pr19539.s: Likewise.
* testsuite/ld-x86-64/pr19539.t: Likewise.
* testsuite/ld-x86-64/pr19539a.d: Likewise.
* testsuite/ld-x86-64/pr19539b.d: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pr19539a and pr19539b.

70104a9 2016-03-13 18:52:26 Marcin Kościelnicki

gdb/s390: Fill gen_return_address hook.

gdb/ChangeLog:

* s390-linux-tdep.c (s390_gen_return_address): New function.
(s390_gdbarch_init): Fill gen_return_address hook.

724cd46 2016-03-13 09:00:14 GDB Administrator

Automatic date update in version.in

237a5ee 2016-03-12 09:00:20 GDB Administrator

Automatic date update in version.in

f2403c3 2016-03-12 07:48:21 Andrew Burgess

gdb: New maint info line-table command.

Add a new command 'maint info line-table' to display the contents of
GDB's internal line table structure. Useful when trying to understand
problems (within gdb) relating to line tables.

gdb/ChangeLog:

* symmisc.c (maintenance_info_line_tables): New function.
(maintenance_print_one_line_table): New function.
(_initialize_symmisc): Register 'maint info line-table' command.
* NEWS: Mention new command.

gdb/doc/ChangeLog:

* gdb.texinfo (Symbols): Document new 'maint info line-table'
command.

gdb/testsuite/ChangeLog:

* gdb.base/maint.exp: New tests for 'maint info line-table'.

c4b3e54 2016-03-11 19:02:49 Marcin Kościelnicki

gdb/s390: Fill pseudo register agent expression hooks.

gdb/ChangeLog:

* s390-linux-tdep.c (s390_ax_pseudo_register_collect): New function.
(s390_ax_pseudo_register_push_stack): New function.
(s390_gdbarch_init): Fill ax_pseudo_register_collect and
ax_pseudo_register_push_stack hooks.

37b01f6 2016-03-11 18:17:28 Dan Gissel

Fix some places where octet to byte conversions are needed.

PR 19713
* elf.c (_bfd_elf_section_offset): Ensure that the returned offset
uses bytes not octets.
* elflink.c (resolve_section): Likewise.
Add a bfd parameter.
(eval_section): Pass the input_bfd to resolve_section.
(bfd_elf_perform_complex_relocation): Convert byte offset to
octets before read and writing values.
(elf_link_input_bfd): Add byte to octet conversions.
(elf_reloc_link_order): Likewise.
(elf_fixup_link_order): Likewise.
(bfd_elf_final_link): Likewise.
* reloc.c (_bfd_final_link_relocate): Likewise.
* syms.c (_bfd_stab_section_find_nearest_line): Likewise.

aa66781 2016-03-11 09:00:18 GDB Administrator

Automatic date update in version.in

f2f3ccb 2016-03-11 07:12:30 Simon Marchi

Add $_as_string convenience function

This patch is a follow-up to "Add printf format specifier for printing
enumerator":

https://sourceware.org/ml/gdb-patches/2016-02/msg00144.html

Instead of having a solution specific to the printf command, Pedro
suggested adding a general purpose function $_as_string() that would
cover this use case and more.

So, in order to print the textual label of an enum, one can use:

(gdb) printf "Visiting node of type %s\n", $_as_string(node)
Visiting node of type NODE_INTEGER

gdb/ChangeLog:

* data-directory/Makefile.in (PYTHON_FILE_LIST): Install
gdb/function/as_string.py.
* python/lib/gdb/function/as_string.py: New file.
* NEWS: Mention the new $_as_string function.

gdb/testsuite/ChangeLog:

* gdb.python/py-as-string.exp: New file.
* gdb.python/py-as-string.c: New file.

gdb/doc/ChangeLog:

* gdb.texinfo (Convenience Functions): Document $_as_string.

a9f02af 2016-03-11 01:06:35 Mickael Guene

PR gas/19744: Thumb-1 pcrop relocations don't work on Thumb-2 targets

gas/
* config/tc-arm.c (do_arit): Protect against bad relocations usage.
(do_mov): Likewise.
(do_t_add_sub): Allow pcrop relocations for Thumb-2 targets.
(do_t_mov_cmp): Likewise.
(do_t_add_sub): Protect against bad relocations usage.
(do_t_mov_cmp): Likewise.

gas/testsuite/
* gas/arm/adds-thumb1-reloc-local-armv7-m.s: New.
* gas/arm/adds-thumb1-reloc-local-armv7-m.d: New.
* gas/arm/movs-thumb1-reloc-local-armv7-m.s: New.
* gas/arm/movs-thumb1-reloc-local-armv7-m.d: New.

ld/
* testsuite/ld-arm/arm-elf.exp: New tests.
* testsuite/ld-arm/thumb1-adds-armv7-m.s: New.
* testsuite/ld-arm/thumb1-movs-armv7-m.s: New.

3ed4ff9 2016-03-11 00:29:42 Nick Clifton

Mark the i370 target as obsolete.

* config.bfd: Mark the i370 target as obsolete.

878a687 2016-03-10 19:37:19 Nick Clifton

Remove bogus LONG(0) from MSP430 built in linker script.

ld * scripttempl/elf32msp430.sc (.rodata): Remove spurious LONG(0).

a2d97d7 2016-03-10 09:00:18 GDB Administrator

Automatic date update in version.in

00dbd49 2016-03-10 05:24:14 Pedro Alves

More "Program" -> "Thread NN received signal" testsuite adjustment

These tests should have been adjusted by f303dbd60d9c (Fix PR
threads/19422 - show which thread caused stop), but clearly I had
missed grepping for potential-fail cases.

gdb/testsuite/ChangeLog
2016-03-09 Pedro Alves <palves@redhat.com>

* gdb.threads/attach-into-signal.exp: Adjust to "Program received
signal" -> "Thread NN received signal" output change.
* gdb.threads/ia64-sigill.exp: Likewise.
* gdb.threads/linux-dp.exp: Likewise.
* gdb.threads/manythreads.exp: Likewise.
* gdb.threads/pending-step.exp: Likewise.
* gdb.threads/print-threads.exp: Likewise.
* gdb.threads/sigstep-threads.exp: Likewise.
* gdb.threads/staticthreads.exp: Likewise.
* gdb.threads/tls.exp: Likewise.

2343b78 2016-03-10 04:17:54 Jose E. Marchesi

gdb: fix doc string of target_can_use_hardware_watchpoint.

gdb/ChangeLog

2016-03-09 Jose E. Marchesi <jose.marchesi@oracle.com>

* target.h: Fix doc string of target_can_use_hardware_watchpoint.

b69d38a 2016-03-10 03:25:00 Pedro Alves

Command line input handling TLC

I didn't manage to usefully split this further into smaller
independent pieces, so:

- Use "struct buffer" more.

- Split out the responsibility of composing a complete command line
from multiple input lines split with backslash

(
E.g.:

(gdb) print \
1 + \
2
$1 = 3
(gdb)
)

to a separate function. Note we don't need the separate
readline_input_state and more_to_come globals at all. They were
just obfuscating the logic.

- Factor out the tricky mostly duplicated code in
command_line_handler and command_line_input.

gdb/ChangeLog
2016-03-09 Pedro Alves <palves@redhat.com>

* event-top.c (more_to_come): Delete.
(struct readline_input_state): Delete.
(readline_input_state): Delete.
(get_command_line_buffer): New function.
(command_handler): Update comments. Don't handle NULL commands
here. Do not execute commented lines.
(command_line_append_input_line): New function.
(handle_line_of_input): New function, partly based on
command_line_handler and command_line_input.
(command_line_handler): Rewrite.
* event-top.h (command_handler): New declaration.
(command_loop): Defer command execution to command_handler.
(command_line_input): Update comments. Simplify, using struct
buffer and handle_line_of_input.
* top.h (struct buffer): New forward declaration.
(handle_line_of_input): New declaration.

2669cad 2016-03-10 03:25:00 Pedro Alves

Simplify saved_command_line handling

There doesn't seem to be much point in trying to reuse this buffer.
Prefer simplicity instead.

(In case you're wondering whether this fixes an off-by-one: linelength
is misnamed; it's really a size including terminating null char.)

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* event-top.c (command_line_handler): Use xfree + xstrdup instead
of xrealloc + strcpy.
* main.c (captured_main): Use xstrdup instead of xmalloc plus
manual clear.
* top.c (saved_command_line): Rewrite comment.
(saved_command_line_size): Delete.
(command_line_input): Use xfree + xstrdup instead of xrealloc +
strcpy.
* top.h (saved_command_line_size): Delete declaration.

187212b 2016-03-10 03:25:00 Pedro Alves

Use struct buffer in gdb_readline_no_editing_callback

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* event-top.c: Include buffer.h.
(gdb_readline_no_editing_callback): Use struct buffer instead
of xrealloc.

7a3bde3 2016-03-10 03:25:00 Pedro Alves

Use struct buffer in gdb_readline_no_editing

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* common/buffer.h (buffer_grow_char): New function.
* top.c: Include buffer.h.
(gdb_readline_no_editing): Rename 'prompt_arg' parameter to
'prompt'. Use struct buffer instead of xrealloc.

c5c136e 2016-03-10 03:24:59 Pedro Alves

gdb_readline -> gdb_readline_no_editing

Name this such that it's clearer that this is not a wrapper for the
real readline, but instead a replacement that provides no command line
editing features.

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* defs.h (gdb_readline): Delete declaration.
* top.c (gdb_readline): Rename to ...
(gdb_readline_no_editing): ... this, and make static.

720d2e9 2016-03-10 03:24:59 Pedro Alves

Update prompt_for_continue comments

These comments are out of date -- we no longer call gdb_readline. And
I think that mentioning the event loop is more useful here than
whatever GO32 issue had with gdb_readline, which may even no longer be
an issue.

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* utils.c (prompt_for_continue): Update comments.

608ff01 2016-03-10 03:24:59 Pedro Alves

Eliminate async_annotation_suffix

The comments and existence of this global are a bit of misleading
obfuscation, since this is only ever used to print the prompt
annotation, and never changes. Just hardcode "prompt" where
necessary, as done for most other annotations.

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* event-top.c (async_annotation_suffix): Delete.
(top_level_prompt, command_line_handler): Don't use
'async_annotation_suffix' and simplify.
* event-top.h (async_annotation_suffix): Delete declaration.
(init_main): Remove reference to 'async_annotation_suffix'.

c70061c 2016-03-10 03:24:59 Pedro Alves

gdb_readline2 -> gdb_readline_no_editing_callback

The "2" in "gdb_readline2" doesn't really convey much. Rename for
clarity.

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* event-top.c (gdb_readline2): Rename to ...
(gdb_readline_no_editing_callback): ... this.
(change_line_handler, stdin_event_handler)
(gdb_setup_readline): Adjust.
* event-top.h (gdb_readline2): Rename to ...
(gdb_readline_no_editing_callback): ... this, and move closer to
other readline-related declarations.
* mi/mi-interp.c (mi_interpreter_resume): Adjust.

8a24383 2016-03-10 03:24:59 Pedro Alves

Garbage collect window_hook

I checked, and Insight doesn't set this.

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* top.c (window_hook): Delete.
(command_loop): Remove references to window_hook.

c32e870 2016-03-10 03:24:58 Pedro Alves

Test issuing a command split in multiple lines with continuation chars

I happened to break this locally and the testsuite didn't notice it.
Add some tests.

gdb/ChangeLog:
2016-03-09 Pedro Alves <palves@redhat.com>

* gdb.base/command-line-input.exp: New file.

b04fd3b 2016-03-10 02:47:46 Marcin Kościelnicki

gdb: Add tracepoint support for powerpc.

gdb/gdbserver/ChangeLog:

* linux-ppc-low.c (ppc_supports_tracepoints): New function.
(struct linux_target_ops): Wire in the above.

gdb/testsuite/ChangeLog:

* gdb.trace/ftrace.exp: Set arg0exp for ppc.
* gdb.trace/mi-trace-unavailable.exp: Set pcnum for ppc.
* gdb.trace/pending.exp: Accept leading dot before function name.
* gdb.trace/trace-common.h: Add fast tracepoint dummy insn for ppc.
* lib/trace-support.exp: Set registers for ppc.

98fa59e 2016-03-10 02:47:11 Marcin Kościelnicki

gdb.trace/entry-values.exp: Fixes for powerpc64.

On powerpc64, "disassemble foo" doesn't work properly on object files
(it can't process the relocations in .opd section) - instead, let's
link it into an executable and load that.

Also, backtrace displays .main, not main. Accept both.

gdb/testsuite/ChangeLog:

* gdb.trace/entry-values.exp: Link ${binfile}1.o to ${binfile}1 and
use it for disassembly; accept .main in addition to main in backtrace.

f77198c 2016-03-10 02:46:12 Marcin Kościelnicki

gdb.trace/tfind.exp: Force call via global entry point on ppc64le.

tfind.exp sets a breakpoint on *gdb_recursion_test, which is the global
entry point on ppc64le, and won't be hit, since the call uses
the local entry. Fix by calling the function via a pointer in a global
variable, forcing use of the global entry.

This patch is a slightly modified hunk extracted from
https://sourceware.org/ml/gdb-patches/2015-07/msg00353.html

gdb/testsuite/ChangeLog:

2016-03-09 Wei-cheng Wang <cole945@gmail.com>
Marcin Kościelnicki <koriakin@0x04.net>

* gdb.trace/actions.c (gdb_recursion_test_fp): New typedef.
(gdb_recursion_test_ptr): New global variable.
(gdb_recursion_test): Call gdb_recursion_test_ptr instead of
gdb_recursion_test.
(gdb_c_test): Ditto.