aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-hppa.c
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
commit235ecfbc5e0a90427bd7a14f6d8a663f4d40e7a7 (patch)
treee28fa5f56441d9276fbb524f3994145380f3c189 /bfd/elf64-hppa.c
parent7d816a179b4195b35267b4f2dc57e0917eb68a68 (diff)
downloadgdb-235ecfbc5e0a90427bd7a14f6d8a663f4d40e7a7.zip
gdb-235ecfbc5e0a90427bd7a14f6d8a663f4d40e7a7.tar.gz
gdb-235ecfbc5e0a90427bd7a14f6d8a663f4d40e7a7.tar.bz2
* elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
(elf64_hppa_grok_psinfo): Likewise. (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
Diffstat (limited to 'bfd/elf64-hppa.c')
-rw-r--r--bfd/elf64-hppa.c66
1 files changed, 65 insertions, 1 deletions
diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c
index 4e0b83c..58798ae 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