binutils-gdb.git
10 years agoThis patch removes the inclusion of the default manifest in final links for
Nick Clifton [Tue, 8 Apr 2014 16:45:33 +0000 (17:45 +0100)]
This patch removes the inclusion of the default manifest in final links for
the Cygwin and MinGW targets.  The manifest is now going to be handled by gcc.

* scripttempl/pe.sc (R_RSRC): Remove default manifest.
* scripttempl/pep.sc (R_RSRC): Remove default manifest.

10 years agoAdd support for generating and inserting build IDs into COFF binaries.
Jon TURNEY [Tue, 8 Apr 2014 09:59:43 +0000 (10:59 +0100)]
Add support for generating and inserting build IDs into COFF binaries.

* peXXigen.c (pe_print_debugdata): New function: Displays the
contents of the debug directory and decodes codeview entries.
(_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out)
(_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record):
Add functions for reading and writing debugdir and codeview
records.
* libpei.h (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out)
(_bfd_XXi_write_codeview_record): Add prototypes and macros.
* libcoff-in.h (pe_tdata): Add build-id data.
* libcoff.h: Regenerate.
* coffcode.h (coff_write_object_contents): Run build_id
after_write_object_contents hook.

* pe.h (external_IMAGE_DEBUG_DIRECTORY, _CV_INFO_PDB70)
(_CV_INFO_PDB20): Add structures and constants for debug directory
and codeview records.
* internal.h (internal_IMAGE_DEBUG_DIRECTORY, CODEVIEW_INFO):
Add structures and constants for internal representation of debug
directory and codeview records.

* emultempl/elf32.em (id_note_section_size, read_hex, write_build_id):
Move code for parsing build-id option and calculating the build-id to...
* ldbuildid.c: New file.
* ldbuildid.h: New file.
* Makefile.am (CFILES, HFILES, OFILES, ld_new_SOURCES): Add new
files.
* Makefile.in: Regenerate.
* ld.texinfo: Update --build-id description to mention COFF
support.
* NEWS: Mention support for COFF build ids.
* emultempl/pe.em (gld${EMULATION_NAME}_handle_option):
(pecoff_checksum_contents, write_build_id, setup_build_id)
(gld_${EMULATION_NAME}_after_open):  Handle and implement
build-id option.
* emultempl/pep.em: Likewise.

10 years ago[testsuite] Disable Ctrl-V use for mingw hosts.
Pierre Muller [Tue, 25 Mar 2014 00:37:36 +0000 (08:37 +0800)]
[testsuite] Disable Ctrl-V use for mingw hosts.

On mingw host, we have seen two fails as below,

