aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-06-28Make dwarf2_free_objfile staticTom Tromey6-13/+16
I noticed that dwarf2_free_objfile can be made static, by changing it to be a registry cleanup function. This simplifies the code, as well, because now symbol readers don't have to explicitly call it. Tested by the buildbot. gdb/ChangeLog 2018-06-28 Tom Tromey <tom@tromey.com> * coffread.c (coff_symfile_finish): Update. * xcoffread.c (xcoff_symfile_finish): Update. * elfread.c (elf_symfile_finish): Update. * symfile.h (dwarf2_free_objfile): Don't declare. * dwarf2read.c (_initialize_dwarf2_read): Use register_objfile_data_with_cleanup. (dwarf2_free_objfile): Now static. Change signature.
2018-06-28Remove 2 excessive executable permission flagsJan Kratochvil4-0/+8
Fedora rpmbuild has been complaining: *** WARNING: ./usr/src/debug/gdb-8.1.50.20180618-24.fc28.x86_64/gdb/gdbserver/x86-tdesc.h is executable but has empty or no shebang, removing executable bit gdb/gdbserver/ChangeLog 2018-06-28 Jan Kratochvil <jan.kratochvil@redhat.com> * x86-tdesc.h: Remove executable permission flag. gdb/testsuite/ChangeLog 2018-06-28 Jan Kratochvil <jan.kratochvil@redhat.com> * lib/compiler.c: Remove executable permission flag.
2018-06-28Fixed top frame assumption in watchpoint-hw-attachRichard Bunt3-5/+10
watchpoint-hw-attach.exp was noticed to fail on some machines. Thanks to the input from sergiodj and palves on the IRC channel, it was concluded that the test case incorrectly assumed that on attach it was landed in the top-most frame of the inferior. This was fixed by running to a break point in main by explicitly defining the source file name before continuing with the test. Tested on the following architectures x86_64, aarch64 and ppc64le. gdb/testsuite/ChangeLog: * gdb.base/watchpoint-hw-attach.c (main): Remove unneeded code. * gdb.base/watchpoint-hw-attach.exp: Break in outermost frame.
2018-06-28Add an optional offset option to the "add-symbol-file" commandPetr Tesarik7-4/+160
If all sections of a symbol file are loaded with a fixed offset, it is easier to specify that offset than listing all sections explicitly. There is also a similar option for "symbol-file". gdb/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * symfile.c (add_symbol_file_command, _initialize_symfile): Add option "-o" to add-symbol-file-load to add an offset to each section's load address. * symfile.c (set_objfile_default_section_offset): New function. gdb/doc/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * gdb.texinfo (Files): Document "add-symbol-file -o offset". gdb/testsuite/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * gdb.base/relocate.exp: Add test for "add-symbol-file -o ".
2018-06-28Make sure that sorting does not change section orderPetr Tesarik3-3/+17
Symbol files may contain multiple sections with the same name. Section addresses specified by add-symbol-file are assigned to the corresponding BFD sections in addr_info_make_relative using sorted indexes of both vectors. Since the sort algorithm is not inherently stable, the comparison function uses sectindex to maintain the original order. However, add_symbol_file_command uses zero for all sections, so if the user specifies multiple sections with the same name, they will be assigned randomly to symbol file sections with the same name. gdb/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * symfile.c (add_symbol_file_command): Make sure that sections
2018-06-28Make add-symbol-file's address argument optionalPetr Tesarik7-23/+55
The (first) .text section must be always specified as the second non-option argument. The documentation states that GDB cannot figure out this address by itself. This is true if the object file was indeed relocated, but it is also confusing, because all other sections can be omitted and will use the address provided by BFD. gdb/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * symfile.c (add_symbol_file_command, _initialize_symfile): Do not require the second argument. If omitted, load sections at the addresses specified in the file. gdb/doc/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * gdb.texinfo (Files): The address argument for "add-symbol-file" is no longer mandatory. gdb/testsuite/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * gdb.base/relocate.exp: Test add-symbol-file behavior when the address argument is omitted.
2018-06-28Add an optional offset option to the "symbol-file" commandPetr Tesarik7-7/+65
If the main file is relocated at runtime, all symbols are offset by a fixed amount. Let the user specify this offset when loading a symbol file. gdb/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * symfile.c (symbol_file_command, symbol_file_add_main_1) (_initialize_symfile): Add option "-o" to symbol-file to add an offset to each section of the symbol file. gdb/doc/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * gdb.texinfo (Files): Document "symbol-file -o offset". gdb/testsuite/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * gdb.base/relocate.exp: Add test for "symbol-file -o ".
2018-06-28Add myself as a write-after-approval GDB maintainer.Petr Tesarik2-0/+5
gdb/ChangeLog: 2018-06-28 Petr Tesarik <ptesarik@suse.cz> * MAINTAINERS (Write After Approval): Add Petr Tesarik.
2018-06-28Automatic date update in version.inGDB Administrator1-1/+1
2018-06-27Update "func" help text to GNU standardsTom Tromey2-2/+6
In my earlier series to change help text to follow the GNU standards for metasyntactic variables, I missed one: the "func" command. This patch updates its help text. Tested by the buildbot. gdb/ChangeLog 2018-06-27 Tom Tromey <tom@tromey.com> * stack.c (_initialize_stack): Update "func" help text.
2018-06-27Remove a VEC from py-unwind.cTom Tromey2-32/+39
This removes a use of VEC from py-unwind.c, replacing it wit std::vector. It also changes saved_regs to hold a gdbpy_ref<>, simplifying the memory management. Tested against gdb.python on x86-64 Fedora 26. gdb/ChangeLog 2018-06-27 Tom Tromey <tom@tromey.com> * python/py-unwind.c (unwind_info_object) <saved_regs>: Now a std::vector. (unwind_infopy_str, pyuw_create_unwind_info) (unwind_infopy_add_saved_register, pyuw_sniffer) (unwind_infopy_dealloc, unwind_infopy_add_saved_register): Update. (struct saved_reg): Add constructor. <value>: Now a gdbpy_ref<>.
2018-06-27Fix crash in machoread.cTom Tromey2-2/+8
"./gdb ./gdb" was crashing for me on macOS. Investigating showed that macho_symfile_read was crashing because "symbol_table" was being freed too soon. This was introduced by my earlier patch to change macho_symfile_read to use a std::vector. Tested on macOS 10.13.5 using "./gdb ./gdb". This should un-break various already existing tests (testsuite/gdb.gdb at least), so no new test case. I'm checking this in as obvious. gdb/ChangeLog 2018-06-27 Tom Tromey <tom@tromey.com> * machoread.c (macho_symfile_read): Define "symbol_table" earlier.
2018-06-27Format gdb-gdb.py.in with autopep8Simon Marchi2-3/+25
Format using "autopep8 -i". gdb/ChangeLog: * gdb-gdb.py.in: Format using autopep8.
2018-06-27Add pretty-printer for CORE_ADDRSimon Marchi2-0/+18
Add a pretty-printer that prints CORE_ADDR values in hex. gdb/ChangeLog: * gdb-gdb.py.in (CoreAddrPrettyPrinter): New class. (type_lookup_function): Recognize CORE_ADDR values.
2018-06-27gdb-gdb.py.in: Don't print value's tag_nameSimon Marchi2-1/+5
This has been removed recently. gdb/ChangeLog: * gdb-gdb.py.in (StructMainTypePrettyPrinter) <to_string>: Don't print tag_name.
2018-06-27gdb-gdb.py.in: Fix ordering of TypeFlags objects with Python 3Simon Marchi2-2/+9
Python 3 doesn't use __cmp__ to order objects, it uses __lt__. Because of this, we get this exception when trying to pretty-print "type" objects: I tested it with Python 2.7 as well. gdb/ChangeLog: * gdb-gdb.py.in (TypeFlag) <__cmp__>: Remove. <__lt__>: Add.
2018-06-27Copy gdb-gdb.py to build dirSimon Marchi5-4/+29
I have thought for a long time how nice it would be to have cool pretty printers for GDB's internal types. Well, turns out there are few already in gdb-gdb.py! Unfortunately, if you build GDB outside of the source directory, that file never gets loaded. top-gdb will look for a file called ../path/to/build/gdb/gdb-gdb.py but that file is in the source directory at ../path/to/src/gdb/gdb-gdb.py This patch makes it so we copy it to the build directory, just like we do for gdb-gdb.gdb. With this, I can at least see the file getting automatically loaded: (top-gdb) info pretty-printer global pretty-printers: builtin mpx_bound128 objfile /home/emaisin/build/binutils-gdb/gdb/gdb pretty-printers: type_lookup_function I noticed that running "make" didn't re-generate gdb-gdb.py from gdb-gdb.py.in. That's because it's copied when running the configure script and that's it. I added a rule in the Makefile for that (and for gdb-gdb.gdb too) and added them as a dependency to the "all" target. gdb/ChangeLog: * gdb-gdb.py: Move to... * gdb-gdb.py.in: ... here. * configure.ac (AC_CONFIG_FILES): Add gdb-gdb.py. * Makefile.in (all): Add gdb-gdb.gdb and gdb-gdb.py as dependencies. (distclean): Remove gdb-gdb.py when cleaning. (gdb-gdb.py, gdb-gdb.gdb): New rules. * configure: Re-generate.
2018-06-27Fix Cell debugging regressionPedro Alves2-4/+25
Commit 00431a78b28f ("Use thread_info and inferior pointers more throughout") broke Cell multi-arch debugging, because it made the proc-service routines (ps_lgetregs etc.) access registers using the SPU architecture if GDB happens to interrupt SPU code. The proc-service routines must always operate on the "main" (in this case PowerPC) architecture, because that's the register set libthread_db expects to be using. Restore the previous behavior, but wrapped in a new get_ps_regcache function with a describing comment. Also, the ps_l*regs routines have an explicit lwpid parameter that said commit missed; with the commit mentioned above, we started always reading the registers off of the current thread, which is incorrect. That is fixed by this commit too. gdb/ChangeLog: 2018-06-27 Pedro Alves <palves@redhat.com> * proc-service.c (get_ps_regcache): New. (ps_lgetregs, ps_lsetregs, ps_lgetfpregs) (ps_lsetfpregs): Use it.
2018-06-27Fix lost line info for symbol at addr zeroOmair Javaid5-10/+97
This patch fixes a unique condition where GDB fails to provide line information of symbol at address zero when code is compiled with text address zero but loaded at an offset > 0. For example lets compile following code snippet: int main() { return 0; } gcc -O0 -g3 -nostdlib -emain -Wl,-Ttext=0x00 -o file.out file.c Start gdb and run: add-symbol-file file.out 0xffff0000 info line main GDB will return error saying no line info is available for the symbol. This is a direct consequence of the fix for PR 12528 where GDB tries to ignore line table for a function which has been garbage collected by the linker. As the garbage collected symbols are sent to address zero GDB assumes a symbol actually placed at address zero as garbage collected. This was fixed with an additional check address < lowpc. But when symbol is loaded at an offset lowpc becomes lowpc + offset while no offset is added to address rather final symbol address is calculated based on baseaddr and address added together. So in case where symbols are loaded at an offset the condition address < lowpc will always return true. This patch fixes this by comparing address against a non offset lowpc. This patch also adds a GDB test case to replicate this behavior. gdb: 2018-06-27 Omair Javaid <omair.javaid@linaro.org> PR gdb/21695 * dwarf2read.c (lnp_state_machine::check_line_address): Update declaration. (dwarf_decode_lines_1): Adjust. gdb/testsuite: 2018-06-27 Omair Javaid <omair.javaid@linaro.org> PR gdb/21695 * gdb.base/infoline-reloc-main-from-zero.exp: New test. * gdb.base/infoline-reloc-main-from-zero.c: New file.
2018-06-27Add overrides, fix FreeBSD buildSimon Marchi2-2/+8
Fix this: CXX fbsd-nat.o In file included from fbsd-nat.c:44: ./fbsd-nat.h:40:7: error: 'find_memory_regions' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] int find_memory_regions (find_memory_region_ftype func, void *data); ^ ./target.h:702:17: note: overridden virtual function is here virtual int find_memory_regions (find_memory_region_ftype func, void *data) ^ In file included from fbsd-nat.c:44: ./fbsd-nat.h:42:8: error: 'info_proc' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] bool info_proc (const char *, enum info_proc_what); ^ ./target.h:950:18: note: overridden virtual function is here virtual bool info_proc (const char *, enum info_proc_what); ^ gdb/ChangeLog: * fbsd-nat.h (class fbsd_nat_target) <find_memory_regions>: Add override. <info_proc>: Likewise.
2018-06-27gas object file locationsAlan Modra3-112/+117
With the update to newer autotools, some gas object files are now built in config/, breaking xtensa-elf and ia64-vms. This patch fixes the dependencies. * configure.ac: Specify extra_objects with leading "config/" for xtensa-relax.o and te-vms.o. Use case statements to unique extra_objects. Formatting. * configure: Regenerate.
2018-06-27Automatic date update in version.inGDB Administrator1-1/+1
2018-06-26Minor reorganization of fetch_registers/store_registers in windows-nat.cJoel Brobecker2-48/+82
This patch is a small reorganizational patch that splits do_windows_fetch_inferior_registers into two parts: (a) One part that first reloads the thread's context when needed, and then decides based on the given register number whether one register needs to be fetched or all of them. This part is moved to windows_nat_target::fetch_registers. (b) The rest of the code, which actually fetches the register value and supplies it to the regcache. A similar treatment is applied to do_windows_store_inferior_registers. This change is preparation work for changing the way we calculate the location of a given register in the thread context structure, and should be a no op. gdb/ChangeLog: * windows-nat.c (do_windows_fetch_inferior_registers): Rename to windows_fetch_one_register, and only handle the case of fetching one register. Move the code that reloads the context and iterates over all registers if R is negative to... (windows_nat_target::fetch_registers): ... here. (do_windows_store_inferior_registers): Rename to windows_store_one_register, and only handle the case of storing one register. Move the code that handles the case where r is negative to... (windows_nat_target::store_registers) ... here. Tested on x86-windows and x86_64-windows using AdaCore's testsuite.
2018-06-26Support ptype/o in RustTom Tromey6-20/+106
This adds support for ptype/o to the Rust language code. By default, the Rust compiler reorders fields to reduce padding. So, the Rust language code sorts the fields by offset before printing. This may yield somewhat odd-looking results, but it is faithful to "what really happens", and might be useful when doing lower-level debugging. The reordering can be disabled using #[repr(c)]; ptype/o might be more useful in this case. gdb/ChangeLog 2018-06-26 Tom Tromey <tom@tromey.com> PR rust/22574: * typeprint.c (whatis_exp): Allow ptype/o for Rust. * rust-lang.c (rust_print_struct_def): Add podata parameter. Update. (rust_internal_print_type): Add podata parameter. (rust_print_type): Update. gdb/testsuite/ChangeLog 2018-06-26 Tom Tromey <tom@tromey.com> PR rust/22574: * gdb.rust/simple.exp (test_one_slice): Add ptype/o tests. * gdb.rust/simple.rs (struct SimpleLayout): New.
2018-06-26Move ptype/o printing code to typeprint.cTom Tromey4-156/+176
This moves the hole-printing support code for ptype/o from c-typeprint.c to be methods on print_offset_data. This allows the code to be used from non-C languages. gdb/ChangeLog 2018-06-26 Tom Tromey <tom@tromey.com> * typeprint.h (struct print_offset_data) <update, finish, maybe_print_hole>: New methods. <indentation>: New constant. * typeprint.c (print_offset_data::indentation): Define. (print_offset_data::maybe_print_hole, print_offset_data::update) (print_offset_data::finish): Move from c-typeprint.c and rename. * c-typeprint.c (OFFSET_SPC_LEN): Remove. (print_spaces_filtered_with_print_options): Update. (c_print_type_union_field_offset, maybe_print_hole) (c_print_type_struct_field_offset): Move to typeprint.c and rename. (c_type_print_base_struct_union): Update.
2018-06-26Updated translations.Nick Clifton15-13873/+18582
gas * po/uk.po: Updated Ukranian translation. bfd * po/uk.po: Updated Ukranian translation. ld * po/uk.po: Updated Ukranian translation. gold * po/uk.po: Updated Ukranian translation. opcodes * po/uk.po: Updated Ukranian translation. * po/de.po: Updated German translation. * po/pt_BR.po: Updated Brazilian Portuguese translation. binutils* po/sv.po: Updated Swedish translation. * po/uk.po: Updated Ukranian translation.
2018-06-26Fix the MSP430 assembler's parsing of register names.Nick Clifton3-133/+150
PR 23335 * config/tc-msp430.c (check_reg): Only accept register name strings that do not end in an alphanumeric character. * testsuite/gas/msp430/msp430x.d: Update expected disassembly.
2018-06-26PR23169 bogus testAlan Modra2-1/+20
The testcase isn't valid. If it happens to run on your target, you're lucky. PR 23169 * testsuite/ld-ifunc/ifunc.exp: Don't run pr23169 tests on powerpc. Comment.
2018-06-26Fix parens in ld bootstrap.expAlan Modra2-2/+9
Seen with tcl 8.5.13: ERROR: tcl error sourcing .../ld/testsuite/ld-bootstrap/bootstrap.exp. ERROR: expected boolean value but got " [istarget ia64-*-elf*] || [istarget ia64-*-linux*" while executing "if { "$flags" == "--static" && { [istarget ia64-*-elf*] || [istarget ia64-*-linux*] } || [istarget mips*-*-linux*] } { # On ia64 and mips, tmpdir/l..." * testsuite/ld-bootstrap/bootstrap.exp: Use parentheses rather than curly braces in logical expression.
2018-06-26Revert "Use offsets instead of addresses in ELF_SECTION_IN_SEGMENT for non ↵Alan Modra2-3/+5
SHT_NOBITS" This reverts commit 57c0d77c2ce5e583dab322e05f8291bcbad0ccd3.
2018-06-26Fix spelling mistakes.Nick Clifton9-8/+23
opcodes * nfp-dis.c: Fix spelling mistake. ld * emultempl/aarch64elf.em: Fix spelling mistake. * emultempl/avrelf.em: Likewise. * emultempl/elf32.em: Likewise. binutils* doc/binutils.texi: Fix spelling mistakes. * README--how-to-make-a-release: Likewise.
2018-06-26Automatic date update in version.inGDB Administrator1-1/+1
2018-06-25gdb: For macOS, s/thread_info/struct thread_info/Pedro Alves3-15/+27
The macOS build currently fails with several instances of this problem: In file included from ../../src/gdb/darwin-nat.h:22:0, from ../../src/gdb/i386-darwin-nat.c:37: ../../src/gdb/gdbthread.h:376:59: error: type/value mismatch at argument 1 in template parameter list for 'template<class T, class Policy> class gdb::ref_ptr' = gdb::ref_ptr<thread_info, refcounted_object_ref_policy>; ^ ../../src/gdb/gdbthread.h:376:59: note: expected a type, got 'thread_info' ../../src/gdb/gdbthread.h:396:28: error: variable or field 'delete_thread' declared void extern void delete_thread (thread_info *thread); ^ (...) This is because there's a thread_info function in the Darwin/XNU/mach API: http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/thread_info.html Fix this in the same way it had been fixed in commit 7aabaf9d4ad5 ("Create private_thread_info hierarchy"), by adding an explicit "struct" keyword. gdb/ChangeLog: 2018-06-25 Pedro Alves <palves@redhat.com> * gdbthread.h (thread_info_ref, delete_thread) (delete_thread_silent, first_thread_of_inferior) (any_thread_of_inferior, switch_to_thread) (enable_thread_stack_temporaries) (thread_stack_temporaries_enabled_p, push_thread_stack_temporary) (get_last_thread_stack_temporary) (value_in_thread_stack_temporaries, can_access_registers_thread): Spell out "struct thread_info" instead of just "thread_info". * inferior.h (notice_new_inferior): Likewise.
2018-06-25gdb: Fix build on several hosts/portsPedro Alves9-13/+39
Commit 00431a78b28f ("Use thread_info and inferior pointers more throughout") missed updating some callers, like e.g.,: gdb/remote-sim.c: In member function 'virtual void gdbsim_target::mourn_inferior()': gdb/remote-sim.c:1198:50: error: cannot convert 'ptid_t' to 'thread_info*' for argument '1' to 'void delete_thread_silent(thread_info*)' delete_thread_silent (sim_data->remote_sim_ptid); gdb/mygit/src/gdb/procfs.c: In member function ‘virtual void procfs_target::detach(inferior*, int)’: gdb/mygit/src/gdb/procfs.c:1931:23: error: invalid conversion from ‘int’ to ‘inferior*’ [-fpermissive] detach_inferior (pid); ^ In file included from gdb/mygit/src/gdb/procfs.c:24:0: gdb/mygit/src/gdb/inferior.h:476:13: note: initializing argument 1 of ‘void detach_inferior(inferior*)’ etc. This fixes it. The delete_thread_silent calls in both go32-nat.c and remote-sim.c are unnecessary because generic_mourn_inferior calls exit_inferior, which deletes the inferior's threads. gdb/ChangeLog: 2018-06-25 Pedro Alves <palves@redhat.com> * windows-nat.c (windows_delete_thread): Use find_thread_ptid and pass thread_info pointer to delete_thread. (windows_nat_target::detach): Pass inferior pointer to detach_inferior. * aix-thread.c (sync_threadlists): Pass thread_info pointer to delete_thread. * bsd-kvm.c (bsd_kvm_target::close): Use discard_all_inferiors. * darwin-nat.c (darwin_check_new_threads): Use find_thread_ptid and pass a thread_info pointer to delete_thread. * fbsd-nat.c (fbsd_nat_target::wait): Use find_thread_ptid and pass thread_info pointer to delete_thread. * go32-nat.c (go32_nat_target::mourn_inferior): Remove delete_thread_silent call. * procfs.c (procfs_target::detach): Pass inferior pointer to detach_inferior. (procfs_target::wait): Pass thread_info pointer to delete_thread. * remote-sim.c (gdbsim_target::mourn_inferior): Remove delete_thread_silent call. * windows-nat.c (windows_delete_thread): Use find_thread_ptid and pass thread_info pointer to delete_thread. (windows_nat_target::detach): Pass inferior pointer to delete_inferior.
2018-06-25Add a syntax table to dwarf-mode.elTom Tromey2-1/+15
This adds a syntax table for dwarf-mode to dwarf-mode.el. I noticed the need for this when trying to use mark-sexp (C-M-SPC) on a hex number -- it copied the trailing ">" as well, which isn't desirable. I've also bumped the version number to make this simpler to install via the Emacs package system. Tested locally. I'm checking this in. binutils/ChangeLog 2018-06-25 Tom Tromey <tom@tromey.com> * dwarf-mode.el (dwarf-mode-syntax-table): New variable. Bump version number.
2018-06-25Fix compile time warning message for the AArch64 BFD backend, about a ↵Nick Clifton2-3/+12
possible attempt to call sprintf on a NULL buffer pointer. * elfnn-aarch64.c (_bfd_aarch64_erratum_835769_stub_name): Check for malloc returning NULL. (_bfd_aarch64_erratum_843419_fixup): Check for _bfd_aarch64_erratum_835769_stub_name returning NULL.
2018-06-25Automatic date update in version.inGDB Administrator1-1/+1
2018-06-24Add more updated to release notesNick Clifton1-41/+56
2018-06-24Regenerate configure and pot files with updated binutils version number.Nick Clifton22-6332/+10761
2018-06-24Update version number on development (aka HEAD) branch.Nick Clifton3-11/+16
2018-06-24Add 2.30 branch notes to ChangeLogs and NEWS files.Nick Clifton14-2/+47
2018-06-24Automatic date update in version.inGDB Administrator1-1/+1
2018-06-23Bump version number and summarize new features in 1.16.Cary Coutant3-1/+24
gold/ * version.cc (version_string): Bump to 1.16. * NEWS: Add new features in 1.16.
2018-06-23Fix "may be used uninitialized" warning.Cary Coutant2-1/+6
gold/ PR gold/22914 * x86_64.cc (Target_x86_64::record_gnu_property): Initialize val.
2018-06-23Add x86-64 support for Indirect Branch Tracking (IBT).Cary Coutant2-4/+497
gold/ PR gold/22915 * x86_64.cc (Output_data_plt_x86_64_ibt): New class. (Target_x86_64::do_make_data_plt): (All instantiations) Check for IBT feature bit and create IBT PLTs.
2018-06-22Update support for .note.gnu.property sections.Cary Coutant9-83/+320
The original patch did not give the target enough hooks to discover that an input object file does not have a particular property. For the GNU_PROPERTY_X86_FEATURE_1_AND property, for example, where a missing property should be assumed to be all zeroes, and ANDed with other object modules, this is essential. We now store the target-specific properties locally in the Target structure as native uint32_t fields, then AND the per-object feature bits with the program's feature bits when we're finished processing each input object file. The target-specific properties are then added back to the output note section during finalization. gold/ PR gold/22914 * layout.cc (read_sized_value): Fix spelling of section name. (Layout::layout_gnu_property): Call Sized_target::record_gnu_property for target-specific properties; don't store them with target-independent properties yet. (Layout::merge_gnu_properties): New method. (Layout::add_gnu_property): New method. (Layout::create_gnu_properties_note): Call target to finalize target-specific properties. Fix spelling of output section name. * layout.h (Layout::merge_gnu_properties): New method. (Layout::add_gnu_property): New method. * object.cc (Sized_relobj_file::do_layout): Call Layout::merge_gnu_properties. * target.h (Target::merge_gnu_property): Remove. (Target::finalize_gnu_properties): New method. (Target::do_merge_gnu_property): Move to Sized_target and rename. (Target::do_finalize_gnu_properties): New virtual method. (Sized_target::record_gnu_property): Moved and renamed from Target::do_merge_gnu_property. (Sized_target::merge_gnu_properties): New virtual method. * x86_64.cc (Target_x86_64::isa_1_used_, isa_1_needed_) (feature_1_, object_feature_1_, seen_first_object_): New data members. (Target_x86_64::do_merge_gnu_property): Rename to ... (Target_x86_64::record_gnu_property): ... this. Save target-specific properties in Target class object. (Target_x86_64::merge_gnu_properties): New method. (add_property): New static inline function. (Target_x86_64::do_finalize_gnu_properties): New method. * testsuite/Makefile.am (gnu_property_test): Remove C source file; link directly without compiler driver. * testsuite/Makefile.in: Regenerate. * testsuite/gnu_property_a.S: Add _start.
2018-06-22Silence GCC 9 error about deprecated implicit copy constructor.Cary Coutant3-0/+19
Replacing push_back() with emplace_back() eliminates the calls to the copy constructor, but I still had to provide explicit copy constructors because of the call to vector::reserve(), which tries to instantiate them even though they'll never actually be called when reserve() is called on an empty vector. gold/ * incremental.cc (Sized_incremental_binary::setup_readers): Use emplace_back for GCC 5 and later. * incremental.h (Incremental_binary::Input_reader): Provide copy constructor. (Sized_incremental_binary::Sized_input_reader): Likewise.
2018-06-23Automatic date update in version.inGDB Administrator1-1/+1
2018-06-22Fix "info registers" regexes in gdb.base/jit-reader.expSimon Marchi2-27/+32
Commit e813d34 ("Align natural-format register values to the same column") changed the output of "info registers" (tabs to spaces), but didn't update gdb.base/jit-reader.exp. Update the regexes to expect spaces instead. gdb/testsuite/ChangeLog: * gdb.base/jit-reader.exp (jit_reader_test): Expect spaces in "info registers" output.
2018-06-22Add support for .note.gnu.property sections.Cary Coutant17-38/+693
elfcpp/ PR gold/22914 * elfcpp.h (NT_GNU_PROPERTY_TYPE_0): New note type. (GNU_PROPERTY_*): New Gnu property types. * x86_64.h (GNU_PROPERTY_X86_FEATURE_1_IBT) (GNU_PROPERTY_X86_FEATURE_1_SHSTK): New x86 feature bits. gold/ PR gold/22914 * layout.cc (Layout::Layout): Initialize gnu_properties_. (read_sized_value, write_sized_value): New functions. (Layout::layout_gnu_property): New method. (Layout::create_notes): Call create_gnu_properties_note. (Layout::create_gnu_properties_note): New method. * layout.h (Layout::layout_gnu_property): New method. (Layout::create_gnu_properties_note): New method. (Layout::Gnu_property, Layout::Gnu_properties): New types. (Layout::gnu_properties_): New data member. * object.cc (Sized_relobj_file::layout_gnu_property_section): New method. (Sized_relobj_file::do_layout): Handle .note.gnu.property sections. * object.h (Sized_relobj_file::layout_gnu_property_section): New method. * target.h (Target::merge_gnu_property): New method. (Target::do_merge_gnu_property): New virtual method. * x86_64.cc (Target_x86_64::do_merge_gnu_property): New method. * testsuite/Makefile.am (gnu_property_test): New test case. * testsuite/Makefile.in: Regenerate. * testsuite/gnu_property_a.S: New source file. * testsuite/gnu_property_b.S: New source file. * testsuite/gnu_property_c.S: New source file. * testsuite/gnu_property_main.c: New source file. * testsuite/gnu_property_test.sh: New test script.