summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2006-04-07 14:55:29 +0000
committerNick Clifton <nickc@redhat.com>2006-04-07 14:55:29 +0000
commitb347b80acc42389f0060ffee947f20c653ebf9a2 (patch)
treed6c64b601c83c135b341db89ea9ffc4a33c0d5b1
parent2f9ca6265081d6d207460013bae57f98a2556761 (diff)
downloadgdb-b347b80acc42389f0060ffee947f20c653ebf9a2.tar.gz
* elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
(elf64_hppa_grok_psinfo): Likewise. (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elf64-hppa.c66
2 files changed, 71 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b48a703857a..67e9fd27da4 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-07 Randolph Chung <tausq@debian.org>
+
+ * elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
+ (elf64_hppa_grok_psinfo): Likewise.
+ (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
+
2006-04-06 DJ Delorie <dj@redhat.com>
* elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 4e0b83c96be..58798ae3794 100644
--- a/bfd/elf64-hppa.c
+++ b/bfd/elf64-hppa.c
@@ -2542,6 +2542,68 @@ elf64_hppa_finish_dynamic_sections (output_bfd, info)
return TRUE;
}
+/* Support for core dump NOTE sections. */
+
+static bfd_boolean
+elf64_hppa_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
+{
+ int offset;
+ size_t size;
+
+ switch (note->descsz)
+ {
+ default:
+ return FALSE;
+
+ case 760: /* Linux/hppa */
+ /* pr_cursig */
+ elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+
+ /* pr_pid */
+ elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 32);
+
+ /* pr_reg */
+ offset = 112;
+ size = 640;
+
+ break;
+ }
+
+ /* Make a ".reg/999" section. */
+ return _bfd_elfcore_make_pseudosection (abfd, ".reg",
+ size, note->descpos + offset);
+}
+
+static bfd_boolean
+elf64_hppa_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
+{
+ char * command;
+ int n;
+
+ switch (note->descsz)
+ {
+ default:
+ return FALSE;
+
+ case 136: /* Linux/hppa elf_prpsinfo. */
+ elf_tdata (abfd)->core_program
+ = _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
+ elf_tdata (abfd)->core_command
+ = _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
+ }
+
+ /* Note that for some reason, a spurious space is tacked
+ onto the end of the args in some (at least one anyway)
+ implementations, so strip it off if it exists. */
+ command = elf_tdata (abfd)->core_command;
+ n = strlen (command);
+
+ if (0 < n && command[n - 1] == ' ')
+ command[n - 1] = '\0';
+
+ return TRUE;
+}
+
/* Return the number of additional phdrs we will need.
The generic ELF code only creates PT_PHDRs for executables. The HP
@@ -2775,7 +2837,9 @@ const struct elf_size_info hppa64_elf_size_info =
elf64_hppa_finish_dynamic_symbol
#define elf_backend_finish_dynamic_sections \
elf64_hppa_finish_dynamic_sections
-
+#define elf_backend_grok_prstatus elf64_hppa_grok_prstatus
+#define elf_backend_grok_psinfo elf64_hppa_grok_psinfo
+
/* Stuff for the BFD linker: */
#define bfd_elf64_bfd_link_hash_table_create \
elf64_hppa_hash_table_create