• 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/hjl/pr17878
RSS
Rev. Time Author
58002c6 users/hjl/pr17878 2015-02-12 08:30:03 H.J. Lu

Support -plugin-opt=disable-output

LLVM plugin uses --plugin-opt=disable-output to disable output.
all_symbols_read_hook() calls exit() to disable output when
--plugin-opt=disable-output is passed to LLVM plugin. This patch
registers plugin_cleanup() with atexit(), which removes output file
if --plugin-opt=disable-output is used.

PR ld/17878
* configure.ac: Check if atexit exists.
* config.in: Regenerated.
* configure: Likewise.
* plugin.c (plugin_t): Add disable_output.
(plugin_opt_plugin_arg): Set disable_output for disable-output.
(plugin_cleanup): New.
(plugin_load_plugins): Register plugin_cleanup() with atexit().

88b9e2e 2015-02-12 07:10:07 H.J. Lu

Add --[no-]map-whole-files for gold compatibility

Gold supports:

--map-whole-files Map whole files to memory (default on 64-bit hosts)
--no-map-whole-files Map relevant file parts to memory (default on 32-bit hosts)

This patch adds --[no-]map-whole-files command line options for gold
compatibility. They are ignored for ld.

* lexsup.c (ld_options): Add --[no-]map-whole-files for gold
option compatibility.

45e8135 2015-02-12 07:00:51 H.J. Lu

Output "warning:" or "error:" in plugin messages

When plugin generates LDPL_WARNING, LDPL_FATAL and LDPL_ERROR messages,
linker should display "warning:" or "error:" in plugin messages like
regular linker messages.

ld/

* plugin.c (message): Output "warning:" for LDPL_WARNING. Output
"error:" for LDPL_FATAL and LDPL_ERROR.
* testplug2.c (parse_option): Handle fatal, error and warning.

ld/testsuite/

* ld-plugin/plugin-27.d: New.
* ld-plugin/plugin-28.d: Likewise.
* ld-plugin/plugin-29.d: Likewise.
* plugin.exp (plugin_tests): Add tests for LDPL_FATAL, LDPL_ERROR
and LDPL_WARNING.

e3001fd 2015-02-12 06:35:07 H.J. Lu

Remove unused dump_tv_tag

* testplug2.c (dump_tv_tag): Removed.
(onall_symbols_read): Return LDPS_ERR if the file descriptor isn't
closed.
* testplug3.c (dump_tv_tag): Removed.
(onclaim_file): Fix typo.

90092e7 2015-02-11 23:36:39 Nick Clifton

Fixes a problem with the RL78 disassembler which would incorrectly disassemble [HL+0] as [HL].

* rl78-decode.opc: Add 'a' attribute to instructions that support
[HL+0] addressing.
* rl78-decode.c: Regenerate.
* rl78-dis.c (print_insn_rl78): Display the offset in [HL+0]
addresses.

aa31c46 2015-02-11 23:35:27 Jiong Wang

[AArch64] Fix code formatting in the cpu-table

2015-02-11 Matthew Wahab <matthew.wahab@arm.com>

* config/tc-aarch64.c (aarch64_cpus): Fix code formatting.

63cc30e 2015-02-11 22:53:14 Jan Kratochvil

framefilter quit: New test

It definitely does not test all the RETURN_MASK_ERROR cases. But it tests at
least two of them.

gdb/testsuite/ChangeLog
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>

* gdb.python/py-framefilter.exp (pagination quit - *): New tests.

e1fcd57 2015-02-11 22:50:09 Jan Kratochvil

framefilter quit: Use RETURN_MASK_ERROR

Now when the code is exception safe we can let RETURN_QUIT to pass through as
all the installed cleanups with handle that.

gdb/ChangeLog
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_single_arg, enumerate_locals)
(py_print_frame): Use RETURN_MASK_ERROR.

4185814 2015-02-11 22:46:30 Chen Gang

sim/mcore/interp.c: Include "unistd.h".

The related warnings:

