summaryrefslogtreecommitdiff
path: root/bfd/elf-bfd.h
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@linux.vnet.ibm.com>2013-02-04 18:26:30 +0000
committerSergio Durigan Junior <sergiodj@linux.vnet.ibm.com>2013-02-04 18:26:30 +0000
commit178787aafd7e551efb648ceed36e2687ed17add2 (patch)
tree17ae9bede71fd83cef069d618ce63280d23dfce3 /bfd/elf-bfd.h
parent41829dec08ad5f9e80a5d84d5fc60b5aa2fcbcd1 (diff)
downloadbinutils-redhat-178787aafd7e551efb648ceed36e2687ed17add2.tar.gz
2013-02-04 Sergio Durigan Junior <sergiodj@redhat.com>
Pedro Alves <palves@redhat.com> * Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'. * elf-bfd.h (elf_internal_linux_prpsinfo): New structure declaration. (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64) (elfcore_write_ppc32_linux_prpsinfo32): New declarations. * elf-linux-psinfo.h: New file. * elf.c: Include elf-linux-psinfo.h. (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64): New functions. * elf32-ppc.c: Include `elf-linux-psinfo.h'. (elf_external_ppc_linux_prpsinfo32): New structure declaration. (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro. (elfcore_write_ppc_linux_prpsinfo32): New function.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r--bfd/elf-bfd.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index faaf632e19..1fd73cf5dc 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -2285,6 +2285,42 @@ extern char *elfcore_write_lwpstatus
extern char *elfcore_write_register_note
(bfd *, char *, int *, const char *, const void *, int);
+/* Internal structure which holds information to be included in the
+ PRPSINFO section of Linux core files.
+
+ This is an "internal" structure in the sense that it should be used
+ to pass information to BFD (via the `elfcore_write_linux_prpsinfo'
+ function), so things like endianess shouldn't be an issue. This
+ structure will eventually be converted in one of the
+ `elf_external_linux_*' structures and written out to an output bfd
+ by one of the functions declared below. */
+
+struct elf_internal_linux_prpsinfo
+ {
+ char pr_state; /* Numeric process state. */
+ char pr_sname; /* Char for pr_state. */
+ char pr_zomb; /* Zombie. */
+ char pr_nice; /* Nice val. */
+ unsigned long pr_flag; /* Flags. */
+ unsigned int pr_uid;
+ unsigned int pr_gid;
+ int pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ char pr_fname[16 + 1]; /* Filename of executable. */
+ char pr_psargs[80 + 1]; /* Initial part of arg list. */
+ };
+
+/* Linux/most 32-bit archs. */
+extern char *elfcore_write_linux_prpsinfo32
+ (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
+
+/* Linux/most 64-bit archs. */
+extern char *elfcore_write_linux_prpsinfo64
+ (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
+
+/* Linux/PPC32 uses different layout compared to most archs. */
+extern char *elfcore_write_ppc_linux_prpsinfo32
+ (bfd *, char *, int *, const struct elf_internal_linux_prpsinfo *);
+
extern bfd *_bfd_elf32_bfd_from_remote_memory
(bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
int (*target_read_memory) (bfd_vma, bfd_byte *, bfd_size_type));