aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2013-02-04 18:26:34 +0000
committerSergio Durigan Junior <sergiodj@redhat.com>2013-02-04 18:26:34 +0000
commit70a38d42c5b3fdc03acd4faef4149f5f2e8a0fb4 (patch)
tree525fc36f46d8e714ddd70c291ceb77f255cf36f3 /bfd/elf.c
parent176eb98c2f159084863a303f417803dd6736f16f (diff)
downloadfsf-binutils-gdb-70a38d42c5b3fdc03acd4faef4149f5f2e8a0fb4.zip
fsf-binutils-gdb-70a38d42c5b3fdc03acd4faef4149f5f2e8a0fb4.tar.gz
fsf-binutils-gdb-70a38d42c5b3fdc03acd4faef4149f5f2e8a0fb4.tar.bz2
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 9cd3542..7ab3683 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,