From 79d71107c92409690e07e6841c63225d9ac05367 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 18 2019 16:45:32 +0000 Subject: import gdb-8.2-6.el8_0 --- diff --git a/SOURCES/_gdb.spec.Patch.include b/SOURCES/_gdb.spec.Patch.include index 5ee7ddc..6d32555 100644 --- a/SOURCES/_gdb.spec.Patch.include +++ b/SOURCES/_gdb.spec.Patch.include @@ -575,3 +575,7 @@ Patch140: gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-4of5.patch # Keith Seitz, RHBZ#1560010. Patch141: gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-5of5.patch +# Fix 'gdb fails to read zN registers from corefile with aarch64 SVE' +# Alan Hayward, RH BZ 1669953 +Patch142: gdb-rhbz1669953-aarch64-sve-binutils.patch + diff --git a/SOURCES/_gdb.spec.patch.include b/SOURCES/_gdb.spec.patch.include index 7edc6fa..682ee4e 100644 --- a/SOURCES/_gdb.spec.patch.include +++ b/SOURCES/_gdb.spec.patch.include @@ -139,3 +139,4 @@ %patch139 -p1 %patch140 -p1 %patch141 -p1 +%patch142 -p1 \ No newline at end of file diff --git a/SOURCES/gdb-rhbz1669953-aarch64-sve-binutils.patch b/SOURCES/gdb-rhbz1669953-aarch64-sve-binutils.patch new file mode 100644 index 0000000..c8a0d4a --- /dev/null +++ b/SOURCES/gdb-rhbz1669953-aarch64-sve-binutils.patch @@ -0,0 +1,93 @@ +From FEDORA_PATCHES Mon Sep 17 00:00:00 2001 +From: Keith Seitz +Date: Tue, 19 Mar 2019 11:38:37 -0700 +Subject: gdb-rhbz1669953-aarch64-sve-binutils.patch + +;; Fix 'gdb fails to read zN registers from corefile with aarch64 SVE' +;; Alan Hayward, RH BZ 1669953 + +Add checks for the NT_ARM_SVE section in a core file. + +The NT_ARM_SVE section is documented here: + https://github.com/torvalds/linux/blob/master/Documentation/arm64/sve.txt + * A NT_ARM_SVE note will be added to each coredump for each thread of the + dumped process. The contents will be equivalent to the data that would have + been read if a PTRACE_GETREGSET of NT_ARM_SVE were executed for each thread + when the coredump was generated. + + * elf.c (elfcore_grok_aarch_sve): New function. + (elfcore_grok_note): Check for Aarch64 SVE. + (elfcore_write_aarch_sve): New function. + (elfcore_write_register_note): Check for Aarch64 SVE. + * elf-bfd.h(elfcore_grok_aarch_sve): New declaration. + +diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h +--- a/bfd/elf-bfd.h ++++ b/bfd/elf-bfd.h +@@ -2601,6 +2601,8 @@ extern char *elfcore_write_aarch_hw_break + (bfd *, char *, int *, const void *, int); + extern char *elfcore_write_aarch_hw_watch + (bfd *, char *, int *, const void *, int); ++extern char *elfcore_write_aarch_sve ++ (bfd *, char *, int *, const void *, int); + extern char *elfcore_write_lwpstatus + (bfd *, char *, int *, long, int, const void *); + extern char *elfcore_write_register_note +diff --git a/bfd/elf.c b/bfd/elf.c +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -9340,6 +9340,12 @@ elfcore_grok_aarch_hw_watch (bfd *abfd, Elf_Internal_Note *note) + return elfcore_make_note_pseudosection (abfd, ".reg-aarch-hw-watch", note); + } + ++static bfd_boolean ++elfcore_grok_aarch_sve (bfd *abfd, Elf_Internal_Note *note) ++{ ++ return elfcore_make_note_pseudosection (abfd, ".reg-aarch-sve", note); ++} ++ + #if defined (HAVE_PRPSINFO_T) + typedef prpsinfo_t elfcore_psinfo_t; + #if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */ +@@ -9836,6 +9842,13 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) + else + return TRUE; + ++ case NT_ARM_SVE: ++ if (note->namesz == 6 ++ && strcmp (note->namedata, "LINUX") == 0) ++ return elfcore_grok_aarch_sve (abfd, note); ++ else ++ return TRUE; ++ + case NT_PRPSINFO: + case NT_PSINFO: + if (bed->elf_backend_grok_psinfo) +@@ -11027,6 +11040,18 @@ elfcore_write_aarch_hw_watch (bfd *abfd, + note_name, NT_ARM_HW_WATCH, aarch_hw_watch, size); + } + ++char * ++elfcore_write_aarch_sve (bfd *abfd, ++ char *buf, ++ int *bufsiz, ++ const void *aarch_sve, ++ int size) ++{ ++ char *note_name = "LINUX"; ++ return elfcore_write_note (abfd, buf, bufsiz, ++ note_name, NT_ARM_SVE, aarch_sve, size); ++} ++ + char * + elfcore_write_register_note (bfd *abfd, + char *buf, +@@ -11079,6 +11104,8 @@ elfcore_write_register_note (bfd *abfd, + return elfcore_write_aarch_hw_break (abfd, buf, bufsiz, data, size); + if (strcmp (section, ".reg-aarch-hw-watch") == 0) + return elfcore_write_aarch_hw_watch (abfd, buf, bufsiz, data, size); ++ if (strcmp (section, ".reg-aarch-sve") == 0) ++ return elfcore_write_aarch_sve (abfd, buf, bufsiz, data, size); + return NULL; + } + diff --git a/SPECS/gdb.spec b/SPECS/gdb.spec index 54f41ef..659a427 100644 --- a/SPECS/gdb.spec +++ b/SPECS/gdb.spec @@ -26,7 +26,7 @@ Version: 8.2 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL Group: Development/Debuggers @@ -1032,6 +1032,10 @@ fi %endif %changelog +* Thu Apr 25 2019 Keith Seitz - 8.2-6.el8 +- Backport "Fix 'gdb fails to read zN registers from corefile with aarc64 SVE'" + (Alan Hayward, RH BZ 1699376) + * Fri Jan 11 2019 Keith Seitz - 8.2-5.el8 - Merge from Fedora 29: gdb-rhbz1560010-fix-assertion-symbol-language-dict-language-?of5.patch