aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2016-01-21 13:33:53 +1030
committerAlan Modra <amodra@gmail.com>2016-01-21 19:59:33 +1030
commitaeb7056972f1b383578204b9151b0ae6d8c1df81 (patch)
tree19f5bd87b724ab2b626ec0f6acd3bde22f029de7 /bfd/elf.c
parentde64ce13a78669f094d6909fce51d210e2f9d2c0 (diff)
downloadgdb-aeb7056972f1b383578204b9151b0ae6d8c1df81.zip
gdb-aeb7056972f1b383578204b9151b0ae6d8c1df81.tar.gz
gdb-aeb7056972f1b383578204b9151b0ae6d8c1df81.tar.bz2
Convert macros in elf-linux-core.h to inline functions
Besides changing some macros into inline functions, this removes redundant memsets and uses bfd_put_* rather than H_PUT_*. * elf-linux-core.h (swap_linux_prpsinfo32_out): New function. (swap_linux_prpsinfo64_out): New function. (LINUX_PRPSINFO32_SWAP_FIELDS): Delete. (LINUX_PRPSINFO64_SWAP_FIELDS): Delete. * elf.c (elfcore_write_linux_prpsinfo32): Adjust. Don't memset. (elfcore_write_linux_prpsinfo64): Likewise. * elf32-ppc.c (swap_ppc_linux_prpsinfo32_out): New function. (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): Delete. (elfcore_write_ppc_linux_prpsinfo32): Adjust. Don't memset.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r--bfd/elf.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/bfd/elf.c b/bfd/elf.c
index dba5a0f..74c2f2d 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -9791,9 +9791,7 @@ elfcore_write_linux_prpsinfo32
{
struct elf_external_linux_prpsinfo32 data;
- memset (&data, 0, sizeof (data));
- LINUX_PRPSINFO32_SWAP_FIELDS (abfd, prpsinfo, data);
-
+ swap_linux_prpsinfo32_out (abfd, prpsinfo, &data);
return elfcore_write_note (abfd, buf, bufsiz, "CORE", NT_PRPSINFO,
&data, sizeof (data));
}
@@ -9805,9 +9803,7 @@ elfcore_write_linux_prpsinfo64
{
struct elf_external_linux_prpsinfo64 data;
- memset (&data, 0, sizeof (data));
- LINUX_PRPSINFO64_SWAP_FIELDS (abfd, prpsinfo, data);
-
+ swap_linux_prpsinfo64_out (abfd, prpsinfo, &data);
return elfcore_write_note (abfd, buf, bufsiz,
"CORE", NT_PRPSINFO, &data, sizeof (data));
}