gcc -DHAVE_CONFIG_H -DPROFILE=1 -DWITH_PROFILE=-1 -DDEFAULT_INLINE=0 -I. -I../../../binutils-gdb/sim/mcore -I../common -I../../../binutils-gdb/sim/mcore/../common -I../../include -I../../../binutils-gdb/sim/mcore/../../include -I../../bfd -I../../../binutils-gdb/sim/mcore/../../bfd -I../../opcodes -I../../../binutils-gdb/sim/mcore/../../opcodes -g -O2 -c -o interp.o -MT interp.o -MMD -MP -MF .deps/interp.Tpo ../../../binutils-gdb/sim/mcore/interp.c
../../../binutils-gdb/sim/mcore/interp.c: In function ‘handle_trap1’:
../../../binutils-gdb/sim/mcore/interp.c:559:22: warning: implicit declaration of function ‘link’ [-Wimplicit-function-declaration]
cpu.gr[RET1] = link ((char *) a[0], (char *) a[1]);
^
../../../binutils-gdb/sim/mcore/interp.c:585:22: warning: implicit declaration of function ‘access’ [-Wimplicit-function-declaration]
cpu.gr[RET1] = access ((char *) a[0], a[1]);
^

2015-02-11 Chen Gang <gang.chen.5i5j@gmail.com>

* interp.c: Include "unistd.h".

b99bf4e 2015-02-11 22:44:00 Jan Kratochvil

framefilter quit: Make it exception safe

gdb/ChangeLog
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Mention RETURN_QUIT in
function comment. Wrap all function that can throw in cleanups.
(gdbpy_apply_frame_filter): Wrap all function that can throw in
cleanups.

800eb1c 2015-02-11 22:40:14 Jan Kratochvil

framefilter quit: Code cleanup: Avoid gotos

goto error patters are sometimes AFAIK used in C for the cases like:
int retval=-1;
if (!(a=malloc())) goto error;
if (!(b=malloc())) goto error_a;
if (!(c=malloc())) goto error_b;
retval=0;
error_c: free(c);
error_b: free(b);
error_a: free(a);
error: return retval;

But here there is single error label with one do_cleanups() which I do not find
it worth the goto complication. Without goto one can then furher merge code in
the exit paths in the next patches and ... after all it is all the same, just
without a goto.

gdb/ChangeLog
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Substitute goto error.
Remove the error label.

3401906 2015-02-11 22:37:40 Jan Kratochvil

framefilter quit: Code cleanup: Reindentation

Nothing significant but I find code more clear with less deep indentation.

gdb/ChangeLog
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Put conditional code paths
with goto first, indent the former else codepath left. Put variable
'elided' to a new inner block.

8d4a54e 2015-02-11 22:33:48 Jan Kratochvil

framefilter quit: Obvious whitespacing fixes

gdb/ChangeLog
2015-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>

* python/py-framefilter.c (py_print_frame): Whitespacing fixes.

7275e86 2015-02-11 22:16:40 H.J. Lu

Add ChangeLogs for 439b7f41b

b9dc5a8 2015-02-11 22:14:11 H.J. Lu

Add ChangeLogs for commit 5ae0078cd

362beea 2015-02-11 22:05:04 Nick Clifton

Fixes for invalid memory accesses triggered by running readelf on fuzzed binaries.

PR binutils/17531
* dwarf.c (display_debug_pubnames_worker): Work around compiler
bug checking address ranges.
(display_debug_frames): Likewise.
(display_gdb_index): Likewise.
(process_cu_tu_index): Add range check on the ncols value.

439b7f4 2015-02-11 22:02:12 H.J. Lu

Add tests for non-object IR file

This patch adds linker, nm and ar tests for non-object IR file, including
archive with non-object IR member.

ld/

PR ld/17878
* Makefile.am (noinst_LTLIBRARIES): Add libldtestplug2.la and
libldtestplug3.la.
(libldtestplug2_la_SOURCES): New.
(libldtestplug2_la_CFLAGS): Likewise.
(libldtestplug2_la_LDFLAGS): Likewise.
(libldtestplug3_la_SOURCES): New.
(libldtestplug3_la_CFLAGS): Likewise.
(libldtestplug3_la_LDFLAGS): Likewise.
* Makefile.in: Regenerated.
* testplug2.c: New file.
* testplug3.c: Likewise.

ld/testsuite/

PR ld/17878
* ld-plugin/func.c: Add some comments.
* ld-plugin/plugin-13.d: New file.
* ld-plugin/plugin-14.d: Likewise.
* ld-plugin/plugin-15.d: Likewise.
* ld-plugin/plugin-16.d: Likewise.
* ld-plugin/plugin-17.d: Likewise.
* ld-plugin/plugin-18.d: Likewise.
* ld-plugin/plugin-19.d: Likewise.
* ld-plugin/plugin-20.d: Likewise.
* ld-plugin/plugin-21.d: Likewise.
* ld-plugin/plugin-22.d: Likewise.
* ld-plugin/plugin-23.d: Likewise.
* ld-plugin/plugin-24.d: Likewise.
* ld-plugin/plugin-25.d: Likewise.
* ld-plugin/plugin-26.d: Likewise.
* ld-plugin/plugin.exp (plugin2_name): New.
(plugin3_name): Likewise.
(plugin2_path): Likewise.
(plugin3_path): Likewise.
(testsrcfiles): Likewise.
(testsrcfiles_notext): Likewise.
(plugin_tests): Add tests for non-object IR file.
(plugin_lib_tests): Likewise.
(plugin_extra_elf_tests): Likewise.
(plugin_src_tests): New tests for non-object IR file.
Run nm --plugin test.
Run ar --plugin test.
Run plugin_src_tests.

