aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-04-08Add support for generating and inserting build IDs into COFF binaries.Jon TURNEY25-191/+1101
* 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.
2014-04-08[testsuite] Disable Ctrl-V use for mingw hosts.Pierre Muller2-2/+15
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.
2014-04-08daily updateAlan Modra1-1/+1
2014-04-07[python] Fix gdb.Value.dynamic_type for reference values.Siva Chandra5-1/+18
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.
2014-04-07Add support to recognize clang.Doug Evans3-0/+13
* lib/compiler.c: Identify the clang compiler. * lib/compiler.cc: Ditto.
2014-04-07Fix spurious failures in ld-plugin/lto.expAndreas Schwab2-4/+10
* ld-plugin/lto.exp: Make "-Wp," prefix optional when filtering out _FORTIFY_SOURCE. ("Build libdummy.a 9", "PR ld/12696"): Mark as c++.
2014-04-07Fix ARI warning in darwin-nat.c::darwin_decode_messageJoel Brobecker2-1/+6
gdb/ChangeLog: * darwin-nat.c (darwin_decode_message): Remove trailing '\n' at end of warning message.
2014-04-07Report an error on objcopy/strip of sectionless binariesAlan Modra2-0/+12
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.
2014-04-07daily updateAlan Modra1-1/+1
2014-04-06daily updateAlan Modra1-1/+1
2014-04-05Fix map file referenceAlan Modra2-1/+6
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.
2014-04-05daily updateAlan Modra1-1/+1
2014-04-04This fixes PR bootstrap/60620:Eric Botcazou3-0/+8
* Makefile.def (dependencies): Make gnattools depend on libstdc++-v3. * Makefile.in: Regenerate.
2014-04-04Document optional comma in linker script.Cary Coutant2-2/+13
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.
2014-04-04Add support for Intel SGX instructionsIlya Tocar15-3852/+3967
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.
2014-04-04mach-o: reject 64 bit targets when not configured for.Tristan Gingold2-0/+14
bfd/ * mach-o.c (bfd_mach_o_header_p): Reject 64 bit target when not configured for.
2014-04-04mach-o: fix section name conversion from bfd to mach-o.Tristan Gingold2-4/+10
bfd/ * mach-o.c (bfd_mach_o_convert_section_name_to_mach_o): Fix thinko on names length.
2014-04-04mach-o: output output_section target_index to write relocs.Tristan Gingold3-2/+10
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.
2014-04-04bfd_get_arch_size: return size from arch info on non-ELF targets.Tristan Gingold2-4/+10
bfd/ * bfd.c (bfd_get_arch_size): Default is taken from arch.
2014-04-04Pad sections according to current script FILL.Alan Modra9-1/+71
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.
2014-04-04daily updateAlan Modra1-1/+1
2014-04-03(read_cutu_die_from_dwo): Update function comment to match previous change.Doug Evans1-2/+2
2014-04-03 * dwarf2read.c (read_cutu_die_from_dwo): Fix assertion, at most oneDoug Evans2-2/+7
of stub_comp_unit_die, stub_comp_dir is non-NULL.
2014-04-03 * peXXigen.c (pe_print_edata): Verify edt.name lies insideJon Turney2-10/+33
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.
2014-04-03This fixes a problem building large (> 2Gb) binaries on 32-bit hosts. Using aMaria Guseva2-1/+7
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.
2014-04-03This patch allows one to place the gcc's liblto_plugin in the ↵Markus Trippelsdorf3-4/+15
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.
2014-04-03mach-o: fix warnings on 32 bit hosts. Display personality functions.Tristan Gingold4-7/+37
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.
2014-04-03mach-o: fix section number while writing symbols.Tristan Gingold2-7/+24
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.
2014-04-03Escape backslash in windows pathYao Qi2-2/+6
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.
2014-04-02Add support for two new moxie sign-extension instructionsAnthony Green2-2/+22
2014-04-03Fix sim breakageAlan Modra3-2/+4
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.
2014-04-03ChangeLog missed from last commitAlan Modra1-0/+10
2014-04-03Fix sim breakageAlan Modra3-5/+5
* 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.
2014-04-022014-04-02 Sriraman Tallam <tmsriram@google.com>Sriraman Tallam2-8/+13
* icf.cc (get_section_contents): Replace copies of reloc vectors with (const) references.
2014-04-02Add new sign-extension instructions to moxie portAnthony Green2-2/+7
2014-04-03daily updateAlan Modra1-1/+1
2014-04-02Modify gold testsuite to disable plugins added by GCC driver.Cary Coutant5-44/+102
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.
2014-04-02Add checks for overfar branchesDJ Delorie2-2/+17
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.
2014-04-02This fixes an internal error in GAS, triggered by the test case reported in ↵Nick Clifton2-2/+13
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.
2014-04-02mach-o: read and dump: prebound_dylib, prebind_cksum, twolevel_hints.Tristan Gingold7-9/+226
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.
2014-04-02Handle VDSO section headers past end of pageAlan Modra8-98/+184
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.
2014-04-02daily updateAlan Modra1-1/+1
2014-04-01* dwarf2read.c (read_cutu_die_from_dwo): Improve comment.Doug Evans2-3/+9
2014-04-01bfd/mach-o: avoid a crash when num == 0 in reloc.Tristan Gingold2-2/+6
bfd/ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash when num == 0.
2014-04-01mach-o: display data_in_code.Tristan Gingold2-7/+89
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.
2014-04-01darwin-nat: avoid crash while debugging gdb.Tristan Gingold2-54/+98
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.
2014-04-01gdb.arch/ppc64-atomic-inst.exp: Improve error handling.Anton Blanchard2-7/+12
gdb/testsuite/ 2014-04-01 Anton Blanchard <anton@samba.org> * gdb.arch/ppc64-atomic-inst.exp: Use untested. Make test messages unique.
2014-04-01gdb.arch/ppc64-atomic-inst.exp: Use standard_testfile, prepare_for_testing.Anton Blanchard2-11/+7
gdb/testsuite/ 2014-04-01 Anton Blanchard <anton@samba.org> * gdb.arch/ppc64-atomic-inst.exp: Use standard_testfile, prepare_for_testing.
2014-04-01Fix ppc64 single step over atomic sequence testcase.Anton Blanchard4-48/+78
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.
2014-03-31dwarf2read.c (read_cutu_die_from_dwo): Delete unused local comp_dir_string.Doug Evans2-1/+5