summaryrefslogtreecommitdiffstats
path: root/libelf/gelf.h
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2015-11-20 00:12:37 +0100
committerMark Wielaard <mjw@redhat.com>2016-01-06 14:27:10 +0100
commit5ddb50af4a488fdec358570502cbe058acb8ae93 (patch)
tree050c8d623b4832395b39eeebc30ad8ad63e2f0cb /libelf/gelf.h
parent0c32b6f086b9838fe4b7d93575068554d0c420f7 (diff)
libelf: Add elf32_getchdr, elf64_getchdr and gelf_getchdr.
Elf_Data of a compressed section has type ELF_T_CHDR. This type can be xlated to the file or memory representation. This will make sure the Chdr is in the correct endianess. The compressed data following the Chdr isn't translated. Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libelf/gelf.h')
-rw-r--r--libelf/gelf.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libelf/gelf.h b/libelf/gelf.h
index e3f07404..1bc7ee72 100644
--- a/libelf/gelf.h
+++ b/libelf/gelf.h
@@ -1,5 +1,5 @@
/* This file defines generic ELF types, structures, and macros.
- Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2007 Red Hat, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2015 Red Hat, Inc.
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -85,6 +85,9 @@ typedef Elf64_Rela GElf_Rela;
/* Program segment header. */
typedef Elf64_Phdr GElf_Phdr;
+/* Header of a compressed section. */
+typedef Elf64_Chdr GElf_Chdr;
+
/* Dynamic section entry. */
typedef Elf64_Dyn GElf_Dyn;
@@ -183,6 +186,9 @@ extern int gelf_update_phdr (Elf *__elf, int __ndx, GElf_Phdr *__src);
/* Create new program header with PHNUM entries. */
extern unsigned long int gelf_newphdr (Elf *__elf, size_t __phnum);
+/* Get compression header of section if any. Returns NULL and sets
+ elf_errno if the section isn't compressed or an error occurred. */
+extern GElf_Chdr *gelf_getchdr (Elf_Scn *__scn, GElf_Chdr *__dst);
/* Convert data structure from the representation in the file represented
by ELF to their memory representation. */