5ae0078 2015-02-11 22:02:12 H.J. Lu

Merge linker plugin handling into BFD plugin support

Linker plugin_maybe_claim is the interface of linker plugin support.
This patch extracts linker plugin_maybe_claim into plugin_object_p and
makes it available to BFD via a new function:

void register_ld_plugin_object_p (const bfd_target *(*) (bfd *));

bfd_plugin_object_p calls plugin_object_p registered by linker first. It
adds an enum bfd_plugin_format field and a pointer to plugin dummy BFD so
that plugin_object_p stores plugin dummy BFD to allow plugin_maybe_claim
to retrieve it later.

bfd/

PR ld/17878
* bfd.c (bfd_plugin_format): New.
(bfd): Add plugin_format and plugin_dummy_bfd.
* plugin.c (try_load_plugin): Take a pointer to bfd_boolean
argument to return TRUE if any plugin is found. Set plugin_format.
(has_plugin): New.
(bfd_plugin_target_p): New.
(bfd_plugin_specified_p): Likewise.
(bfd_plugin_target_p): Likewise.
(register_ld_plugin_object_p): Likewise.
(bfd_plugin_set_plugin): Set has_plugin.
(load_plugin): Cache try_load_plugin result.
(bfd_plugin_object_p): Try ld_plugin_object_p first. Check
plugin_format.
* plugin.h (bfd_plugin_target_p): New.
(bfd_plugin_specified_p): Likewise.
(register_ld_plugin_object_p): Likewise.
* bfd-in2.h: Regenerated.

ld/

PR ld/17878
* plugin.c: Include ../bfd/plugin.h.
(plugin_get_ir_dummy_bfd): Call bfd_create with
link_info.output_bfd instead of srctemplate. Copy BFD info
from srctemplate only if it doesn't use BFD plugin target
vector.
(plugin_load_plugins): Call register_ld_plugin_object_p with
(plugin_object_p)
(plugin_maybe_claim): Renamed to ...
(plugin_object_p): This. Return dummy BFD target vector if
input is calimed by plugin library, otherwise return NULL.
Update plugin_format and plugin_dummy_bfd.
(plugin_maybe_claim): New. Use plugin_object_p.

xx

18ad82c 2015-02-11 20:32:38 Pedro Alves

xcoffread.c: delete 'within_function' definition

Linking GDB as a C++ program, we get:

