Mercurial > hg > chrpath
diff protos.h @ 1:bbbfb3f97919
implement 32 and 64 bit support
author | Peter Meerwald <p.meerwald@bct-electronic.com> |
---|---|
date | Fri, 20 Jul 2012 11:26:24 +0200 |
parents | b8f7423e385c |
children |
line wrap: on
line diff
--- a/protos.h Fri Jul 20 01:51:24 2012 +0200 +++ b/protos.h Fri Jul 20 11:26:24 2012 +0200 @@ -9,28 +9,15 @@ #else #define ELFDATA2 ELFDATA2LSB #endif -#if SIZEOF_VOID_P == 8 -#define Elf_Ehdr Elf64_Ehdr -#define ELFCLASS ELFCLASS64 -#define Elf_Phdr Elf64_Phdr -#define Elf_Shdr Elf64_Shdr -#define Elf_Dyn Elf64_Dyn -#elif SIZEOF_VOID_P == 4 -#define Elf_Ehdr Elf32_Ehdr -#define ELFCLASS ELFCLASS32 -#define Elf_Phdr Elf32_Phdr -#define Elf_Shdr Elf32_Shdr -#define Elf_Dyn Elf32_Dyn -#else -#error "Unknown word size (SIZEOF_VOID_P)!" -#endif int killrpath(const char *filename); int chrpath(const char *filename, const char *newpath, int convert); -int elf_open(const char *filename, int flags, Elf_Ehdr *ehdr); +int elf32_open(const char *filename, int flags, Elf32_Ehdr *ehdr); +int elf64_open(const char *filename, int flags, Elf64_Ehdr *ehdr); void elf_close(int fd); -int elf_find_dynamic_section(int fd, Elf_Ehdr *ehdr, Elf_Phdr *phdr); +int elf32_find_dynamic_section(int fd, Elf32_Ehdr *ehdr, Elf32_Phdr *phdr); +int elf64_find_dynamic_section(int fd, Elf64_Ehdr *ehdr, Elf64_Phdr *phdr); const char *elf_tagname(int tag); int elf_dynpath_tag(int tag);