aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-03-29 23:33:05 +0000
committerMike Frysinger <vapier@gentoo.org>2005-03-29 23:33:05 +0000
commit94bc4260010bbfaf3e9a7fae7cfeaa9355fd78b7 (patch)
treefbb912f5d7562d387e5b5607bba8a4e3c3cf8a49 /paxelf.h
parentnew app, scanrpath (diff)
downloadpax-utils-94bc4260010bbfaf3e9a7fae7cfeaa9355fd78b7.tar.gz
pax-utils-94bc4260010bbfaf3e9a7fae7cfeaa9355fd78b7.tar.bz2
pax-utils-94bc4260010bbfaf3e9a7fae7cfeaa9355fd78b7.zip
more functions and cleanups
Diffstat (limited to 'paxelf.h')
-rw-r--r--paxelf.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/paxelf.h b/paxelf.h
index 7454a82..a6c4e4d 100644
--- a/paxelf.h
+++ b/paxelf.h
@@ -39,18 +39,24 @@ typedef struct {
Elf_Shdr *shdr;
Elf_Dyn *dyn;
char *data;
- int textrel;
int len;
int fd;
} elfobj;
/* prototypes */
-extern char *pax_short_flags(unsigned long flags);
+extern char *pax_short_hf_flags(unsigned long flags);
+extern char *pax_short_pf_flags(unsigned long flags);
extern int check_elf_header(Elf_Ehdr const *const ehdr);
extern elfobj *readelf(char *filename);
+extern void unreadelf(elfobj *elf);
extern const char *get_elfetype(int type);
+extern const char *get_elfptype(int type);
+extern const char *get_elfdtype(int type);
+extern const char *elf_getsecname(elfobj *elf, Elf_Shdr *shdr);
+extern Elf_Shdr *elf_findsecbyname(elfobj *elf, const char *name);
-#define IS_ELF(elf) ((elf->ehdr->e_ident[EI_CLASS] == ELFCLASS32 || elf->ehdr->e_ident[EI_CLASS] == ELFCLASS64))
+//#define IS_ELF(elf) ((elf->ehdr->e_ident[EI_CLASS] == ELFCLASS32 || elf->ehdr->e_ident[EI_CLASS] == ELFCLASS64))
+#define IS_ELF(elf) (elf->ehdr->e_ident[EI_CLASS] == ELF_CLASS)
#define IS_ELF_TYPE(elf, type) ((elf->ehdr->e_type == type) && IS_ELF(elf))
#define IS_ELF_ET_EXEC(elf) IS_ELF_TYPE(elf, ET_EXEC)
#define IS_ELF_ET_DYN(elf) IS_ELF_TYPE(elf, ET_DYN)