p int1dim[0]^V@2
Invalid character '^V' in expression.
(gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2
p int1dim[0]^V@2^V@3
Invalid character '^V' in expression.
(gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2@3

In the test, the comment says "# Send \026@ instead of just @ in case
the kill character is @".  Historically, kill character was @, and
Ctrl-V (\026) is to escape the next character.  However, we don't have
to do so on mingw.  This patch is to disable ctrl-v usage on mingw
hots.  With this patch applied, it becomes:

p int1dim[0]@2
$607 = {0, 1}
(gdb) PASS: gdb.base/printcmds.exp: p int1dim[0]@2
p int1dim[0]@2@3
$608 = {{0, 1}, {2, 3}, {4, 5}}

Note that this patch is picked from Pierre's submission,

  [RFC 6/6] Fix remaining failures in gdb.base/printcmds.exp for mingw hosts.
  https://www.sourceware.org/ml/gdb-patches/2013-09/msg00943.html

gdb/testsuite:

2014-04-08  Pierre Muller  <muller@sourceware.org>

* gdb.base/printcmds.exp (test_artificial_arrays): Disable
Ctrl-V use for mingw hosts.

10 years agodaily update
Alan Modra [Tue, 8 Apr 2014 00:00:58 +0000 (09:30 +0930)]
daily update

10 years ago[python] Fix gdb.Value.dynamic_type for reference values.
Siva Chandra [Fri, 21 Mar 2014 13:42:50 +0000 (06:42 -0700)]
[python] Fix gdb.Value.dynamic_type for reference values.

gdb.Value.dynamic_type is supposed to work for reference and pointer
values.  However, the value object in the function 'valpy_get_dynamic_type'
was being dereferenced using 'value_ind' irrespective of the value type
being TYPE_CODE_PTR or TYPE_CODE_REF.  This patch fixes that to use
'coerce_ref' for TYPE_CODE_REF values.

ChangeLog:

* python/py-value.c (valpy_get_dynamic_type): Use coerce_ref to
dereference TYPE_CODE_REF values.

testsuite/
* gdb.python/py-value.c: Improve test case.
* gdb.python/py-value.exp: Add new test.

10 years agoAdd support to recognize clang.
Doug Evans [Mon, 7 Apr 2014 21:14:03 +0000 (14:14 -0700)]
Add support to recognize clang.

* lib/compiler.c: Identify the clang compiler.
* lib/compiler.cc: Ditto.

10 years agoFix spurious failures in ld-plugin/lto.exp
Andreas Schwab [Sat, 5 Apr 2014 20:03:44 +0000 (22:03 +0200)]
Fix spurious failures in ld-plugin/lto.exp

* ld-plugin/lto.exp: Make "-Wp," prefix optional when filtering
out _FORTIFY_SOURCE.
("Build libdummy.a 9", "PR ld/12696"): Mark as c++.

10 years agoFix ARI warning in darwin-nat.c::darwin_decode_message
Joel Brobecker [Mon, 7 Apr 2014 16:43:23 +0000 (09:43 -0700)]
Fix ARI warning in darwin-nat.c::darwin_decode_message

gdb/ChangeLog:

        * darwin-nat.c (darwin_decode_message): Remove trailing '\n' at
        end of warning message.

10 years agoReport an error on objcopy/strip of sectionless binaries
Alan Modra [Mon, 7 Apr 2014 04:14:50 +0000 (13:44 +0930)]
Report an error on objcopy/strip of sectionless binaries

All strip operations require section headers to be present, as do most
objcopy operations.  BFD is seriously confused by objects without
section info.  The error message added here is similar to the error
on attempting to strip/objcopy a zero length object.

PR binutils/16811
* objcopy.c (copy_object): Error if no sections.

10 years agodaily update
Alan Modra [Mon, 7 Apr 2014 00:00:38 +0000 (09:30 +0930)]
daily update

10 years agodaily update
Alan Modra [Sun, 6 Apr 2014 00:00:52 +0000 (09:30 +0930)]
daily update

10 years agoFix map file reference
Alan Modra [Sat, 5 Apr 2014 02:08:47 +0000 (12:38 +1030)]
Fix map file reference

The testcase in pr16417 comment #6 produces a map file showing
libpthread.so.0               (write@@GLIBC_2.2.5)
ie. missing the file referencing the symbol.

* elflink.c (_bfd_elf_add_default_symbol): Pass poldbfd when
merging non-default sym.

10 years agodaily update
Alan Modra [Fri, 4 Apr 2014 23:00:58 +0000 (09:30 +1030)]
daily update

10 years agoThis fixes PR bootstrap/60620:
Eric Botcazou [Fri, 4 Apr 2014 20:54:42 +0000 (22:54 +0200)]
This fixes PR bootstrap/60620:

* Makefile.def (dependencies): Make gnattools depend on libstdc++-v3.
* Makefile.in: Regenerate.

10 years agoDocument optional comma in linker script.
Cary Coutant [Fri, 4 Apr 2014 16:28:23 +0000 (09:28 -0700)]
Document optional comma in linker script.

The linker script documentation does not mention the optional comma
that may follow an output section command or an overlay command.
In some cases, where a fill expression is used, and the next
output section command begins with an operator (e.g., "/DISCARD/"),
the comma may be required to separate the two commands.

Currently, GNU ld doesn't require the comma, but gold does.

ld/
PR gold/16804
* ld.texinfo: Document optional comma following output section
command and overlay command.

10 years agoAdd support for Intel SGX instructions
Ilya Tocar [Thu, 3 Apr 2014 12:40:04 +0000 (16:40 +0400)]
Add support for Intel SGX instructions

Add Intel SGX instructions support to assembler and disassembler.

gas/

* config/tc-i386.c (cpu_arch): Add .se1.
* doc/c-i386.texi: Document .se1/se1.

gas/testsuite/

* gas/i386/i386.exp: Run SE1 tests.
* gas/i386/se1.d: New file.
* gas/i386/se1.s: Ditto.
* gas/i386/x86-64-se1.d: Ditto.
* gas/i386/x86-64-se1.s: Ditto.

opcodes/

* i386-dis.c (rm_table): Add encls, enclu.
* i386-gen.c (cpu_flag_init): Add CPU_SE1_FLAGS,
(cpu_flags): Add CpuSE1.
* i386-opc.h (enum): Add CpuSE1.
(i386_cpu_flags): Add cpuse1.
* i386-opc.tbl: Add encls, enclu.
* i386-init.h: Regenerated.
* i386-tbl.h: Likewise.

10 years agomach-o: reject 64 bit targets when not configured for.
Tristan Gingold [Thu, 3 Apr 2014 10:50:31 +0000 (12:50 +0200)]
mach-o: reject 64 bit targets when not configured for.

bfd/
* mach-o.c (bfd_mach_o_header_p): Reject 64 bit target when not
configured for.

10 years agomach-o: fix section name conversion from bfd to mach-o.
Tristan Gingold [Fri, 4 Apr 2014 10:38:24 +0000 (12:38 +0200)]
mach-o: fix section name conversion from bfd to mach-o.

bfd/
* mach-o.c (bfd_mach_o_convert_section_name_to_mach_o): Fix
thinko on names length.

10 years agomach-o: output output_section target_index to write relocs.
Tristan Gingold [Fri, 4 Apr 2014 10:37:50 +0000 (12:37 +0200)]
mach-o: output output_section target_index to write relocs.

bfd/
* mach-o-i386.c (bfd_mach_o_i386_swap_reloc_out): Use target index
of output_section.
* mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Ditto.

10 years agobfd_get_arch_size: return size from arch info on non-ELF targets.
Tristan Gingold [Thu, 3 Apr 2014 09:59:05 +0000 (11:59 +0200)]
bfd_get_arch_size: return size from arch info on non-ELF targets.

bfd/
* bfd.c (bfd_get_arch_size): Default is taken from arch.

10 years agoPad sections according to current script FILL.
Alan Modra [Fri, 4 Apr 2014 01:15:03 +0000 (11:45 +1030)]
Pad sections according to current script FILL.

When aligning input sections, we are supposed to take the fill pattern
from a FILL statement, if there is one in the output section statement.

ld/
* ldlang.c (lang_size_sections_1 <lang_input_section_enum>): Use
current "fill", not "output_section_statement->fill".
ld/testsuite/
* ld-scripts/fill.d, * ld-scripts/fill.t, * ld-scripts/fill_0.s,
* ld-scripts/fill_1.s, * ld-scripts/fill_2.s: New test.
* ld-scripts/data.exp: Run it.

10 years agodaily update
Alan Modra [Thu, 3 Apr 2014 23:00:43 +0000 (09:30 +1030)]
daily update

10 years ago(read_cutu_die_from_dwo): Update function comment to match previous change.
Doug Evans [Thu, 3 Apr 2014 19:11:58 +0000 (12:11 -0700)]
(read_cutu_die_from_dwo): Update function comment to match previous change.

10 years ago * dwarf2read.c (read_cutu_die_from_dwo): Fix assertion, at most one
Doug Evans [Thu, 3 Apr 2014 19:07:25 +0000 (12:07 -0700)]
* dwarf2read.c (read_cutu_die_from_dwo): Fix assertion, at most one
of stub_comp_unit_die, stub_comp_dir is non-NULL.

10 years ago * peXXigen.c (pe_print_edata): Verify edt.name lies inside
Jon Turney [Thu, 3 Apr 2014 11:26:27 +0000 (12:26 +0100)]
* peXXigen.c (pe_print_edata): Verify edt.name lies inside
section before dereferencing.
(pe_print_idata, pe_print_edata, pe_print_reloc)
(rsrc_print_section): Don't bother interpreting the contents
of sections which have no contents.

10 years agoThis fixes a problem building large (> 2Gb) binaries on 32-bit hosts. Using a
Maria Guseva [Thu, 3 Apr 2014 10:42:05 +0000 (11:42 +0100)]
This fixes a problem building large (> 2Gb) binaries on 32-bit hosts.  Using a
long type instead of long long meant that bfd_seek (SET) could be called with a
negative offset.

PR ld/16803
* elf.c (_bfd_elf_set_section_contents): Use correct type to hold
file position.

10 years agoThis patch allows one to place the gcc's liblto_plugin in the lib/bfd-plugins directory
Markus Trippelsdorf [Thu, 3 Apr 2014 10:33:17 +0000 (11:33 +0100)]
This patch allows one to place the gcc's liblto_plugin in the lib/bfd-plugins directory
and have it loaded by default (as long as the --target option isn't used).

PR binutils/14698
ar.c: Set plugin_target early if plugins are supported.
nm.c: Likewise.

10 years agomach-o: fix warnings on 32 bit hosts. Display personality functions.
Tristan Gingold [Thu, 3 Apr 2014 09:49:56 +0000 (11:49 +0200)]
mach-o: fix warnings on 32 bit hosts. Display personality functions.

binutils/
* od-macho.c (printf_uint64): New function.
(dump_load_command, dump_obj_compact_unwind): Use it.
(dump_exe_compact_unwind): Display personality functions.

include/mach-o/
* unwind.h (mach_o_compact_unwind_64): Fix typo in personality.

10 years agomach-o: fix section number while writing symbols.
Tristan Gingold [Thu, 3 Apr 2014 08:21:02 +0000 (10:21 +0200)]
mach-o: fix section number while writing symbols.

bfd/
* mach-o.c (bfd_mach_o_mangle_symbols): Use index from
output_section.
(bfd_mach_o_build_seg_command): Add comment.  Realign segment.
Fix style.
(bfd_mach_o_build_commands, bfd_mach_o_read_thread): Fix style.

10 years agoEscape backslash in windows path
Yao Qi [Sat, 29 Mar 2014 01:41:02 +0000 (09:41 +0800)]
Escape backslash in windows path

Hi,
On windows host, we see the following ERROR,

(gdb) PASS: gdb.base/setshow.exp: set history filename ~/foobar.baz
ERROR OCCURED: couldn't compile regular expression pattern: invalid escape \ seq
uence
    while executing
"expect -nobrace -i exp13 -timeout 10 -re {.*A problem internal to GDB has been
detected} {
    fail "$message (GDB internal error)"
    gdb_internal..."
    invoked from within
"expect {
-i exp13 -timeout 10
-re ".*A problem internal to GDB has been detected" {
    fail "$message (GDB internal error)"
    gdb_internal_erro..."
    ("uplevel" body line 1)
    invoked from within
"uplevel $body" REGEXP REG_EESCAPE {invalid escape \ sequence} couldn't compile
regular expression pattern: invalid escape \ sequenceERROR: Process no longer ex
ists

which leads to
UNRESOLVED: gdb.base/setshow.exp: show history filename (~/foobar.baz)

and this error is thrown from this test below:

gdb_test "show history filename" \
    "The filename in which to record the command history is \"$HOME/foobar.baz\"..*" \
    "show history filename (~/foobar.baz)"

HOME is a windows path, like C:\foo\bar.  When it is used in gdb_test to match
output, the error is thrown because backslash is a special character in
regular expression.  This patch is to escape backslash to fix this
error by using string_to_regexp.

gdb/testsuite:

2014-04-03  Yao Qi  <yao@codesourcery.com>

* gdb.base/setshow.exp: Invoke string_to_regexp to HOME and PWD.

10 years agoAdd support for two new moxie sign-extension instructions
Anthony Green [Thu, 3 Apr 2014 03:55:57 +0000 (23:55 -0400)]
Add support for two new moxie sign-extension instructions

10 years agoFix sim breakage
Alan Modra [Thu, 3 Apr 2014 01:36:33 +0000 (12:06 +1030)]
Fix sim breakage

Replace "size_t size" with "bfd_size_type size".
and here too.

* bfd-in.h (bfd_elf_bfd_from_remote_memory): Likewise.
* bfd-in2.h: Regenerate.

10 years agoChangeLog missed from last commit
Alan Modra [Thu, 3 Apr 2014 01:27:13 +0000 (11:57 +1030)]
ChangeLog missed from last commit

10 years agoFix sim breakage
Alan Modra [Thu, 3 Apr 2014 01:04:00 +0000 (11:34 +1030)]
Fix sim breakage

* elf-bfd.h (struct elf_backend_data
<elf_backend_bfd_from_remote_memory>): Replace "size_t size"
with "bfd_size_type size".
(_bfd_elf32_bfd_from_remote_memory): Likewise.
(_bfd_elf64_bfd_from_remote_memory): Likewise.
* elf.c (bfd_elf_bfd_from_remote_memory): Likewise.
* elfcode.h (bfd_from_remote_memory): Likewise.

10 years ago2014-04-02 Sriraman Tallam <tmsriram@google.com>
Sriraman Tallam [Wed, 2 Apr 2014 23:46:02 +0000 (16:46 -0700)]
2014-04-02  Sriraman Tallam  <tmsriram@google.com>

* icf.cc (get_section_contents): Replace copies of reloc
vectors with (const) references.

10 years agoAdd new sign-extension instructions to moxie port
Anthony Green [Thu, 3 Apr 2014 00:04:23 +0000 (20:04 -0400)]
Add new sign-extension instructions to moxie port

10 years agodaily update
Alan Modra [Wed, 2 Apr 2014 23:00:41 +0000 (09:30 +1030)]
daily update

10 years agoModify gold testsuite to disable plugins added by GCC driver.
Cary Coutant [Wed, 2 Apr 2014 22:04:36 +0000 (15:04 -0700)]
Modify gold testsuite to disable plugins added by GCC driver.

GCC 4.8 now adds linker plugin options by default, which conflict with the
--incremental tests in the testsuite. This patch checks whether the compiler
supports the -fno-use-linker-plugin option, and adds it to all link
commands.

2014-04-02  Cary Coutant  <ccoutant@google.com>

* configure.ac (HAVE_PUBNAMES): Use C instead of C++.
(HAVE_NO_USE_LINKER_PLUGIN): Check for -fno-use-linker-plugin.
* configure: Regenerate.
* testsuite/Makefile.am (OPT_NO_PLUGINS): New macro for
-fno-use-linker-plugin.
(LINK1, CXXLINK1): Add it to the link command.
* testsuite/Makefile.in: Regenerate.

10 years agoAdd checks for overfar branches
DJ Delorie [Wed, 2 Apr 2014 20:50:29 +0000 (16:50 -0400)]
Add checks for overfar branches

Check 8 and 16 bit PCREL fixes for overflow, since we bypass the
later overflow checks in write.c.  Direct relocs are left alone,
as gcc has been known to take advantage of the silent overflows
when comparing addresses to constant ranges.

10 years agoThis fixes an internal error in GAS, triggered by the test case reported in PR 16765.
Nick Clifton [Wed, 2 Apr 2014 15:29:35 +0000 (16:29 +0100)]
This fixes an internal error in GAS, triggered by the test case reported in PR 16765.
The problem was that gcc was generating assembler with missing unwind directives in it,
so that a gas_assert was being triggered.  The patch replaces the assert with an error
message.

* config/tc-arm.c (create_unwind_entry): Report an error if an
attempt to recreate an unwind directive is encountered.

10 years agomach-o: read and dump: prebound_dylib, prebind_cksum, twolevel_hints.
Tristan Gingold [Wed, 26 Mar 2014 14:01:53 +0000 (15:01 +0100)]
mach-o: read and dump: prebound_dylib, prebind_cksum, twolevel_hints.

include/mach-o:
* external.h (mach_o_prebound_dylib_command_external)
(mach_o_prebind_cksum_command_external)
(mach_o_twolevel_hints_command_external): New types.

bfd/
* mach-o.h (bfd_mach_o_twolevel_hints_command)
(bfd_mach_o_prebind_cksum_command): New types.
(bfd_mach_o_prebound_dylib_command): Rewrite.
(bfd_mach_o_load_command): Add prebind_cksum and twolevel_hints
fields.
* mach-o.c (bfd_mach_o_read_prebound_dylib): Read and decode the
command.
(bfd_mach_o_read_prebind_cksum): New function.
(bfd_mach_o_read_twolevel_hints): Ditto.
(bfd_mach_o_read_command): Handle prebind cksum and twolevel hints
commands.

binutils/
* od-macho.c (OPT_TWOLEVEL_HINTS): New macro.
(options): Add entry for twolevel_hints.
(dump_data_in_code): Fix error message.
(dump_twolevel_hints): New function.
(dump_load_command): Handle prebound dylib, prebind cksum
and twolevel hints.
(mach_o_dump): Handle twolevel hints.

10 years agoHandle VDSO section headers past end of page
Alan Modra [Wed, 2 Apr 2014 01:37:33 +0000 (12:07 +1030)]
Handle VDSO section headers past end of page

When a VDSO gets large enough that it doesn't entirely fit in one page,
but not so large that the part described by the program header exceeds
one page, then gdb/BFD doesn't read the section headers and symbol
table information.  This patch cures that by passing the size of the
vdso to BFD, and fixes a number of other issues in the BFD code.

bfd/
* elfcode.h (bfd_from_remote_memory): Add "size" parameter.
Consolidate code handling possible section headers past end of
segment.  Don't use p_align for page size guess, instead use
minpagesize.  Take note of ld.so clearing section headers when
p_memsz > p_filesz.  Handle file header specifying no section
headers.  Handle zero p_align throughout.  Default loadbase to
zero.  Add comments.  Rename contents_size to high_offset, and
make it a bfd_vma.  Delete unnecessary bfd_set_error calls.
* bfd-in.h (bfd_elf_bfd_from_remote_memory): Update prototpe.
* elf-bfd.h (struct elf_backend_data <elf_backend_from_remote_memory>):
Likewise.
(_bfd_elf32_bfd_from_remote_memory): Likewise.
(_bfd_elf64_bfd_from_remote_memory): Likewise.
* elf.c (bfd_elf_bfd_from_remote_memory): Adjust.
* bfd-in2.h: Regnerate.
gdb/
* symfile-mem.c (symbol_file_add_from_memory): Add size parameter.
Pass to bfd_elf_bfd_from_remote_memory.  Adjust all callers.
(struct symbol_file_add_from_memory_args): Add size field.
(find_vdso_size): New function.
(add_vsyscall_page): Attempt to find vdso size.

10 years agodaily update
Alan Modra [Tue, 1 Apr 2014 23:00:43 +0000 (09:30 +1030)]
daily update

10 years ago* dwarf2read.c (read_cutu_die_from_dwo): Improve comment.
Doug Evans [Tue, 1 Apr 2014 17:17:12 +0000 (10:17 -0700)]
* dwarf2read.c (read_cutu_die_from_dwo): Improve comment.

10 years agobfd/mach-o: avoid a crash when num == 0 in reloc.
Tristan Gingold [Tue, 1 Apr 2014 12:34:04 +0000 (14:34 +0200)]
bfd/mach-o: avoid a crash when num == 0 in reloc.

bfd/
* mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash
when num == 0.

10 years agomach-o: display data_in_code.
Tristan Gingold [Wed, 26 Mar 2014 09:41:16 +0000 (10:41 +0100)]
mach-o: display data_in_code.

binutils/
* od-macho.c (OPT_DATA_IN_CODE): New macro.
(options): Add entry for data in code.
(mach_o_help): Ditto.
(data_in_code_kind_name): New array.
(dump_data_in_code): New function.
(dump_load_command): Handle data in code.
(mach_o_dump): Ditto.
(dump_header): Display a terminal newline.

10 years agodarwin-nat: avoid crash while debugging gdb.
Tristan Gingold [Fri, 21 Mar 2014 15:56:39 +0000 (16:56 +0100)]
darwin-nat: avoid crash while debugging gdb.

it is possible that gdb gets mach exceptions from an unknown inferior.  This
happens when an inferior creates a child and that child gets a signal.

So instead of reporting messages with unknown origins, simply reply to these
notifications. The kernel will then post the unix signal.

gdb/
* darwin-nat.c (darwin_encode_reply): Add prototype.
(darwin_decode_exception_message): Reply to unknown inferiors.
(darwin_decode_message): Handle message by id.  Ignore message
to unknown inferior.
(darwin_wait): Discard unknown messages, add debug trace.

10 years agogdb.arch/ppc64-atomic-inst.exp: Improve error handling.
Anton Blanchard [Mon, 31 Mar 2014 02:32:07 +0000 (13:32 +1100)]
gdb.arch/ppc64-atomic-inst.exp: Improve error handling.

gdb/testsuite/
2014-04-01  Anton Blanchard  <anton@samba.org>

* gdb.arch/ppc64-atomic-inst.exp: Use untested.  Make test
messages unique.

10 years agogdb.arch/ppc64-atomic-inst.exp: Use standard_testfile, prepare_for_testing.
Anton Blanchard [Mon, 31 Mar 2014 01:03:01 +0000 (12:03 +1100)]
gdb.arch/ppc64-atomic-inst.exp: Use standard_testfile, prepare_for_testing.

gdb/testsuite/
2014-04-01  Anton Blanchard  <anton@samba.org>

* gdb.arch/ppc64-atomic-inst.exp: Use standard_testfile,
prepare_for_testing.

10 years agoFix ppc64 single step over atomic sequence testcase.
Anton Blanchard [Fri, 28 Mar 2014 01:37:37 +0000 (12:37 +1100)]
Fix ppc64 single step over atomic sequence testcase.

The current ppc64 single step over atomic sequence testcase is written
in C and breaks with some versions of gcc. Convert the test to
assembly and use stepi to step through it.

gdb/testsuite/
2014-04-01  Anton Blanchard  <anton@samba.org>

* gdb.arch/ppc64-atomic-inst.c: Remove.
* gdb.arch/ppc64-atomic-inst.S: New file.
* gdb.arch/ppc64-atomic-inst.exp: Adapt for asm based testcase.

10 years agodwarf2read.c (read_cutu_die_from_dwo): Delete unused local comp_dir_string.
Doug Evans [Mon, 31 Mar 2014 23:51:37 +0000 (16:51 -0700)]
dwarf2read.c (read_cutu_die_from_dwo): Delete unused local comp_dir_string.

10 years agodaily update
Alan Modra [Mon, 31 Mar 2014 23:00:55 +0000 (09:30 +1030)]
daily update

10 years agoNew option "set print symbol-loading".
Doug Evans [Mon, 31 Mar 2014 19:07:48 +0000 (12:07 -0700)]
New option "set print symbol-loading".

* NEWS: Mention it.
* solib.c (solib_read_symbols): Only print symbol loading messages
if requested.
(solib_add): If symbol loading is in "brief" mode, notify user
symbols are being loaded.
(reload_shared_libraries_1): Ditto.
* symfile.c (print_symbol_loading_off): New static global.
(print_symbol_loading_brief): New static global.
(print_symbol_loading_full): New static global.
(print_symbol_loading_enums): New static global.
(print_symbol_loading): New static global.
(print_symbol_loading_p): New function.
(symbol_file_add_with_addrs): Only print symbol loading messages
if requested.
(_initialize_symfile): Register "print symbol-loading" set/show
command.
* symfile.h (print_symbol_loading_p): Declare.

doc/
* gdb.texinfo (Symbols): Document set/show print symbol-loading.

testsuite/
* gdb.base/print-symbol-loading-lib.c: New file.
* gdb.base/print-symbol-loading-main.c: New file.
* gdb.base/print-symbol-loading.exp: New file.

10 years agoThis is a fix for PR ld/16744 which showed that an object file linked with -r and...
Nick Clifton [Mon, 31 Mar 2014 12:14:44 +0000 (13:14 +0100)]
This is a fix for PR ld/16744 which showed that an object file linked with -r and -z [no]execstack
would not honour the [no]execstack.  Fully linked binaries use a special segment to indicate the
state of the stack, but relocatable object files only have sections, and .note.GNU-stack was not
being created.

* emultempl/elf32.em (_after_open): Create a .note.GNU-stack
section when performing a relocatable link with -z [no]execstack
specified.

10 years ago[AArch64] Fixup ld-aarch64/eh-frame.d expected PC range.
Marcus Shawcroft [Mon, 31 Mar 2014 11:58:48 +0000 (12:58 +0100)]
[AArch64] Fixup ld-aarch64/eh-frame.d expected PC range.

Fix the expected output for ld-aarch64/eh-frame.d.  This issue was
exposed by the recent fix to the output of objdump -Wf here:
https://sourceware.org/ml/binutils/2014-03/msg00251.html

10 years agoAllow ';' as a directory separator
Yao Qi [Mon, 31 Mar 2014 06:20:05 +0000 (14:20 +0800)]
Allow ';' as a directory separator

Hi,
I find two fails in source-dir.exp on mingw32 host.

(gdb) directory /nOtExStInG/a /nOtExStInG/b /nOtExStInG/c^M
Warning: /nOtExStInG/a: No such file or directory.^M
Warning: /nOtExStInG/b: No such file or directory.^M
Warning: /nOtExStInG/c: No such file or directory.^M
Source directories searched: /nOtExStInG/a;/nOtExStInG/b;/nOtExStInG/c;$cdir;$cwd^M
(gdb) FAIL: gdb.base/source-dir.exp: directory /nOtExStInG/a /nOtExStInG/b /nOtExStInG/c
directory /nOtExStInG/b /nOtExStInG/d /nOtExStInG/c^M
Warning: /nOtExStInG/b: No such file or directory.^M
Warning: /nOtExStInG/d: No such file or directory.^M
Warning: /nOtExStInG/c: No such file or directory.^M
Source directories searched: /nOtExStInG/b;/nOtExStInG/d;/nOtExStInG/c;/nOtExStInG/a;$cdir;$cwd^M
(gdb) FAIL: gdb.base/source-dir.exp: directory /nOtExStInG/b /nOtExStInG/d /nOtExStInG/c

The regular expression expects ':' and ';' is path separator on Windows.
This patch is to allow ';' as a path separator in regular expression.

This patch is similar to Dan's patch to fix a similar problem here

 Re: directory separators on minGW hosts
 https://sourceware.org/ml/gdb-patches/2006-02/msg00359.html

It is obvious.  Pushed it in.

gdb/testsuite:

2014-03-31  Yao Qi  <yao@codesourcery.com>

* gdb.base/source-dir.exp: Allow ';' as a directory separator.

10 years agodaily update
Alan Modra [Sun, 30 Mar 2014 23:00:40 +0000 (09:30 +1030)]
daily update

10 years ago * infrun.c (set_last_target_status): New function.
Doug Evans [Sun, 30 Mar 2014 19:37:50 +0000 (12:37 -0700)]
* infrun.c (set_last_target_status): New function.
(handle_inferior_event): Call it.

10 years ago* inferior.h (enum stop_kind): Improve comment.
Doug Evans [Sun, 30 Mar 2014 19:24:31 +0000 (12:24 -0700)]
* inferior.h (enum stop_kind): Improve comment.

10 years ago * gdb.texinfo (Non-Stop Mode): Remove trailing whitespace.
Doug Evans [Sun, 30 Mar 2014 19:13:29 +0000 (12:13 -0700)]
* gdb.texinfo (Non-Stop Mode): Remove trailing whitespace.
(Background Execution): Ditto.

10 years agodaily update
Alan Modra [Sat, 29 Mar 2014 23:00:39 +0000 (09:30 +1030)]
daily update

10 years ago* ChangeLog: Fix duplicate entry. Set date on entry correctly.
Chris Faylor [Sat, 29 Mar 2014 20:01:46 +0000 (16:01 -0400)]
* ChangeLog: Fix duplicate entry.  Set date on entry correctly.

10 years ago * config/tc-avr.c: Add specified_mcu variable for selected mcu.
Denis Chertykov [Sat, 29 Mar 2014 05:53:16 +0000 (09:53 +0400)]
* config/tc-avr.c: Add specified_mcu variable for selected mcu.
(enum options): add OPTION_RMW_ISA for -mrmw option.
(struct option md_longopts): Add mrmw option.
(md_show_usage): add -mrmw option description.
(md_parse_option): Update isa details if -mrmw option specified.
* doc/c-avr.texi: Add doc for new option -mrmw.
* gas/avr/avr.exp: Run new tests.
* gas/avr/rmw.d: Add test for additional ISA support.
* gas/avr/rmw.s: Ditto.

10 years ago * gas/ChangeLog: Revert
Denis Chertykov [Sat, 29 Mar 2014 05:46:33 +0000 (09:46 +0400)]
* gas/ChangeLog: Revert
* gas/config/tc-avr.c: Revert
* gas/doc/c-avr.texi: Revert
* gas/testsuite/ChangeLog: Revert
* gas/testsuite/gas/avr/avr.exp: Revert
* gas/testsuite/gas/avr/rmw.d: Revert
* gas/testsuite/gas/avr/rmw.s: Revert

This reverts commit d24e46e3e247e46eb2f5e7ebb5efd0f9fcc5fcdd.

10 years ago * config/tc-avr.c: Add specified_mcu variable for selected mcu.
Denis Chertykov [Sat, 29 Mar 2014 05:41:32 +0000 (09:41 +0400)]
* config/tc-avr.c: Add specified_mcu variable for selected mcu.
(enum options): add OPTION_RMW_ISA for -mrmw option.
(struct option md_longopts): Add mrmw option.
(md_show_usage): add -mrmw option description.
(md_parse_option): Update isa details if -mrmw option specified.
* doc/c-avr.texi: Add doc for new option -mrmw.
* gas/avr/avr.exp: Run new tests.
* gas/avr/rmw.d: Add test for additional ISA support.
* gas/avr/rmw.s: Ditto.

10 years agodaily update
Alan Modra [Fri, 28 Mar 2014 23:00:47 +0000 (09:30 +1030)]
daily update

10 years ago[varobj] false type-changed status for reference to Ada array
Joel Brobecker [Thu, 20 Mar 2014 14:43:08 +0000 (07:43 -0700)]
[varobj] false type-changed status for reference to Ada array

Given the following variable...

   BT : Bounded := New_Bounded (Low => 1, High => 3);

... where type Bounded is defined as a simple unconstrained array:

   type Bounded is array (Integer range <>) of Integer;

Creating a varobj for that variable, and immediately asking for
varobj updates, GDB says that our varobj changed types!

    (gdb)
    -var-create bt * bt
    ^done,name="bt",numchild="3",value="[3]",type="<ref> array (1 .. 3) of integer",has_more="0"
    (gdb)
    -var-update 1 *
    ^done,changelist=[{name="bt",value="[3]",in_scope="true",type_changed="true",new_type="<ref> array (1 .. 3) of integer",new_num_children="3",has_more="0"}]

The expected output for the -var-update command is, in this case:

    (gdb)
    -var-update 1 *
    ^done,changelist=[]

The problem occurs because the ada-varobj module does not handle
references, and while the references gets stripped when the varobj
gets created, it doesn't when computing varobj updates.

More specifically, when creating the varobj, varobj_create creates
a new value which is a reference to a TYPE_CODE_ARRAY. It then calls
install_new_value which calls coerce_ref with the following comment:

    /* We are not interested in the address of references, and given
       that in C++ a reference is not rebindable, it cannot
       meaningfully change.  So, get hold of the real value.  */
    if (value)
      value = coerce_ref (value);

This leaves the varobj's type component still a ref, while
the varobj's value is now our array, without the ref. This explains
why the "value" field in the varobj indicates an array with 3 elements
"[3]" while the "type" field shows a ref to an array. Generally
speaking, most users have said that showing the ref was a useful
piece of information, so this patch is not touching this part.

Next, when the user issues the -var-update request, varobj_update
calls value_of_root to compute the varobj's new value as well as
determine whether the value's type has changed or not. What happens
in a nutshell is that it calls value_of_root_1 (which re-evaluates
the expression and returns the corresponding new value), finds that
the new value is not NULL, and thus asks whether it has mutated:

    else if (varobj_value_has_mutated (var, value, value_type (value)))

This then indirectly delegates the determination to the language-specific
callback, which fails, because it does not handle references.

This patch fixes the issue by adjusting varobj_value_has_mutated to
expect references, and strip them when seen. This allows the various
language-specific implementations to remain unaware of references.

gdb/ChangeLog:

        * varobj.c (varobj_value_has_mutated): If NEW_VALUE is
        a reference, strip the reference layer before calling
        the lang_ops value_has_mutated callback.

gdb/testsuite/ChangeLog:

        * gdb.ada/mi_dyn_arr: New testcase.

10 years agodaily update
Alan Modra [Thu, 27 Mar 2014 23:00:54 +0000 (09:30 +1030)]
daily update

10 years agoRemove `expout*' globals from parser-defs.h
Sergio Durigan Junior [Thu, 27 Mar 2014 22:10:40 +0000 (19:10 -0300)]
Remove `expout*' globals from parser-defs.h

This commit removes the "expout*" globals from our parser code, turning
them into a structure that is passed when an expression needs to be
evaluated.  This is the initial step to make our parser less
"globalized".

This is mostly a mechanical patch, which creates a structure containing
the "expout*" globals and then modify all the functions that handle them
in order to take the structure as argument.  It is big, and has been
reviewed at least 4 times, so I think everything is covered.

Below you can see the message links from the discussions:

- First attempt:

<https://sourceware.org/ml/gdb-patches/2012-01/msg00522.html>
Message-ID: <m3k44s7qej.fsf@gmail.com>

- Second attempt:

<https://sourceware.org/ml/gdb-patches/2012-06/msg00054.html>
Message-Id: <1338665528-5932-1-git-send-email-sergiodj@redhat.com>

- Third attempt:

<https://sourceware.org/ml/gdb-patches/2014-01/msg00949.html>
Message-Id: <1390629467-27139-1-git-send-email-sergiodj@redhat.com>

- Fourth (last) attempt:

<https://sourceware.org/ml/gdb-patches/2014-03/msg00546.html>
Message-Id: <1395463432-29750-1-git-send-email-sergiodj@redhat.com>

gdb/
2014-03-27  Sergio Durigan Junior  <sergiodj@redhat.com>

Remove some globals from our parser.
* language.c (unk_lang_parser): Add "struct parser_state"
argument.
* language.h (struct language_defn) <la_parser>: Likewise.
* parse.c (expout, expout_size, expout_ptr): Remove variables.
(initialize_expout): Add "struct parser_state" argument.
Rewrite function to use the parser state.
(reallocate_expout, write_exp_elt, write_exp_elt_opcode,
write_exp_elt_sym, write_exp_elt_block, write_exp_elt_objfile,
write_exp_elt_longcst, write_exp_elt_dblcst,
write_exp_elt_decfloatcst, write_exp_elt_type,
write_exp_elt_intern, write_exp_string, write_exp_string_vector,
write_exp_bitstring, write_exp_msymbol, mark_struct_expression,
write_dollar_variable): Likewise.
(parse_exp_in_context_1): Use parser state.
(insert_type_address_space): Add "struct parser_state" argument.
Use parser state.
(increase_expout_size): New function.
* parser-defs.h: Forward declare "struct language_defn" and
"struct parser_state".
(expout, expout_size, expout_ptr): Remove extern declarations.
(parse_gdbarch, parse_language): Rewrite macro declarations to
accept the parser state.
(struct parser_state): New struct.
(initialize_expout, reallocate_expout, write_exp_elt_opcode,
write_exp_elt_sym, write_exp_elt_longcst, write_exp_elt_dblcst,
write_exp_elt_decfloatcst, write_exp_elt_type,
write_exp_elt_intern, write_exp_string, write_exp_string_vector,
write_exp_bitstring, write_exp_elt_block, write_exp_elt_objfile,
write_exp_msymbol, write_dollar_variable,
mark_struct_expression, insert_type_address_space): Add "struct
parser_state" argument.
(increase_expout_size): New function.
* utils.c (do_clear_parser_state): New function.
(make_cleanup_clear_parser_state): Likewise.
* utils.h (make_cleanup_clear_parser_state): New function
prototype.
* aarch64-linux-tdep.c (aarch64_stap_parse_special_token):
Update calls to write_exp* in order to pass the parser state.
* arm-linux-tdep.c (arm_stap_parse_special_token): Likewise.
* i386-tdep.c (i386_stap_parse_special_token_triplet): Likewise.
(i386_stap_parse_special_token_three_arg_disp): Likewise.
* ppc-linux-tdep.c (ppc_stap_parse_special_token): Likewise.
* stap-probe.c (stap_parse_register_operand): Likewise.
(stap_parse_single_operand): Likewise.
(stap_parse_argument_1): Likewise.
(stap_parse_argument): Use parser state.
* stap-probe.h: Include "parser-defs.h".
(struct stap_parse_info) <pstate>: New field.
* c-exp.y (parse_type): Rewrite to use parser state.
(yyparse): Redefine to c_parse_internal.
(pstate): New global variable.
(parse_number): Add "struct parser_state" argument.
(write_destructor_name): Likewise.
(type_exp): Update calls to write_exp* and similars in order to
use parser state.
(exp1, exp, variable, qualified_name, space_identifier,
typename, typebase): Likewise.
(write_destructor_name, parse_number, lex_one_token,
classify_name, classify_inner_name, c_parse): Add "struct
parser_state" argument.  Update function to use parser state.
* c-lang.h: Forward declare "struct parser_state".
(c_parse): Add "struct parser_state" argument.
* ada-exp.y (parse_type): Rewrite macro to use parser state.
(yyparse): Redefine macro to ada_parse_internal.
(pstate): New variable.
(write_int, write_object_renaming, write_var_or_type,
write_name_assoc, write_exp_op_with_string, write_ambiguous_var,
type_int, type_long, type_long_long, type_float, type_double,
type_long_double, type_char, type_boolean, type_system_address):
Add "struct parser_state" argument.
(exp1, primary, simple_exp, relation, and_exp, and_then_exp,
or_exp, or_else_exp, xor_exp, type_prefix, opt_type_prefix,
var_or_type, aggregate, aggregate_component_list,
positional_list, others, component_group,
component_associations): Update calls to write_exp* and similar
functions in order to use parser state.
(ada_parse, write_var_from_sym, write_int,
write_exp_op_with_string, write_object_renaming,
find_primitive_type, write_selectors, write_ambiguous_var,
write_var_or_type, write_name_assoc, type_int, type_long,
type_long_long, type_float, type_double, type_long_double,
type_char, type_boolean, type_system_address): Add "struct
parser_state" argument.  Adjust function to use parser state.
* ada-lang.c (parse): Likewise.
* ada-lang.h: Forward declare "struct parser_state".
(ada_parse): Add "struct parser_state" argument.
* ada-lex.l (processInt, processReal): Likewise.  Adjust all
calls to both functions.
* f-exp.y (parse_type, parse_f_type): Rewrite macros to use
parser state.
(yyparse): Redefine macro to f_parse_internal.
(pstate): New variable.
(parse_number): Add "struct parser_state" argument.
(type_exp, exp, subrange, typebase): Update calls to write_exp*
and similars in order to use parser state.
(parse_number): Adjust code to use parser state.
(yylex): Likewise.
(f_parse): New function.
* f-lang.h: Forward declare "struct parser_state".
(f_parse): Add "struct parser_state" argument.
* jv-exp.y (parse_type, parse_java_type): Rewrite macros to use
parser state.
(yyparse): Redefine macro for java_parse_internal.
(pstate): New variable.
(push_expression_name, push_expression_name, insert_exp): Add
"struct parser_state" argument.
(type_exp, StringLiteral, Literal, PrimitiveType, IntegralType,
FloatingPointType, exp1, PrimaryNoNewArray, FieldAccess,
FuncStart, MethodInvocation, ArrayAccess, PostfixExpression,
PostIncrementExpression, PostDecrementExpression,
UnaryExpression, PreIncrementExpression, PreDecrementExpression,
UnaryExpressionNotPlusMinus, CastExpression,
MultiplicativeExpression, AdditiveExpression, ShiftExpression,
RelationalExpression, EqualityExpression, AndExpression,
ExclusiveOrExpression, InclusiveOrExpression,
ConditionalAndExpression, ConditionalOrExpression,
ConditionalExpression, Assignment, LeftHandSide): Update
calls to write_exp* and similars in order to use parser state.
(parse_number): Ajust code to use parser state.
(yylex): Likewise.
(java_parse): New function.
(push_variable): Add "struct parser_state" argument.  Adjust
code to user parser state.
(push_fieldnames, push_qualified_expression_name,
push_expression_name, insert_exp): Likewise.
* jv-lang.h: Forward declare "struct parser_state".
(java_parse): Add "struct parser_state" argument.
* m2-exp.y (parse_type, parse_m2_type): Rewrite macros to use
parser state.
(yyparse): Redefine macro to m2_parse_internal.
(pstate): New variable.
(type_exp, exp, fblock, variable, type): Update calls to
write_exp* and similars to use parser state.
(yylex): Likewise.
(m2_parse): New function.
* m2-lang.h: Forward declare "struct parser_state".
(m2_parse): Add "struct parser_state" argument.
* objc-lang.c (end_msglist): Add "struct parser_state" argument.
* objc-lang.h: Forward declare "struct parser_state".
(end_msglist): Add "struct parser_state" argument.
* p-exp.y (parse_type): Rewrite macro to use parser state.
(yyparse): Redefine macro to pascal_parse_internal.
(pstate): New variable.
(parse_number): Add "struct parser_state" argument.
(type_exp, exp1, exp, qualified_name, variable): Update calls to
write_exp* and similars in order to use parser state.
(parse_number, yylex): Adjust code to use parser state.
(pascal_parse): New function.
* p-lang.h: Forward declare "struct parser_state".
(pascal_parse): Add "struct parser_state" argument.
* go-exp.y (parse_type): Rewrite macro to use parser state.
(yyparse): Redefine macro to go_parse_internal.
(pstate): New variable.
(parse_number): Add "struct parser_state" argument.
(type_exp, exp1, exp, variable, type): Update calls to
write_exp* and similars in order to use parser state.
(parse_number, lex_one_token, classify_name, yylex): Adjust code
to use parser state.
(go_parse): Likewise.
* go-lang.h: Forward declare "struct parser_state".
(go_parse): Add "struct parser_state" argument.

10 years ago * dwarf2read.c (read_str_index): Delete arg cu. All callers updated.
Doug Evans [Thu, 27 Mar 2014 19:42:50 +0000 (12:42 -0700)]
* dwarf2read.c (read_str_index): Delete arg cu.  All callers updated.

10 years ago * dwarf2read.c (init_cutu_and_read_dies_no_follow): Fix comments.
Doug Evans [Thu, 27 Mar 2014 19:03:34 +0000 (12:03 -0700)]
* dwarf2read.c (init_cutu_and_read_dies_no_follow): Fix comments.
Remove argument abbrev_section.  All callers updated.

10 years ago * dwarf2read.c (struct dwarf2_cu): Improve comments for members
Doug Evans [Thu, 27 Mar 2014 18:43:47 +0000 (11:43 -0700)]
* dwarf2read.c (struct dwarf2_cu): Improve comments for members
addr_base, ranges_base.

10 years ago * gdb.dwarf2/dw2-abs-hi-pc.exp: Build tests with "nodebug".
Doug Evans [Thu, 27 Mar 2014 18:38:30 +0000 (11:38 -0700)]
* gdb.dwarf2/dw2-abs-hi-pc.exp: Build tests with "nodebug".

10 years agoScan all input files for symbol reference warning
H.J. Lu [Wed, 26 Mar 2014 19:18:59 +0000 (12:18 -0700)]
Scan all input files for symbol reference warning

This patch scans all input files for symbol reference warning if the
symbol reference doesn't exist in the current input file.

ld/

PR ld/16756
* ldmain.c (symbol_warning): New function.
(warning_callback): Use it.  Scan all input files for a reference
to SYMBOL.

ld/testsuite/

PR ld/16756
* ld-plugin/lto.exp: Expect filename and line number for PR
ld/12760 test.

10 years agoAdd support for limited pretty-printing of ARM PLT entries on eabi and nacl targets.
Yury Gribov [Thu, 27 Mar 2014 13:54:03 +0000 (13:54 +0000)]
Add support for limited pretty-printing of ARM PLT entries on eabi and nacl targets.

     * elf32-arm.c (elf32_arm_get_synthetic_symtab): Add new callback.
     (elf32_arm_nacl_plt_sym_val): Likewise.
     (elf32_arm_plt0_size): Add helper function.
     (elf32_arm_plt_size): Likewise.

     * ld-arm/arm-app-abs32.d: Updated test.
     * ld-arm/arm-app.d: Likewise.
     * ld-arm/arm-lib-plt32.d: Likewise.
     * ld-arm/arm-lib.d: Likewise.
     * ld-arm/armthumb-lib.d: Likewise.
     * ld-arm/cortex-a8-fix-b-plt.d: Likewise.
     * ld-arm/cortex-a8-fix-bcc-plt.d: Likewise.
     * ld-arm/cortex-a8-fix-bl-plt.d: Likewise.
     * ld-arm/cortex-a8-fix-bl-rel-plt.d: Likewise.
     * ld-arm/cortex-a8-fix-blx-plt.d: Likewise.
     * ld-arm/farcall-mixed-app-v5.d: Likewise.
     * ld-arm/farcall-mixed-app.d: Likewise.
     * ld-arm/farcall-mixed-lib-v4t.d: Likewise.
     * ld-arm/farcall-mixed-lib.d: Likewise.
     * ld-arm/ifunc-10.dd: Likewise.
     * ld-arm/ifunc-14.dd: Likewise.
     * ld-arm/ifunc-15.dd: Likewise.
     * ld-arm/ifunc-3.dd: Likewise.
     * ld-arm/ifunc-4.dd: Likewise.
     * ld-arm/ifunc-7.dd: Likewise.
     * ld-arm/ifunc-8.dd: Likewise.
     * ld-arm/ifunc-9.dd: Likewise.
     * ld-arm/long-plt-format.d: Likewise.
     * ld-arm/mixed-app-v5.d: Likewise.
     * ld-arm/mixed-app.d: Likewise.
     * ld-arm/mixed-lib.d: Likewise.
     * ld-arm/thumb2-bl-undefweak.d: Likewise.
     * ld-arm/thumb2-bl-undefweak1.d: Likewise.

10 years agoThis is a fix for PR ld/16761 - the linker now has a dependence upon the binutils
Yaakov Selkowitz [Thu, 27 Mar 2014 13:36:36 +0000 (13:36 +0000)]
This is a fix for PR ld/16761 - the linker now has a dependence upon the binutils
because it needs to windres tool (for some targets).

* Makefile.def (dependencies): Make all-ld depend on all-binutils
for WINDRES_FOR_TARGET in default-manifest.o rule.
* Makefile.in: Regenerate.

10 years agoMach-O: disp dyld environment command in objdump -P load.
Tristan Gingold [Wed, 26 Mar 2014 09:40:49 +0000 (10:40 +0100)]
Mach-O: disp dyld environment command in objdump -P load.

bfd/
* mach-o.c (bfd_mach_o_read_dylinker): Remove assert.
(bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT.
binutils/
* od-macho.c (dump_load_command): Display value for
BFD_MACH_O_LC_DYLD_ENVIRONMENT.  Handle BFD_MACH_O_LC_DATA_IN_CODE
and BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS.

10 years agoThis fixes a compile time error triggered by -Werror=format-security because
Nick Clifton [Thu, 27 Mar 2014 09:41:06 +0000 (09:41 +0000)]
This fixes a compile time error triggered by -Werror=format-security because
a call to sprintf was being made with a non-constant formatting string.

* config/tc-score.c (s3_parse_pce_inst): Add "%s" parameter to
sprintf in order to avoid a compile time warning.

10 years agoMach-O: add objdump -P function_starts to display function starts.
Tristan Gingold [Tue, 25 Mar 2014 14:51:54 +0000 (15:51 +0100)]
Mach-O: add objdump -P function_starts to display function starts.

bfd/
* mach-o.h (bfd_mach_o_get_base_address): New prototype.
* mach-o.c (bfd_mach_o_write_symtab)
(bfd_mach_o_write_contents)
(bfd_mach_o_set_section_flags_from_bfd)
(bfd_mach_o_build_seg_command): Fix indentation.
(bfd_mach_o_get_base_address): New function.

binutils/
* od-macho.c (OPT_FUNCTION_STARTS): New macro.
(options): Add entry for function_starts.
(mach_o_help): Ditto.
(disp_segment_prot): New function.
(dump_section_map): Call disp_segment_prot.
(dump_function_starts): New function.
(dump_obj_compact_unwind): Fix ouput indentation.
(dump_exe_compact_unwind): Fix ouput indentation.
(mach_o_dump): Handle function_starts.

10 years agoReturn zero in can_single_step_to_signal_handler for nios2-*-* target
Yao Qi [Wed, 26 Mar 2014 09:44:14 +0000 (17:44 +0800)]
Return zero in can_single_step_to_signal_handler for nios2-*-* target

nios2 uses software single step, so GDB is unable to single step to
the signal handler.  In order to reflect this, teach
can_single_step_to_signal_handler to return zero for nios2 target.

gdb/testsuite:

2014-03-27  Yao Qi  <yao@codesourcery.com>

* lib/gdb.exp (can_single_step_to_signal_handler): Return zero
if target is nios2-*-*.

10 years agoobjdump: set address of debug sections.
Tristan Gingold [Mon, 24 Mar 2014 11:37:32 +0000 (12:37 +0100)]
objdump: set address of debug sections.

This patche fixes the values of FDE pc in output of objdump -Wf. They now
match readelf ones.

binutils/
* objdump.c (load_specific_debug_section): Set address of section.

10 years agodaily update
Alan Modra [Wed, 26 Mar 2014 23:00:50 +0000 (09:30 +1030)]
daily update

10 years ago[AArch64 disassembler] Add missing checks of undefine encodings on
Yufeng Zhang [Wed, 26 Mar 2014 18:44:27 +0000 (18:44 +0000)]
[AArch64 disassembler] Add missing checks of undefine encodings on
st1/st2/st3/st4 instructions.

opcodes/

* aarch64-dis.c (aarch64_ext_ldst_elemlist): Check H/S undefined
instructions.

binutils/testsuite/

* binutils-all/aarch64/aarch64.exp: New test driver for AArch64.
* binutils-all/aarch64/unallocated-encoding.s: New testcase.
* binutils-all/aarch64/unallocated-encoding.d: Ditto.

10 years agoAdd support for %hi8, %hi16 and %lo16 being used when relocation are necessary.
Nick Clifton [Wed, 26 Mar 2014 16:34:04 +0000 (16:34 +0000)]
Add support for %hi8, %hi16 and %lo16 being used when relocation are necessary.

* config/tc-rl78.c (rl78_op): Issue an error message if a 16-bit
relocation is used on an 8-bit operand or vice versa.
(tc_gen_reloc): Use the RL78_16U relocation for RL78_CODE.
(md_apply_fix): Add support for RL78_HI8, RL78_HI16 and RL78_LO16.

10 years agoThis fixes a problem for 64-bit Cygwin, where building some packages can
Nick Clifton [Wed, 26 Mar 2014 16:16:20 +0000 (16:16 +0000)]
This fixes a problem for 64-bit Cygwin, where building some packages can
produce spurious errors about truncated relocations.  The relocations are
only truncated because they are being made against sections which are going
to be discarded so that base address is zero instead of the expected 64-bit
base value.

* cofflink.c (_bfd_coff_generic_relocate_section): Skip
relocations in discarded sections.

10 years agoRemove VAR_DOMAIN/STRUCT_DOMAIN ambiguity from ada-tasks.c.
Keith Seitz [Wed, 26 Mar 2014 15:25:03 +0000 (08:25 -0700)]
Remove VAR_DOMAIN/STRUCT_DOMAIN ambiguity from ada-tasks.c.

2014-03-26  Keith Seitz  <keiths@redhat.com>

* ada-tasks.c (get_tcb_types_info): Search STRUCT_DOMAIN for
types, not VAR_DOMAIN.

10 years agoMach-O: Add BFD_MACH_O_CPU_TYPE_ARM64.
Tristan Gingold [Wed, 26 Mar 2014 09:40:06 +0000 (10:40 +0100)]
Mach-O: Add BFD_MACH_O_CPU_TYPE_ARM64.

include/mach-o/
        * loader.h (bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_ARM64.

bfd/
        * mach-o.c (bfd_mach_o_convert_architecture): Add
        BFD_MACH_O_CPU_TYPE_ARM64.

binutils/
        * od-macho.c (bfd_mach_o_cpu_name): Add BFD_MACH_O_CPU_TYPE_ARM64.

10 years agoReferencing a function's address on PowerPC64 ELFv2
Alan Modra [Tue, 25 Mar 2014 04:42:48 +0000 (15:12 +1030)]
Referencing a function's address on PowerPC64 ELFv2

ELFv2 needs to create plt entries in a non-PIC executable for an
address reference to a function defined in a shared object.  It's
possible that an object file has no features that distinguish it as
ELFv1 or ELFv2, eg. an object only containing data.  Such files need
to be handled like those that are known to be ELFv2.
However, this unnecessarily creates plt entries for the analogous
ELFv1 case, so arrange to set output abi version earlier, and use the
output abi version to further distinguish ambiguous input files.

bfd/
* elf64-ppc.c (ppc64_elf_check_relocs): Account for possibly
needed plt entries when taking the address of functions for
abiversion == 0 (ie. unknown) as well as abiversion == 2.
Move opd setup and abiversion checks to..
(ppc64_elf_before_check_relocs): ..here.  Renamed from
ppc64_elf_process_dot_syms.  Set output abiversion from input and
input abiversion from output, if either is not set.
(ppc64_elf_merge_private_bfd_data): Don't merge flags here.
(elf_backend_check_directives): Update.
ld/testsuite/
* ld-powerpc/startv1.s, * ld-powerpc/startv2.s, * ld-powerpc/funref.s,
* ld-powerpc/funv1.s, * ld-powerpc/funv2.s,
* ld-powerpc/ambiguousv1.d, * ld-powerpc/ambiguousv2.d: New test files.
* ld-powerpc/powerpc.exp: Run new tests.

10 years agoSkip tests on completion and readline when readline lib isn't used
Yao Qi [Wed, 19 Mar 2014 02:16:35 +0000 (10:16 +0800)]
Skip tests on completion and readline when readline lib isn't used

The completion feature and other features on readline depend on the
readline library.  However, readline library is not always used, for
example, running testsuite like

  make check RUNTESTFLAGS="--host_board=local-remote-host"

the input stream is not a tty, and GDB doesn't use readline library
as a result.

This patch is to skip tests on completion and readline if
'show editing' is off, which means readline isn't used.  Note that
some tests in gdb.base/completion.exp test command complete, which
isn't related to readline, so these tests aren't affected by readline
library.  This patch also moves these tests up, run them
unconditionally, and run the rest if readline library is used.

gdb/testsuite:

2014-03-26  Yao Qi  <yao@codesourcery.com>

* lib/gdb.exp (readline_is_used): New proc.
* gdb.base/completion.exp: Move tests on command complete up.
Skip the rest of tests if readline is not used.
* gdb.ada/complete.exp: Skp the test if readline is not
used.
* gdb.base/filesym.exp: Likewise.
* gdb.base/macscp.exp: Likewise.
* gdb.base/readline-ask.exp: Likewise.
* gdb.base/readline.exp: Likewise.
* gdb.python/py-cmd.exp: Likewise.
* gdb.trace/tfile.exp: Likewise.

10 years agoFix code format issues gdb.base/macscp.exp
Yao Qi [Tue, 18 Mar 2014 12:26:58 +0000 (20:26 +0800)]
Fix code format issues gdb.base/macscp.exp

When I do something else, I find code format in gdb.base/macscp.exp is
messy.  This patch is to fix various code format issues in it.

Pushed as it is obvious.

gdb/testsuite:

2014-03-26  Yao Qi  <yao@codesourcery.com>

* gdb.base/macscp.exp: Fix code format issues.

10 years agoFix type of "fp" and other registers for Nios II.
Sandra Loosemore [Wed, 26 Mar 2014 04:00:17 +0000 (21:00 -0700)]
Fix type of "fp" and other registers for Nios II.

2014-03-25  Sandra Loosemore  <sandra@codesourcery.com>

gdb/
* features/nios2-cpu.xml: Correct types of "gp", "fp", "ea", and
"ra" registers.
* features/nios2-linux.c: Regenerated.
* features/nios2.c: Regenerated.

10 years agodaily update
Alan Modra [Tue, 25 Mar 2014 23:00:48 +0000 (09:30 +1030)]
daily update

10 years agoThis patch adds a new pseudo-op - .seh_code - to structured exception handling
Nick Clifton [Tue, 25 Mar 2014 16:50:10 +0000 (16:50 +0000)]
This patch adds a new pseudo-op - .seh_code - to structured exception handling
suite of ops.  It changes the current section back to the code section of the
current function.  This is helpful because the code section may not be .text.

* config/obj-coff-seh.c (obj_coff_seh_code): New function -
switches the current segment back to the code segment recorded
when seh_proc was last invoked.
* config/obj-coff-seh.h (SEH_CMDS): Add seh_code.

10 years agoSupport gdb.asm/asm-source.exp on powerpc64le
Ulrich Weigand [Tue, 25 Mar 2014 14:39:32 +0000 (15:39 +0100)]
Support gdb.asm/asm-source.exp on powerpc64le

Add new powerpc64le.inc file appropriate for the ELFv2 ABI and
use it to support the asm-source.exp test case on powerpc64le.

gdb/testsuite/
2014-03-25  Ulrich Weigand  <uweigand@de.ibm.com>

* gdb.asm/asm-source.exp: Handle powerpc64le-* targets.
* gdb.asm/powerpc64le.inc: New file.

10 years ago"source", foreground execution commands, and target-async
Pedro Alves [Tue, 25 Mar 2014 11:45:53 +0000 (11:45 +0000)]
"source", foreground execution commands, and target-async

Sourcing a GDB script that runs foreground execution commands in
succession fails if the target can async:

 Breakpoint 1, main () at ../../../src/gdb/testsuite/gdb.base/source-execution.c:36
 36        func1 ();
 (gdb) source ../../../src/gdb/testsuite/gdb.base/source-execution.gdb
 ../../../src/gdb/testsuite/gdb.base/source-execution.gdb:21: Error in sourced command file:
 Cannot execute this command while the selected thread is running.
 (gdb) FAIL: gdb.base/source-execution.exp: source source-execution.gdb

That is, after a foreground execution command, GDB moves on to the
following command immediately before waiting for the previous command
to complete.

https://sourceware.org/ml/gdb-patches/2011-09/msg00037.html (b4a14fd0)
addressed this for command lists, Python's gdb.execute, etc., but
missed "source".  Fixed now in the same way.

gdb/
2014-03-25  Pedro Alves  <palves@redhat.com>

* cli/cli-script.c (script_from_file): Force the interpreter to
sync mode.

gdb/testsuite/
2014-03-25  Pedro Alves  <palves@redhat.com>
    Doug Evans  <dje@google.com>

* gdb.base/source-execution.c: New file.
* gdb.base/source-execution.exp: New file.
* gdb.base/source-execution.gdb: New file.

10 years agobfd/elfnn-aarch64.c: Fix calculation of DT_RELASZ
Will Newton [Fri, 14 Mar 2014 11:45:32 +0000 (11:45 +0000)]
bfd/elfnn-aarch64.c: Fix calculation of DT_RELASZ

The current code subtracts the size of the output section containing
relplt from RELASZ. In some cases this will be the same output
section as the dynamic relocs causing a value of zero to be output.
Calculating the size from input sections seems to make more sense.

bfd/ChangeLog:

2014-03-25  Will Newton  <will.newton@linaro.org>

 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections):
 Set value of DT_PLTRELSZ and DT_RELASZ based on the size
 of input sections rather than output sections.

ld/testsuite/ChangeLog:

2014-03-25  Will Newton  <will.newton@linaro.org>

 * ld-aarch64/aarch64-elf.exp: Add relasz dump test.
 * ld-aarch64/relasz.d: New file.
 * ld-aarch64/relasz.s: Likewise.

10 years agoRevert "Remove magic treatment of toc symbols for powerpc ELF"
Alan Modra [Tue, 25 Mar 2014 01:31:09 +0000 (12:01 +1030)]
Revert "Remove magic treatment of toc symbols for powerpc ELF"

It turns out that glibc's sysdeps/powerpc/powerpc64/start.S uses this
feature.  :-(

* config/tc-ppc.c (ppc_is_toc_sym): Revert 2014-03-05.
(md_assemble): Likewise.  Warn.

10 years agogdb.linespec/macro-relative.exp: Mark the test as unsupported if using fission.
Doug Evans [Mon, 24 Mar 2014 23:03:20 +0000 (16:03 -0700)]
gdb.linespec/macro-relative.exp: Mark the test as unsupported if using fission.

10 years agodaily update
Alan Modra [Mon, 24 Mar 2014 23:00:39 +0000 (09:30 +1030)]
daily update

10 years agoFix PR breakpoints/16101: gdb.base/dprintf.exp agent-printf failures with non-Z0...
Hui Zhu [Mon, 24 Mar 2014 19:30:50 +0000 (19:30 +0000)]
Fix PR breakpoints/16101: gdb.base/dprintf.exp agent-printf failures with non-Z0-supporting gdbservers

After a previous patch that was committed by Pedro (0000e5cc), trying
to set a dprintf with with a GDBserver that doesn't support agent
commands at all now throws an error.  But the dprintf tests still fail
with some GDBserver targets because they doesn't try to handle the
case of the server reporting support for breakpoint commands, but not
be able to use those in combination with Z0 (because Z0 isn't actually
supported, for example):

 FAIL: gdb.base/dprintf.exp: 1st dprintf, agent
 FAIL: gdb.base/dprintf.exp: 2nd dprintf, agent
 FAIL: gdb.base/dprintf.exp: dprintf info 2 (pattern 4)

Similarly for the MI test.

This patch makes the tests handle this scenario.

Tested with native, and native gdbserver on x86_64 Fedora 17.

Also tested with the native-gdbserver.exp board hacked with:

 set GDBFLAGS "${GDBFLAGS} -ex \"set remote breakpoint-commands off\""

(actually, "set remote breakpoint-commands off" is presently broken,
so this was on top of a fix for that command.)

which results in:
 (gdb) PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb
 set dprintf-style agent
 warning: Target cannot run dprintf commands, falling back to GDB printf
 warning: Target cannot run dprintf commands, falling back to GDB printf
 (gdb) UNSUPPORTED: gdb.base/dprintf.exp: set dprintf style to agent

gdb.sum:
 Running target native-gdbserver
 Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ...
 PASS: gdb.base/dprintf.exp: dprintf
 PASS: gdb.base/dprintf.exp: dprintf foo
 PASS: gdb.base/dprintf.exp: dprintf 29
 PASS: gdb.base/dprintf.exp: dprintf foo,"At foo entry\n"
 PASS: gdb.base/dprintf.exp: ignore $bpnum 1
 PASS: gdb.base/dprintf.exp: dprintf 26,"arg=%d, g=%d\n", arg, g
 PASS: gdb.base/dprintf.exp: dprintf info 1
 PASS: gdb.base/dprintf.exp: break 27
 PASS: gdb.base/dprintf.exp: 1st dprintf, gdb
 PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb
 UNSUPPORTED: gdb.base/dprintf.exp: set dprintf style to agent
 PASS: gdb.base/dprintf.exp: Set dprintf style to an unrecognized type

And also with the native-gdbserver.exp board hacked with:

 set GDBFLAGS "${GDBFLAGS} -ex \"set remote Z-packet off\""

which results in:
 (gdb) continue
 Continuing.
 Warning:
 Cannot insert breakpoint 3: Target doesn't support breakpoints that have target side commands.
 Cannot insert breakpoint 4: Target doesn't support breakpoints that have target side commands.

 (gdb) UNSUPPORTED: gdb.base/dprintf.exp: 1st dprintf, agent

gdb.sum:
 Running target native-gdbserver
 Running ../../../src/gdb/testsuite/gdb.base/dprintf.exp ...
 PASS: gdb.base/dprintf.exp: dprintf
 PASS: gdb.base/dprintf.exp: dprintf foo
 PASS: gdb.base/dprintf.exp: dprintf 29
 PASS: gdb.base/dprintf.exp: dprintf foo,"At foo entry\n"
 PASS: gdb.base/dprintf.exp: ignore $bpnum 1
 PASS: gdb.base/dprintf.exp: dprintf 26,"arg=%d, g=%d\n", arg, g
 PASS: gdb.base/dprintf.exp: dprintf info 1
 PASS: gdb.base/dprintf.exp: break 27
 PASS: gdb.base/dprintf.exp: 1st dprintf, gdb
 PASS: gdb.base/dprintf.exp: 2nd dprintf, gdb
 PASS: gdb.base/dprintf.exp: set dprintf style to agent
 UNSUPPORTED: gdb.base/dprintf.exp: 1st dprintf, agent
 PASS: gdb.base/dprintf.exp: Set dprintf style to an unrecognized type

(One of the new comments mentions breakpoint always-inserted mode.
Actually testing with breakpoint always-inserted mode fails these
dprintf tests, due to the way they are written.  But that'll take a
more substancial rewrite of the tests, so I'm leaving that for another
day.)

gdb/testsuite/
2014-03-24  Hui Zhu  <hui@codesourcery.com>
    Pedro Alves  <palves@redhat.com>

PR breakpoints/16101
* gdb.base/dprintf.exp: Use unsupported rather than changing the
test pass/fail messages.  Detect missing support for dprintf when
breakpoints are actually inserted.
* gdb.base/mi-dprintf.exp: Detect missing support for dprintf when
breakpoints are actually inserted.
* lib/mi-support.exp (mi_run_cmd_full): Return -1 if continue
fails.