6 #include "ld_sysdep.h" /* before elf.h to get ELF_USES_RELOCA right */
9 /* Forward declarations for stuff defined in hash.h */
14 /* Some function prototypes */
15 extern int _dl_map_cache(void);
16 extern int _dl_unmap_cache(void);
17 int _dl_copy_fixups(struct dyn_elf * tpnt);
18 extern int _dl_parse_copy_information(struct dyn_elf *rpnt,
19 unsigned long rel_addr, unsigned long rel_size, int type);
20 extern void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt,
21 unsigned long rel_addr, unsigned long rel_size, int type);
22 extern int _dl_parse_relocation_information(struct elf_resolve *tpnt,
23 unsigned long rel_addr, unsigned long rel_size, int type);
24 extern struct elf_resolve * _dl_load_shared_library(int secure,
25 struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname);
26 extern struct elf_resolve * _dl_load_elf_shared_library(int secure,
27 struct dyn_elf **rpnt, char *libname);
28 extern int _dl_linux_resolve(void);
29 #define ELF_CLASS ELFCLASS32
32 #if ELF_CLASS == ELFCLASS32
34 #define elfhdr Elf32_Ehdr
35 #define elf_phdr Elf32_Phdr
36 #define elf_note Elf32_Nhdr
38 * Datatype of a relocation on this platform
40 #ifdef ELF_USES_RELOCA
41 # define ELF_RELOC Elf32_Rela
43 # define ELF_RELOC Elf32_Rel
48 #define elfhdr Elf64_Ehdr
49 #define elf_phdr Elf64_Phdr
50 #define elf_note Elf64_Nhdr
52 * Datatype of a relocation on this platform
54 #ifdef ELF_USES_RELOCA
55 # define ELF_RELOC Elf64_Rela
57 # define ELF_RELOC Elf64_Rel
63 /* Convert between the Linux flags for page protections and the
64 ones specified in the ELF standard. */
65 #define LXFLAGS(X) ( (((X) & PF_R) ? PROT_READ : 0) | \
66 (((X) & PF_W) ? PROT_WRITE : 0) | \
67 (((X) & PF_X) ? PROT_EXEC : 0))
69 #endif /* LINUXELF_H */