aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2019-02-26Fix build errors in aix-thread.cgdb-8.3-branchpointSimon Marchi2-7/+8
This patch fixes a few instances of unused variable and shadowed local variable errors. gdb/ChangeLog: * aix-thread.c (ptid_cmp): Remove unused variable. (get_signaled_thread): Likewise. (store_regs_user_thread): Likewise. (store_regs_kernel_thread): Likewise. (fetch_regs_kernel_thread): Remove shadowed variable.
2019-02-27Automatic date update in version.inGDB Administrator1-1/+1
2019-02-26gdb/riscv: Use legacy register numbers in default target descriptionAndrew Burgess7-10/+39
When the target description support was added to RISC-V, the register numbers assigned to the fflags, frm, and fcsr control registers in the default target descriptions didn't match the register numbers used by GDB before the target description support was added. What this means is that if a tools exists in the wild that is using hard-coded register number, setup to match GDB's old numbering, then this will have been broken (for fflags, frm, and fcsr) by the move to target descriptions. QEMU is such a tool. There are a couple of solutions that could be used to work around this issue: - The user can create their own xml description file with the register numbers setup to match their old tool, then load this by telling GDB 'set tdesc filename FILENAME'. - Update their old tool to use the newer default numbering scheme, or better yet add proper target description support to their tool. - We could have RISC-V GDB change to maintain the old defaults. This patch changes GDB back to using the old numbering scheme. This change is only visible to remote targets that don't supply their own xml description file and instead rely on GDB's default numbering. Note that even though 32bit-cpu.xml and 64bit-cpu.xml have changed, the corresponding .c file has not, this is because the numbering added to the registers in the xml files is number 0, this doesn't result in any new C code being generated . gdb/ChangeLog: * features/riscv/32bit-cpu.xml: Add register numbers. * features/riscv/32bit-fpu.c: Regenerate. * features/riscv/32bit-fpu.xml: Add register numbers. * features/riscv/64bit-cpu.xml: Add register numbers. * features/riscv/64bit-fpu.c: Regenerate. * features/riscv/64bit-fpu.xml: Add register numbers.
2019-02-26Fix new py-value.exp test caseTom Tromey2-1/+6
The new test case in py-value.exp fails -- the code was changed to throw ValueError, but the test still checks for TypeError. This patch fixes the problem. I'm checking this in. Tested on x86-64 Fedora 29. gdb/testsuite/ChangeLog 2019-02-26 Tom Tromey <tromey@adacore.com> * gdb.python/py-value.exp (test_value_from_buffer): Check for ValueError, not TypeError.
2019-02-26Document two argument form of gdb.Value constructorKevin Buettner4-0/+17
gdb/ChangeLog: * NEWS: Mention two argument form of gdb.Value constructor. gdb/doc/ChangeLog: * python.texi (Values From Inferior): Document second form of Value.__init__.
2019-02-26Add tests for gdb.Value(bufobj, type) constructorKevin Buettner2-0/+50
gdb/testsuite/ChangeLog: * gdb.python/py-value.exp (test_value_from_buffer): New proc with call from main program.
2019-02-26Define gdb.Value(bufobj, type) constructorKevin Buettner2-10/+67
Provided a buffer BUFOBJ and a type TYPE, construct a gdb.Value object with type TYPE, where the value's contents are taken from BUFOBJ. E.g... (gdb) python import struct (gdb) python unsigned_int_type=gdb.lookup_type('unsigned int') (gdb) python b=struct.pack('=I',0xdeadbeef) (gdb) python v=gdb.Value(b, unsigned_int_type) ; print("%#x" % v) 0xdeadbeef This two argument form of the gdb.Value constructor may also be used to obtain gdb values from selected portions of buffers read with Inferior.read_memory(). The test case (which is in a separate patch) demonstrates this use case. gdb/ChangeLog: * python/py-value.c (convert_buffer_and_type_to_value): New function. (valpy_new): Parse arguments via gdb_PyArg_ParseTupleAndKeywords. Add support for handling an optional second argument. Call convert_buffer_and_type_to_value as appropriate.
2019-02-26Define unique_ptr specialization for Py_buffer.Kevin Buettner2-0/+18
This patch causes PyBuffer_Release() to be called when the associated buffer goes out of scope. I've been using it as follows: ... Py_buffer_up buffer_up; Py_buffer py_buf; if (PyObject_CheckBuffer (obj) && PyObject_GetBuffer (obj, &py_buf, PyBUF_SIMPLE) == 0) { /* Got a buffer, py_buf, out of obj. Cause it to released when it goes out of scope. */ buffer_up.reset (&py_buf); } ... This snippet of code was taken directly from an upcoming patch to python-value.c. gdb/ChangeLog: * python/python-internal.h (Py_buffer_deleter): New struct. (Py_buffer_up): New typedef.
2019-02-26Automatic date update in version.inGDB Administrator1-1/+1
2019-02-25Fix BFD leak in dwarf2_get_dwz_file.John Baldwin2-1/+6
Previously if build_id_verify failed, dwz_bfd was cleared to NULL via release(), but the BFD object was not destroyed. Use reset() with nullptr instead to delete the BFD. gdb/ChangeLog: * dwarf2read.c (dwarf2_get_dwz_file): Reset dwz_bfd to nullptr instead of releasing ownership.
2019-02-25Fix crash when loading dwp filesJordan Rupprecht2-2/+7
When loading dwp files, we create an array of ELF sections indexed by the ELF section index in the dwp file. The size of this array is calculated by section_count, as returned by bfd_count_sections, plus 1 (to account for the null section at index 0). However, when loading the bfd file, strtab/symtab sections are not added to the list, nor do they increment section_count, so section_count is actually smaller than the number of ELF sections. This happens to work when using GNU dwp, which lays out .debug section first, with sections like .shstrtab coming at the end. Other tools, like llvm-dwp, put .strtab first, and gdb crashes when loading those dwp files. For instance, with the current state of gdb, loading a file like this: $ readelf -SW <file.dwp> [ 0] <empty> [ 1] .debug_foo PROGBITS ... [ 2] .strtab STRTAB ... ... results in section_count = 2 (.debug is the only thing placed into bfd->sections, so section_count + 1 == 2), and sectp->this_idx = 1 when mapping over .debug_foo in dwarf2_locate_common_dwp_sections, which passes the assertion that 1 < 2. However, using a dwp file produced by llvm-dwp: $ readelf -SW <file.dwp> [ 0] <empty> [ 1] .strtab STRTAB ... [ 2] .debug_foo PROGBITS ... ... results in section_count = 2 (.debug is the only thing placed into bfd->sections, so section_count + 1 == 2), and sectp->this_idx = 2 when mapping over .debug_foo in dwarf2_locate_common_dwp_sections, which fails the assertion that 2 < 2. The assertion hit is: gdb/dwarf2read.c:13009: internal-error: void dwarf2_locate_common_dwp_sections(bfd*, asection*, void*): Assertion `elf_section_nr < dwp_file->num_sections' failed. This patch changes the calculation of section_count to use elf_numsections, which should return the actual number of ELF sections.
2019-02-25Fix BFD leak in solib-darwin.cTom Tromey2-4/+5
commit 192b62ce0b4bb5c61188f570e127a26d2c32f716 ("Use class to manage BFD reference counts") changed darwin_get_dyld_bfd to use: + dyld_bfd.release (); rather than - do_cleanups (cleanup); However, using release here leaks the BFD. Instead, simply assigning "sub" to "dyld_bfd" achieves what was meant. gdb/ChangeLog 2019-02-25 Tom Tromey <tromey@adacore.com> * solib-darwin.c (darwin_get_dyld_bfd): Don't release dyld_bfd.
2019-02-25Extend objdump's --dwarf=follow-links option so that separate debug info ↵Nick Clifton13-55/+212
files will also be affected by other dump function, and symbol tables from separate debug info files will be used when disassembling the main file. * objdump.c (sym_ok): New function. (find_symbol_for_address): Use new function. (disassemble_section): Compare sections by name, not pointer. (dump_dwarf): Move code to initialise byte_get pointer and iterate over separate debug files from here to ... (dump_bfd): ... here. Add parameter indicating that a separate debug info file is being dumped. For main file, pull in the symbol tables from all separate debug info files. (display_object): Update call to dump_bfd. * doc/binutils.texi: Document extened behaviour of the --dwarf=follow-links option. * NEWS: Mention this new feature. * testsuite/binutils-all/objdump.WK2: Update expected output. * testsuite/binutils-all/objdump.exp (test_follow_debuglink): Add options and dump file parameters. Add extra test. * testsuite/binutils-all/objdump.WK3: New file. * testsuite/binutils-all/readelf.exp: Change expected output for readelf -wKis test. * testsuite/binutils-all/readelf.wKis: New file.
2019-02-25Automatic date update in version.inGDB Administrator1-1/+1
2019-02-24Re: PowerPC __tls_get_addr arg parsingAlan Modra2-0/+6
Fixes non-ELF powerpc build failure: tc-ppc.c:3009:1: error: ‘parse_tls_arg’ defined but not used * config/tc-ppc.c (parse_tls_arg): Wrap in #ifdef OBJ_ELF.
2019-02-24PR24144, pdp11-ld overwriting section data with zerosAlan Modra4-19/+32
bfd/ PR 24144 * pdp11.c (set_section_contents): Revert 2015-02-24 change. gas/ PR 24144 * config/obj-aout.c (obj_aout_frob_file_before_fix): Write to end of section to ensure file contents cover aligned section size.
2019-02-24Automatic date update in version.inGDB Administrator1-1/+1
2019-02-23Use '--readnever' when invoking GDB from gcore.inSergio Durigan Junior2-1/+6
Back when I proposed the '--readnever' feature, I somehow forgot or decided not to include the bits related to gcore.in in the original patch. This patch finally updates the gcore script to invoke GDB using '--readnever'. We've been carrying this patch on Fedora GDB for quite some time, and as expected the corefiles generated by gcore on Fedora don't have problems, which I think is the best indicator that the it's safe to generate corefiles using '--readnever'. gdb/ChangeLog: 2019-02-23 Sergio Durigan Junior <sergiodj@redhat.com> * gcore.in: Add '--readnever' option when invoking GDB.
2019-02-23Update copyright year range in gdb.ada/mi_ref_changeable testcaseJoel Brobecker6-5/+13
This patch fixes the copyright year range which escaped the 2019 update, because the patch was submitted in 2018, but only really pushed in 2019. Pushed: https://www.sourceware.org/ml/gdb-patches/2019-02/msg00109.html Submitted: https://www.sourceware.org/ml/gdb-patches/2018-12/msg00444.html We normally are pretty good at remembering those little things, but this one fell through the cracks. This commit fixes this, by re-running the copyright.py script and checking in the changes made by that script. gdb/testsuite/ChangeLog: * gdb.ada/mi_ref_changeable.exp: Update copyright year range. * gdb.ada/mi_ref_changeable/foo_rb20_056.adb: Likewise. * gdb.ada/mi_ref_changeable/pck.adb: Likewise. * gdb.ada/mi_ref_changeable/pck.ads: Likewise. * gdb.dwarf2/inlined_subroutine-inheritance.exp: Likewise.
2019-02-23Update copyright year range in gdb.texinfo and refcard.texJoel Brobecker3-4/+9
I missed those files which need to be updated manually when I did the copyright year range update. The copyright.py script reminds us of that fact with the following message at the end... REMINDER: Multiple copyright headers must be updated by hand: gdb/doc/gdb.texinfo gdb/doc/refcard.tex gdb/gdbarch.sh ... and somehow I missed this. This commit makes the change for gdb.texinfo and refcard.tex. gdbarch.sh is being updated separately by Andrew Burgess. gdb/doc/ChangeLog: * gdb.texinfo: Update copyright year ranges. * refcard.tex: Likewise.
2019-02-23Automatic date update in version.inGDB Administrator1-1/+1
2019-02-22Update my email addressSimon Marchi2-1/+5
Since this is my last day at Ericsson, I am changing my email for my personal one in the MAINTAINERS file.
2019-02-22Look for build-id-based separate debug files under the sysrootSimon Marchi2-43/+78
When looking for a separate debug file that matches a given build-id, GDB only looks in the host's debug dir (typically /usr/lib/debug). This patch makes it look in the sysroot as well. This is to match the behavior of GDB when using debuglink-based separate debug files, introduced in : 402d2bfec42 ("Look for separate debug files in debug directories under a sysroot.") In the following example, my sysroot is "/tmp/sysroot" and I am trying to load symbols for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so. This is the current behavior: (gdb) file /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Reading symbols from /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so... Looking for separate debug info (build-id) for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Trying /usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... no, unable to compute real path <snip> (No debugging symbols found in /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so) With this patch: (gdb) file /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Reading symbols from /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so... Looking for separate debug info (build-id) for /tmp/sysroot/usr/lib/arm-linux-gnueabihf/gconv/EBCDIC-AT-DE.so Trying /usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... no, unable to compute real path Trying /tmp/sysroot/usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... yes! Reading symbols from /tmp/sysroot/usr/lib/debug/.build-id/f3/d6594d2600e985812cd4ba2ad083ac2aceae22.debug... In the original code, there is a suspicious "abfd.release ()" in build_id_to_debug_bfd, that I don't understand. If a file with the right name exists but its build-id note doesn't match, we release (leak) our reference, meaning the file will stay open? I removed it in the new code, so that the reference is dropped if we end up not using that file. I tested briefly by corrupting a separate debug file to trigger this code, nothing exploded. gdb/ChangeLog: * build-id.c (build_id_to_debug_bfd_1): New function. (build_id_to_debug_bfd): Look for separate debug file in sysroot.
2019-02-22gdb: Update copyright year range generated by gdbarch.shAndrew Burgess2-1/+6
The copyright year that gdbarch.sh places into the generated files gdbarch.{c,h} wasn't updated at the start of the year. After this commit the gdbarch.{c,h} files regenerate as the currently are in the tree. gdb/ChangeLog: * gdbarch.sh: Update the copyright year range that is placed into generated files.
2019-02-22Add missing ChangeLog entries for commit ↵Keith Seitz2-0/+12
bb995d00b3eef2f48d0be895c3509a7ddd8280a1
2019-02-22Fix symtab/23853: symlinked default symtabKeith Seitz3-4/+73
This patch attempts to fix a bug dealing with setting breakpoints in default symtabs that are symlinks. For example: (gdb) list 11 GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License 14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 15 16 static int 17 foo (void) 18 { 19 return 0; /* break here */ 20 } (gdb) 21 22 int 23 main (void) 24 { 25 return foo (); 26 } (gdb) b 19 No line 19 in the current file. Make breakpoint pending on future shared library load? (y or [n]) The problem here is that when create_sals_line_offset sets the default symtab, it immediately calls symtab_to_fullname, passing that fullname to collect_symtabs_from_filename to find all matching symtabs. This fails because we end up looking for a symtab with the name of the actual file on disk (which is different in this case because of the symlink) instead of the one stored in the debug info. Since we already have the lookup name of the default symtab, use it instead of the fullname. [This fullname thing was originally added in 2007 in a series dealing with *displaying* absolute file names. Clearly, this instance has nothing to do with the display of file names.] gdb/ChangeLog PR symtab/23853 * linespec.c (create_sals_line_offset): Search for the default symtab's filename instead of its fullname. gdb/testsuite/ChangeLog PR symtab/23853 * gdb.base/symlink-sourcefile.c: New file. * gdb.base/symlink-sourcefile.exp: New file.
2019-02-22Extend readelf and objdump so that they will display and follow multiple ↵Nick Clifton9-183/+377
links to separate debug information files. PR 23843 * dwarf.h (struct separate_info): New structure for containing information on separate debug info files. * dwarf.c (struct dwo_info): New structure for containing dwo links. (first_dwo_info): Chain of dwo_info structures. (first_separate_file): Chain of separate_info structures. (separate_debug_file, separate_debug_filename): Delete. (fetch_alt_indirect_string): Scan all separate debug info files for the requested string. (add_dwo_info): New function. (add_dwo_name): New function. (add_dwo_dir): New function. (add_dwo_id: New function. (free_dwo_info): New function. (read_and_display_attr_value): Store DWO data using the new functions. (load_debug_section_with_follow): If necessary, scan the list of separate debug info files for the requested section. (add_separate_debug_file): New function. (load_separate_debug_info): Call add_separate_debug_file to store the information on the newly loaded file. (load_dwo_file): Likewise. (load_separate_debif_file): Rename to load_separate_debug_files. Change return type to boolean. If following links then attempt to load all separate debug info files, not just the first one. (free_debug_memory): Release memory in dwo_info and separate_info chains. * objdump.c (dump_dwarf): Iterate over all loaded debg info files. * readelf.c (process_object): Likewise. * doc/debug.options.texi: Update descriptions of links and follow-links options. * testsuite/binutils-all/objdump.WK2: Update expected output. * testsuite/binutils-all/readelf.k2: Likewise. * NEWS: Announce the new feature.
2019-02-22[arm][gas] Add support for Neoverse N1Kyrylo Tkachov3-1/+9
This adds support for the Neoverse N1 CPU [1] to gas. This was previously enabled under the Ares codename, which remains as a valid option for -mcpu for compatibility reasons. make check-gas passes on arm-none-eabi. [1] https://community.arm.com/processors/b/blog/posts/arm-neoverse-n1-platform-accelerating-the-transformation-to-a-scalable-cloud-to-edge-infrastructure 2019-02-21 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/tc-arm.c (arm_cpus): Add neoverse-n1. * doc/c-arm.texi (-mcpu): Document neoverse-n1 value.
2019-02-22[AArch64][gas] Add support for Neoverse E1Kyrylo Tkachov3-0/+11
This adds support for the Neoverse E1 CPU [1] to gas. make check-gas passes on aarch64-none-elf. [1] https://community.arm.com/processors/b/blog/posts/arm-neoverse-e1-platform-empowering-the-infrastructure-to-meet-next-generation-throughput-demands 2019-02-21 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/tc-aarch64.c (aarch64_cpus): Add neoverse-e1. * doc/c-aarch64.texi (-mcpu): Document neoverse-e1 value.
2019-02-22[AArch64][gas] Add support for Neoverse N1Kyrylo Tkachov3-0/+11
This adds support for the Neoverse N1 [1] CPU to gas. This was previously enabled under the Ares codename, which remains as a valid option for -mcpu for compatibility reasons. make check-gas passes on aarch64-none-elf. [1] https://community.arm.com/processors/b/blog/posts/arm-neoverse-n1-platform-accelerating-the-transformation-to-a-scalable-cloud-to-edge-infrastructure 2019-02-21 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/tc-aarch64.c (aarch64_cpus): Add neoverse-n1. * doc/c-aarch64.texi (-mcpu): Document neoverse-n1 value.
2019-02-22Automatic date update in version.inGDB Administrator1-1/+1
2019-02-21Document style behavior in batch mode.Alan Hayward4-3/+12
Style is disabled when running in batch mode. gdb/ChangeLog: * NEWS: Update style defaults. gdb/doc/ChangeLog: * gdb.texinfo: Update style defaults.
2019-02-21Fix typo in "show remotelogfile" docsTom Tromey2-1/+6
I noticed a trailing "." in the @item for "show remotelogfile". This removes it. Committing as obvious. gdb/doc/ChangeLog 2019-02-21 Tom Tromey <tromey@adacore.com> * gdb.texinfo (Remote Configuration): Remove trailing "." from @item.
2019-02-21Disable styling when running in batch modeAlan Hayward2-1/+11
The GCC Guality testsuite within GCC compiles C/C++ files in GCC at various optimization levels then debugs them in GDB, checking that program values can be read. This is done within the dejagnu framework. The new style options in GDB have broken many of the tests due to the testsuite being unable to process the new control characters. The fix in Guality is to either to improve the string matching or to disable styling on the cli or init file (after checking gdb is recent enough to support styling). This fix will also need making an any other testsuites in the wild that use GDB. An alternative would be to automatically disable styling when using GDB in batch mode. The reasoning here is that batch mode is only used when automating GDB and any output will be processed later either with text processing tools or viewed in text editors, many of these will not correctly handle the control characters by default. This ensures GDB continues to work as expected. Anyone who explicitly wants styling in batch mode can enable it either in the init file or adding to the batch file - but that would not be the standard use case. Patch simply disables style after reading the batch command flag, before reading in the init file or batch file. gdb/ChangeLog: * main.c (captured_main_1): Disable styling in batch mode.
2019-02-21Fix illegal memory accesses by readelf when parsing corrupt IA64 unwind ↵Nick Clifton2-6/+94
information. PR 24247 * unwind-ia64.c: Include sysdep.h. (unw_decode_x1): Check current pointer against end pointer before accessing memory. (unw_decode_x2): Likewise. (unw_decode_x3): Likewise. (unw_decode_x4): Likewise. (unw_decode_r2): Likewise. (unw_decode_p2_p5): Likewise. (unw_decode_p7_p10): Likewise. (unw_decode): Likewise.
2019-02-21PowerPC __tls_get_addr arg parsingAlan Modra2-41/+54
The syntax we ended up with for -m32 -fPIC calls to __tls_get_addr is rather weird. bl __tls_get_addr+0x8000(gd0@tlsgd)@plt This came about by accident, probably due to requiring the arg reloc before the call reloc. Of course the @plt really belongs with __tls_get_addr since it affects the call rather than the call arg, and it isn't a great deal of trouble to ensure the relocs are emitted in the correct order. This patch supports a newer syntax, like so: bl __tls_get_addr+0x8000@plt(gd0@tlsgd) gas/ * config/tc-ppc.c (parse_tls_arg): New function, extracted.. (md_assembler): ..from here. Call it after parsing other suffix modifiers too. ld/ * testsuite/ld-powerpc/tls32.s: Test new @plt syntax.
2019-02-21Automatic date update in version.inGDB Administrator1-1/+1
2019-02-20Fix typos in symtab_symbol_infoTom Tromey4-4/+12
symtab_symbol_info has a couple of messages that say "regulation expression". I think "regular expression" was meant, so this patch changes it. gdb/ChangeLog 2019-02-20 Tom Tromey <tom@tromey.com> * symtab.c (symtab_symbol_info): Fix typos. gdb/testsuite/ChangeLog 2019-02-20 Tom Tromey <tom@tromey.com> * gdb.base/info_qt.exp: Update.
2019-02-20Fix potential illegal memory access by readelf when parsing a binary ↵Nick Clifton2-7/+50
containing corrupt system tap notes. PR 24246 * readelf.c (print_stapsdt_note): Harden against corrupt notes.
2019-02-20Fix potential illegal memory access by readelf when parsing corrupt IA64 ↵Nick Clifton2-36/+50
unwind information. PR 24244 * unwind-ia64.c (unw_decode_uleb128): Add end parameter, use it to prevent walking off the end of the buffer. (unw_decode_x1): Add end paramter, pass it to unw_decode_uleb128. (unw_decode_x2): Likewise. (unw_decode_x3): Likewise. (unw_decode_x4): Likewise. (unw_decode_r2): Pass the end parameter to unw_decode_uleb128. (unw_decode_r3): Likewise. (unw_decode_p7_p10): Likewise. (unw_decode_b2): Likewise. (unw_decode_b3_x4): Likewise.
2019-02-20Fix a illegal memory access fault when parsing a corrupt MIPS option section ↵Nick Clifton2-0/+9
using readelf. PR 24243 * readelf.c (process_mips_specific): Check for an options section that is too small to even contain a single option.
2019-02-20Harden readelf's IA64 note display function so that it can handle corrupt notes.Nick Clifton2-18/+69
PR 24242 * readelf.c (print_ia64_vms_note): Harden against corrupt notes.
2019-02-20Use upper case for metasyntactic variables in "help find"Tom Tromey2-3/+8
While answering a user's question on irc, I realized that the metasyntactic variables in "help find" are not in upper case. As you know this is one of my pet quests, so here is a patch to fix this. Tested on x86-64 Fedora 29. gdb/ChangeLog 2019-02-20 Tom Tromey <tromey@adacore.com> * findcmd.c (_initialize_mem_search): Use upper case for metasyntactic variables.
2019-02-20AArch64: Add default reggroupsAlan Hayward2-0/+21
AArch64 does not define any reggroups. This causes "maintenance print reggroups" to dump the default set (which is ok). However, if a new group is added via an xml file, then this now becomes the only group. Fixes gdb.xml/tdesc-regs.exp on AArch64. gdb/ChangeLog: * aarch64-tdep.c (aarch64_add_reggroups): New function (aarch64_gdbarch_init): Call aarch64_add_reggroups.
2019-02-20bfd: xtensa: fix callx relaxationMax Filippov8-0/+105
Big section alignment requirements between source and destination of a long call can result in making call range bigger than what's reachable by the call opcode. Add biggest section alignment of sections between the call site and call destination to the call distance when making long call relaxation decision. 2019-02-20 Eric Tsai <erictsai@cadence.com> bfd/ * elf32-xtensa.c (is_resolvable_asm_expansion): Scan output sections between the call site and call destination and adjust call distance by the largest alignment. ld/ * testsuite/ld-xtensa/call_overflow.d: New test definition. * testsuite/ld-xtensa/call_overflow1.s: New test source. * testsuite/ld-xtensa/call_overflow2.s: New test source. * testsuite/ld-xtensa/call_overflow3.s: New test source. * testsuite/ld-xtensa/xtensa.exp: Add call_overflow test.
2019-02-20AArch64: Add pauth core file sectionAlan Hayward5-0/+43
Used for the AArch64 pointer authentication code mask registers in Arm v8.3-a. NT_ARM_PAC_MASK matches the value in Linux include/uapi/linux/elf.h include/ChangeLog: * elf/common.h (NT_ARM_PAC_MASK): Add define. bfd/ChangeLog: * elf-bfd.h (elfcore_write_aarch_pauth): Add declaration. * elf.c (elfcore_grok_aarch_pauth): New function. (elfcore_grok_note): Check for NT_ARM_PAC_MASK. (elfcore_write_aarch_pauth): New function. (elfcore_write_register_note): Check for AArch64 pauth section.
2019-02-20Check asprintf return valueAlan Modra2-4/+13
git a31b8bd9a05 introduced a warning (depending on your system headers). PR 24225 * elf32-nios2.c (nios2_elf32_relocate_section): Check asprintf return value.
2019-02-20Unsigned integer overflows in readelf checksAlan Modra2-4/+14
PR 24132 PR 24138 * readelf.c (get_data): Avoid possibility of overflow when checking for a read that may extend past end of file. (process_program_headers): Likewise.
2019-02-20Use or1k-darwin host SHARED_LIBADD for *-darwin.Michael Roitzsch3-6/+12
* configure.ac (SHARED_LIBADD): Add -liberty -lintl for all Darwin hosts, not just or1k. * configure: Regenerate.
2019-02-20PR24233, Out of memoryAlan Modra2-1/+9
PR 24233 * objdump.c (dump_bfd_private_header): Print warning if bfd_print_private_bfd_data returns false.