1
Fork 0
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:
Gunnar Beutner 2021-04-30 12:39:56 +02:00 committed by Andreas Kling
parent e468bf08b1
commit fdbe66a7b4
3 changed files with 45 additions and 39 deletions

View file

@ -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);