Mercurial > hg > chrpath
comparison 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 |
comparison
equal
deleted
inserted
replaced
0:b8f7423e385c | 1:bbbfb3f97919 |
---|---|
7 #ifdef WORDS_BIGENDIAN | 7 #ifdef WORDS_BIGENDIAN |
8 #define ELFDATA2 ELFDATA2MSB | 8 #define ELFDATA2 ELFDATA2MSB |
9 #else | 9 #else |
10 #define ELFDATA2 ELFDATA2LSB | 10 #define ELFDATA2 ELFDATA2LSB |
11 #endif | 11 #endif |
12 #if SIZEOF_VOID_P == 8 | |
13 #define Elf_Ehdr Elf64_Ehdr | |
14 #define ELFCLASS ELFCLASS64 | |
15 #define Elf_Phdr Elf64_Phdr | |
16 #define Elf_Shdr Elf64_Shdr | |
17 #define Elf_Dyn Elf64_Dyn | |
18 #elif SIZEOF_VOID_P == 4 | |
19 #define Elf_Ehdr Elf32_Ehdr | |
20 #define ELFCLASS ELFCLASS32 | |
21 #define Elf_Phdr Elf32_Phdr | |
22 #define Elf_Shdr Elf32_Shdr | |
23 #define Elf_Dyn Elf32_Dyn | |
24 #else | |
25 #error "Unknown word size (SIZEOF_VOID_P)!" | |
26 #endif | |
27 | 12 |
28 int killrpath(const char *filename); | 13 int killrpath(const char *filename); |
29 int chrpath(const char *filename, const char *newpath, int convert); | 14 int chrpath(const char *filename, const char *newpath, int convert); |
30 | 15 |
31 int elf_open(const char *filename, int flags, Elf_Ehdr *ehdr); | 16 int elf32_open(const char *filename, int flags, Elf32_Ehdr *ehdr); |
17 int elf64_open(const char *filename, int flags, Elf64_Ehdr *ehdr); | |
32 void elf_close(int fd); | 18 void elf_close(int fd); |
33 int elf_find_dynamic_section(int fd, Elf_Ehdr *ehdr, Elf_Phdr *phdr); | 19 int elf32_find_dynamic_section(int fd, Elf32_Ehdr *ehdr, Elf32_Phdr *phdr); |
20 int elf64_find_dynamic_section(int fd, Elf64_Ehdr *ehdr, Elf64_Phdr *phdr); | |
34 const char *elf_tagname(int tag); | 21 const char *elf_tagname(int tag); |
35 int elf_dynpath_tag(int tag); | 22 int elf_dynpath_tag(int tag); |
36 | 23 |
37 #endif /* PROTOS_H */ | 24 #endif /* PROTOS_H */ |