* elf64-hppa.c (elf64_hppa_section_from_phdr): Create .kernel
authorMark Kettenis <kettenis@gnu.org>
Sun, 4 Dec 2005 14:58:11 +0000 (14:58 +0000)
committerMark Kettenis <kettenis@gnu.org>
Sun, 4 Dec 2005 14:58:11 +0000 (14:58 +0000)
pseudo-section.  Make sure .reg section comes after the proc
section it's generated from.

bfd/ChangeLog
bfd/elf64-hppa.c

index eb528a09019fabcfa7b49d0c89612a0906bae523..536fa88f72b2de6ff4e9baea58fbbb54b9d34daf 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-18  Mark Kettenis  <kettenis@gnu.org>
+
+       * elf64-hppa.c (elf64_hppa_section_from_phdr): Create .kernel
+       pseudo-section.  Make sure .reg section comes after the proc
+       section it's generated from.
+
 2005-12-01  Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
 
        * elf32-m32r.c (m32r_elf_sweep_hook): Fix an illegal duplicate check.
index 42a04a16ff9b03e19a36f78bae333b17360c2962..fbd64584d1db6b2cc532919ddab0531f96b1503a 100644 (file)
@@ -2652,6 +2652,22 @@ static bfd_boolean
 elf64_hppa_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index,
                              const char *typename)
 {
+  if (hdr->p_type == PT_HP_CORE_KERNEL)
+    {
+      asection *sect;
+
+      if (!_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename))
+       return FALSE;
+
+      sect = bfd_make_section_anyway (abfd, ".kernel");
+      if (sect == NULL)
+       return FALSE;
+      sect->size = hdr->p_filesz;
+      sect->filepos = hdr->p_offset;
+      sect->flags = SEC_HAS_CONTENTS | SEC_READONLY;
+      return TRUE;
+    }
+
   if (hdr->p_type == PT_HP_CORE_PROC)
     {
       int sig;
@@ -2663,10 +2679,12 @@ elf64_hppa_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index,
 
       elf_tdata (abfd)->core_signal = sig;
 
-      /* gdb uses the ".reg" section to read register contents.  */
-      if (!_bfd_elfcore_make_pseudosection (abfd, ".reg", hdr->p_filesz,
-                                           hdr->p_offset))
+      if (!_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename))
        return FALSE;
+
+      /* GDB uses the ".reg" section to read register contents.  */
+      return _bfd_elfcore_make_pseudosection (abfd, ".reg", hdr->p_filesz,
+                                             hdr->p_offset);
     }
 
   if (hdr->p_type == PT_HP_CORE_LOADABLE