summaryrefslogtreecommitdiff
path: root/bfd/elf.c
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.c
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.c')
-rw-r--r--bfd/elf.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index 9cd3542f56..7ab3683dc7 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -45,6 +45,7 @@ SECTION
#include "elf-bfd.h"
#include "libiberty.h"
#include "safe-ctype.h"
+#include "elf-linux-psinfo.h"
#ifdef CORE_HEADER
#include CORE_HEADER
@@ -9159,6 +9160,34 @@ elfcore_write_prpsinfo (bfd *abfd,
}
char *
+elfcore_write_linux_prpsinfo32
+ (bfd *abfd, char *buf, int *bufsiz,
+ const struct elf_internal_linux_prpsinfo *prpsinfo)
+{
+ struct elf_external_linux_prpsinfo32 data;
+
+ memset (&data, 0, sizeof (data));
+ LINUX_PRPSINFO32_SWAP_FIELDS (abfd, prpsinfo, data);
+
+ return elfcore_write_note (abfd, buf, bufsiz, "CORE", NT_PRPSINFO,
+ &data, sizeof (data));
+}
+
+char *
+elfcore_write_linux_prpsinfo64
+ (bfd *abfd, char *buf, int *bufsiz,
+ const struct elf_internal_linux_prpsinfo *prpsinfo)
+{
+ struct elf_external_linux_prpsinfo64 data;
+
+ memset (&data, 0, sizeof (data));
+ LINUX_PRPSINFO64_SWAP_FIELDS (abfd, prpsinfo, data);
+
+ return elfcore_write_note (abfd, buf, bufsiz,
+ "CORE", NT_PRPSINFO, &data, sizeof (data));
+}
+
+char *
elfcore_write_prstatus (bfd *abfd,
char *buf,
int *bufsiz,