src/gdb/buildsym.c:226: multiple definition of `within_function'
xcoffread.o:src/gdb/xcoffread.c:181: first defined here

gdb/
2015-02-11 Pedro Alves <palves@redhat.com>

* xcoffread.c (within_function): Delete.

e36122e 2015-02-11 20:20:21 Tom Tromey

Fix redefinition errors in C++ mode

In C, we can forward declare static structure instances. That doesn't
work in C++ though. C++ treats these as definitions. So then the
compiler complains about symbol redefinition, like:

src/gdb/elfread.c:1569:29: error: redefinition of ‘const sym_fns elf_sym_fns_lazy_psyms’
src/gdb/elfread.c:53:29: error: ‘const sym_fns elf_sym_fns_lazy_psyms’ previously declared here

The intent of static here is naturally to avoid making these objects
visible outside the compilation unit. The equivalent in C++ would be
to instead define the objects in the anonymous namespace. But given
that it's desirable to leave the codebase compiling as both C and C++
for a while, this just makes the objects extern.

(base_breakpoint_ops is already declared in breakpoint.h, so we can
just remove the forward declare from breakpoint.c)

gdb/ChangeLog:
2015-02-11 Tom Tromey <tromey@redhat.com>
Pedro Alves <palves@redhat.com>

* breakpoint.c (base_breakpoint_ops): Delete.
* dwarf2loc.c (dwarf_expr_ctx_funcs): Make extern.
* elfread.c (elf_sym_fns_gdb_index, elf_sym_fns_lazy_psyms): Make extern.
* guile/guile.c (guile_extension_script_ops, guile_extension_ops): Make extern.
* ppcnbsd-tdep.c (ppcnbsd2_sigtramp): Make extern.
* python/py-arch.c (arch_object_type): Make extern.
* python/py-block.c (block_syms_iterator_object_type): Make extern.
* python/py-bpevent.c (breakpoint_event_object_type): Make extern.
* python/py-cmd.c (cmdpy_object_type): Make extern.
* python/py-continueevent.c (continue_event_object_type)
* python/py-event.h (GDBPY_NEW_EVENT_TYPE): Remove 'qual'
parameter. Update all callers.
* python/py-evtregistry.c (eventregistry_object_type): Make extern.
* python/py-exitedevent.c (exited_event_object_type): Make extern.
* python/py-finishbreakpoint.c (finish_breakpoint_object_type): Make extern.
* python/py-function.c (fnpy_object_type): Make extern.
* python/py-inferior.c (inferior_object_type, membuf_object_type): Make extern.
* python/py-infevents.c (call_pre_event_object_type)
(inferior_call_post_event_object_type).
(memory_changed_event_object_type): Make extern.
* python/py-infthread.c (thread_object_type): Make extern.
* python/py-lazy-string.c (lazy_string_object_type): Make extern.
* python/py-linetable.c (linetable_entry_object_type)
(linetable_object_type, ltpy_iterator_object_type): Make extern.
* python/py-newobjfileevent.c (new_objfile_event_object_type)
(clear_objfiles_event_object_type): Make extern.
* python/py-objfile.c (objfile_object_type): Make extern.
* python/py-param.c (parmpy_object_type): Make extern.
* python/py-progspace.c (pspace_object_type): Make extern.
* python/py-signalevent.c (signal_event_object_type): Make extern.
* python/py-symtab.c (symtab_object_type, sal_object_type): Make extern.
* python/py-type.c (type_object_type, field_object_type)
(type_iterator_object_type): Make extern.
* python/python.c (python_extension_script_ops)
(python_extension_ops): Make extern.
* stap-probe.c (stap_probe_ops): Make extern.

b19f47a 2015-02-11 19:54:50 Jiong Wang

[ARM] Add support for Cortex-A72

2015-02-11 Matthew Wahab <matthew.wahab@arm.com>

* config/tc-arm.c: Add support for Cortex-A72.

55172d6 2015-02-11 19:04:47 Pedro Alves

Wrap BFD headers in extern "C"

These were the BFD changes needed for building a C++ GDB with
--enable-targets=all, on x86_64 Fedora 20.

For libbfd.h and libcoff.h, this does same as already done when
generating bfd.h: open extern "C" in the -in.h header, and close it
from the Makefile.

bfd/doc/ChangeLog:
2015-02-11 Pedro Alves <palves@redhat.com>

* Makefile.am (libbfd.h, libcoff.h): Close extern "C" scope.
* Makefile.in: Regenerate.

bfd/ChangeLog:
2015-02-11 Pedro Alves <palves@redhat.com>

* libbfd-in.h [__cplusplus]: Open extern "C" scope.
* libcoff-in.h [__cplusplus]: Open extern "C" scope.
* libbfd.h: Regenerate.
* libcoff.h: Regenerate.

* elf-bfd.h [__cplusplus]: Wrap in extern "C".
* mach-o.h [__cplusplus]: Wrap in extern "C".
* som.h [__cplusplus]: Wrap in extern "C".

0703599 2015-02-11 18:45:41 Pedro Alves

Fix adjust_pc_after_break, remove still current thread check

On decr_pc_after_break targets, GDB adjusts the PC incorrectly if a
background single-step stops somewhere where PC-$decr_pc has a
breakpoint, and the thread that finishes the step is not the current
thread, like:

ADDR1 nop <-- breakpoint here
ADDR2 jmp PC

IOW, say thread A is stepping ADDR2's line in the background (an
infinite loop), and the user switches focus to thread B. GDB's
adjust_pc_after_break logic confuses the single-step stop of thread A
for a hit of the breakpoint at ADDR1, and thus adjusts thread A's PC
to point at ADDR1 when it should not, and reports a breakpoint hit,
when thread A did not execute the instruction at ADDR1 at all.

The test added by this patch exercises exactly that.

I can't find any reason we'd need the "thread to be examined is still
the current thread" condition in adjust_pc_after_break, at least
nowadays; it might have made sense in the past. Best just remove it,
and rely on currently_stepping().

Here's the test's log of a run with an unpatched GDB:

35 while (1);
(gdb) PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: next over nop
next&
(gdb) PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: next& over inf loop
thread 1
[Switching to thread 1 (Thread 0x7ffff7fc2740 (LWP 29027))](running)
(gdb)
PASS: gdb.threads/step-bg-decr-pc-switch-thread.exp: switch to main thread
Breakpoint 2, thread_function (arg=0x0) at ...src/gdb/testsuite/gdb.threads/step-bg-decr-pc-switch-thread.c:34
34 NOP; /* set breakpoint here */
FAIL: gdb.threads/step-bg-decr-pc-switch-thread.exp: no output while stepping

gdb/ChangeLog:
2015-02-11 Pedro Alves <pedro@codesourcery.com>

* infrun.c (adjust_pc_after_break): Don't adjust the PC just
because the event thread is not the current thread.

gdb/testsuite/ChangeLog:
2015-02-11 Pedro Alves <pedro@codesourcery.com>

* gdb.threads/step-bg-decr-pc-switch-thread.c: New file.
* gdb.threads/step-bg-decr-pc-switch-thread.exp: New file.

07f107f 2015-02-11 16:18:59 Will Newton

gold/arm.cc: Output mapping symbol for PLT code

Output an ARM state mapping symbol at the start of the PLT. With the
current code objdump will fail to disassemble the PLT that gold
creates.

gold/ChangeLog:

2015-02-11 Will Newton <will.newton@linaro.org>

PR gold/13321
* arm.cc (Target_arm::make_plt_section): Create an ARM
state mapping symbol at the start of the PLT.

7e60a48 2015-02-11 15:07:06 Doug Evans

lib/gdb.exp (gdb_load): Always return a result.

gdb/testsuite/ChangeLog:

* lib/gdb.exp (gdb_load): Always return a result.

eaaf76a 2015-02-11 14:18:59 Doug Evans

internal_type_self_type: Handle TYPE_SPECIFIC_NONE.

gdb/ChangeLog:

* gdbtypes.c (internal_type_self_type): If TYPE_SPECIFIC_FIELD hasn't
been initialized yet, return NULL.

d319a09 2015-02-11 12:02:07 H.J. Lu

Initialize use_mmap

* plugin.c (plugin_maybe_claim): Initialize use_mmap.

3860479 2015-02-11 10:03:59 H.J. Lu

Unmap the buffer if plugin didn't claim the file

If plugin didn't claim the file, unmap the buffer.

* plugin.c (plugin_input_file_t): Add use_mmap.
(plugin_pagesize): New.
(get_view): Use plugin_pagesize. Set use_mmap if mmap is used.
(plugin_load_plugins): Initialize plugin_pagesize.
(plugin_maybe_claim): Unmap the buffer if plugin didn't claim the
file.

e7d52ed 2015-02-11 10:01:37 Doug Evans

Rename new_symfile_objfile, make static.

gdb/ChangeLog:

* symfile.h (new_symfile_objfile): Delete.
* symfile.c (finish_new_objfile): Renamed from new_symfile_objfile.
All callers updated.

fc6b125 2015-02-11 09:06:49 Patrick Palka

Fix a pair of screen-resizing issues in TUI

This patch fixes a pair of TUI issues related to screen resizing:

1. In tui_handle_resize_during_io(), when the TUI screen gets resized,
we fail to update GDB's idea about the height of the output window.

You can see this bug by doing:

a. Enter TUI mode.
b. "show height"
c. Resize the terminal.
d. "show height"

And observe that despite resizing the terminal, the reported height
remains unchanged. Note that a similar issue exists in the CLI.

The fix for this is simple: call tui_update_gdb_sizes() after performing
a resize, so that the "height" variable remains consistent with the
height of TUI's output window.

2. In tui_enable(), the call to tui_update_gdb_sizes() may clobber
readline's idea of the actual screen dimensions, and a subsequent
pending resize will use bogus terminal dimensions.

You can see this bug by doing:

a. Enter TUI mode.
b. Exit TUI mode.
c. Resize the terminal.
d. Enter TUI mode.
e. Press a key to resize the screen.

And observe that the terminal gets incorrectly resized to the wrong
dimensions. To fix this issue, we should oppurtunistically resize the
screen in tui_enable(). That way we eliminate the possibility of a
pending resize triggering right after we call tui_update_gdb_sizes().

gdb/ChangeLog:

* tui/tui-io.c (tui_handle_resize_during_io): Call
tui_update_gdb_sizes() after resizing the screen.
* tui/tui.c (tui_enable): Resize the terminal before
calling tui_update_gdb_sizes().