diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-03-25 16:50:22 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2013-03-25 16:50:22 -0700 |
commit | 5ba0377b291ceb5d1e96674831cb6fd15eebf980 (patch) | |
tree | 09a12c1edac6ace9585ef18882808f3296f4f144 /pk/elf.c | |
parent | 1cc5f32ea1bee3d7bce14d064651ea417a68e148 (diff) | |
download | pk-5ba0377b291ceb5d1e96674831cb6fd15eebf980.zip pk-5ba0377b291ceb5d1e96674831cb6fd15eebf980.tar.gz pk-5ba0377b291ceb5d1e96674831cb6fd15eebf980.tar.bz2 |
add clean-room elf.h to avoid GPL entanglement
Diffstat (limited to 'pk/elf.c')
-rw-r--r-- | pk/elf.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -43,15 +43,17 @@ long load_elf(const char* fn, int* user64) } while(0) long entry; - if(eh64->e_ident[EI_CLASS] == ELFCLASS32) + *user64 = 0; + if (IS_ELF32(*eh64)) { Elf32_Ehdr* eh; Elf32_Phdr* ph; LOAD_ELF; entry = eh->e_entry; } - else if(eh64->e_ident[EI_CLASS] == ELFCLASS64) + else if (IS_ELF64(*eh64)) { + *user64 = 1; Elf64_Ehdr* eh; Elf64_Phdr* ph; LOAD_ELF; @@ -60,8 +62,6 @@ long load_elf(const char* fn, int* user64) else goto fail; - *user64 = eh64->e_ident[EI_CLASS] == ELFCLASS64; - file_decref(file); return entry; |