Fix missing "Core was generated by" when loading a x32 corefile.
authorFelix Willgerodt <felix.willgerodt@intel.com>
Mon, 27 Feb 2023 13:01:06 +0000 (13:01 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 27 Feb 2023 13:01:06 +0000 (13:01 +0000)
bfd/ChangeLog
bfd/elf64-x86-64.c

index 50e1e17ef4d508e6d8b31fc3aa23f6d3ff11f7c4..cac222cd564dd6f8084cb42b198e3a941ce10c8a 100644 (file)
@@ -1,3 +1,8 @@
+2023-02-27  Felix Willgerodt  <felix.willgerodt@intel.com>
+
+       * elf64-x86-64.c (elf_x86_64_grok_psinfo): Check for
+       elf_external_linux_prpsinfo32_ugid32.
+
 2023-02-23  Fangrui Song  <i@maskray.me>
 
        * elfnn-riscv.c (struct riscv_elf_link_hash_table): Add params.
index ef0ebdd696702fc5e654e6e7d8f63e8687b4dee7..0aa9af5d8fc0a22a71cb1da698323c396c626a0f 100644 (file)
@@ -389,7 +389,8 @@ elf_x86_64_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
       default:
        return false;
 
-      case 124:                /* sizeof(struct elf_prpsinfo) on Linux/x32 */
+      case 124:
+       /* sizeof (struct elf_external_linux_prpsinfo32_ugid16).  */
        elf_tdata (abfd)->core->pid
          = bfd_get_32 (abfd, note->descdata + 12);
        elf_tdata (abfd)->core->program
@@ -398,7 +399,18 @@ elf_x86_64_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
          = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
        break;
 
-      case 136:                /* sizeof(struct elf_prpsinfo) on Linux/x86_64 */
+    case 128:
+       /* sizeof (struct elf_external_linux_prpsinfo32_ugid32).  */
+       elf_tdata (abfd)->core->pid
+         = bfd_get_32 (abfd, note->descdata + 12);
+       elf_tdata (abfd)->core->program
+         = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
+       elf_tdata (abfd)->core->command
+         = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
+       break;
+
+      case 136:
+       /* sizeof (struct elf_prpsinfo) on Linux/x86_64.  */
        elf_tdata (abfd)->core->pid
          = bfd_get_32 (abfd, note->descdata + 24);
        elf_tdata (abfd)->core->program