mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
LibELF+LibC: Support building LibELF for 64-bit targets
This commit is contained in:
parent
e468bf08b1
commit
fdbe66a7b4
3 changed files with 45 additions and 39 deletions
|
@ -11,17 +11,22 @@
|
|||
#else
|
||||
# include <elf.h>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define ElfW(type) Elf32_##type
|
||||
#ifdef __LP64__
|
||||
# define ElfW(type) Elf64_##type
|
||||
#else
|
||||
# define ElfW(type) Elf32_##type
|
||||
#endif
|
||||
|
||||
struct dl_phdr_info {
|
||||
Elf32_Addr dlpi_addr;
|
||||
ElfW(Addr) dlpi_addr;
|
||||
const char* dlpi_name;
|
||||
const Elf32_Phdr* dlpi_phdr;
|
||||
Elf32_Half dlpi_phnum;
|
||||
const ElfW(Phdr) * dlpi_phdr;
|
||||
ElfW(Half) dlpi_phnum;
|
||||
};
|
||||
|
||||
int dl_iterate_phdr(int (*callback)(struct dl_phdr_info* info, size_t size, void* data), void* data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue