Need help using <elf.h>
How do I wrap Elf32_Ehdr
and El开发者_运维技巧f64_Ehdr
so that on 64 bit architectures Elf64_Ehdr
and Elf32_Ehdr
on 32 bit ones?
#include <stdint.h>
#include <elf.h>
#if UINTPTR_MAX == 0xffffffff
#define Elf_Ehdr Elf32_Ehdr
#define Elf_Phdr Elf32_Phdr
#else
#define Elf_Ehdr Elf64_Ehdr
#define Elf_Phdr Elf64_Phdr
#endif
精彩评论