diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2024-08-16 10:56:47 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2024-08-16 10:56:47 +0200 |
| commit | b2f94b274cbd479a58b15161a8c6601b2ee1d072 (patch) | |
| tree | 13ab85ff9ff22eea5e8812e5f3cdacb2e2efc835 /src/elfs/elfparser.c | |
| parent | 34b85b3560385d4aef73c64548e200f6bb0e264e (diff) | |
| download | box64-b2f94b274cbd479a58b15161a8c6601b2ee1d072.tar.gz box64-b2f94b274cbd479a58b15161a8c6601b2ee1d072.zip | |
[BOX32] Start differentiate 64bits from 32bits in elf parser
Diffstat (limited to 'src/elfs/elfparser.c')
| -rw-r--r-- | src/elfs/elfparser.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/elfs/elfparser.c b/src/elfs/elfparser.c index 49fea7aa..9a8f6bee 100644 --- a/src/elfs/elfparser.c +++ b/src/elfs/elfparser.c @@ -17,7 +17,7 @@ #define DT_GNU_HASH 0x6ffffef5 #endif -int LoadSH(FILE *f, Elf64_Shdr *s, void** SH, const char* name, uint32_t type) +static int LoadSH(FILE *f, Elf64_Shdr *s, void** SH, const char* name, uint32_t type) { if(type && (s->sh_type != type)) { printf_log(LOG_INFO, "Section Header \"%s\" (off=%ld, size=%ld) has incorect type (%d != %d)\n", name, s->sh_offset, s->sh_size, s->sh_type, type); @@ -36,7 +36,7 @@ int LoadSH(FILE *f, Elf64_Shdr *s, void** SH, const char* name, uint32_t type) return 0; } -int FindSection(Elf64_Shdr *s, int n, char* SHStrTab, const char* name) +static int FindSection(Elf64_Shdr *s, int n, char* SHStrTab, const char* name) { for (int i=0; i<n; ++i) { if(s[i].sh_type!=SHT_NULL) @@ -46,7 +46,7 @@ int FindSection(Elf64_Shdr *s, int n, char* SHStrTab, const char* name) return 0; } -void LoadNamedSection(FILE *f, Elf64_Shdr *s, int size, char* SHStrTab, const char* name, const char* clearname, uint32_t type, void** what, size_t* num) +static void LoadNamedSection(FILE *f, Elf64_Shdr *s, int size, char* SHStrTab, const char* name, const char* clearname, uint32_t type, void** what, size_t* num) { int n = FindSection(s, size, SHStrTab, name); printf_dump(LOG_DEBUG, "Loading %s (idx = %d)\n", clearname, n); @@ -61,7 +61,7 @@ void LoadNamedSection(FILE *f, Elf64_Shdr *s, int size, char* SHStrTab, const ch } } -elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) +elfheader_t* ParseElfHeader64(FILE* f, const char* name, int exec) { Elf64_Ehdr header; int level = (exec)?LOG_INFO:LOG_DEBUG; @@ -394,7 +394,7 @@ elfheader_t* ParseElfHeader(FILE* f, const char* name, int exec) return h; } -const char* BindSym(int bind) +const char* BindSym64(int bind) { switch(bind) { case STB_GLOBAL: return "STB_GLOBAL"; |