* elf32-sparc.c (elf32_sparc_grok_psinfo): New function.
authorMark Kettenis <kettenis@gnu.org>
Sun, 4 Jan 2004 09:24:27 +0000 (09:24 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 4 Jan 2004 09:24:27 +0000 (09:24 +0000)
bfd/ChangeLog
bfd/elf32-sparc.c

index 48a6c8d9c8e4067c0145b9e45baa8a46c50df285..28935915cdb87bc6beca6617383cf2538244aa17 100644 (file)
@@ -1,3 +1,7 @@
+2004-01-04  Mark Kettenis  <kettenis@gnu.org>
+
+       * elf32-sparc.c (elf32_sparc_grok_psinfo): New function.
+
 2004-01-02  Mark Kettenis  <kettenis@gnu.org>
 
        * elf32-i386.c (elf_i386_grok_prstatus): Add support for FreeBSD.
index f77f22c7c35342c6c7817a4184c17ade28d13c21..c20e403588de9bf74518dcb55fa75e1f066f65da 100644 (file)
@@ -501,6 +501,35 @@ sparc_elf_lox10_reloc (abfd,
 
   return bfd_reloc_ok;
 }
+\f
+/* Support for core dump NOTE sections.  */
+
+static bfd_boolean
+elf32_sparc_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
+{
+  switch (note->descsz)
+    {
+    default:
+      return FALSE;
+
+    case 260:                  /* Solaris prpsinfo_t.  */
+      elf_tdata (abfd)->core_program
+       = _bfd_elfcore_strndup (abfd, note->descdata + 84, 16);
+      elf_tdata (abfd)->core_command
+       = _bfd_elfcore_strndup (abfd, note->descdata + 100, 80);
+      break;
+
+    case 336:                  /* Solaris psinfo_t.  */
+      elf_tdata (abfd)->core_program
+       = _bfd_elfcore_strndup (abfd, note->descdata + 88, 16);
+      elf_tdata (abfd)->core_command
+       = _bfd_elfcore_strndup (abfd, note->descdata + 104, 80);
+      break;
+    }
+
+  return TRUE;
+}
+
 \f
 /* Functions for the SPARC ELF linker.  */
 
@@ -3451,6 +3480,7 @@ elf32_sparc_reloc_type_class (rela)
                                        elf32_sparc_final_write_processing
 #define elf_backend_gc_mark_hook       elf32_sparc_gc_mark_hook
 #define elf_backend_gc_sweep_hook       elf32_sparc_gc_sweep_hook
+#define elf_backend_grok_psinfo                elf32_sparc_grok_psinfo
 #define elf_backend_reloc_type_class   elf32_sparc_reloc_type_class
 
 #define elf_backend_can_gc_sections 1