OSDN Git Service

Work around a bug in nm from binutils-2.14.90.0.5.
[uclinux-h8/uClibc.git] / ldso / ldso / linuxelf.h
1 #ifndef LINUXELF_H
2 #define LINUXELF_H
3
4
5 #include <sys/types.h>
6 #include "ld_sysdep.h" /* before elf.h to get ELF_USES_RELOCA right */
7 #include <elf.h>
8
9 /* Forward declarations for stuff defined in hash.h */
10 struct dyn_elf;
11 struct elf_resolve;
12
13
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
30
31
32 #if ELF_CLASS == ELFCLASS32
33
34 #define elfhdr          Elf32_Ehdr
35 #define elf_phdr        Elf32_Phdr
36 #define elf_note        Elf32_Nhdr
37 /*
38  * Datatype of a relocation on this platform
39  */
40 #ifdef ELF_USES_RELOCA
41 # define ELF_RELOC      Elf32_Rela
42 #else
43 # define ELF_RELOC      Elf32_Rel
44 #endif
45
46 #else
47
48 #define elfhdr          Elf64_Ehdr
49 #define elf_phdr        Elf64_Phdr
50 #define elf_note        Elf64_Nhdr
51 /*
52  * Datatype of a relocation on this platform
53  */
54 #ifdef ELF_USES_RELOCA
55 # define ELF_RELOC      Elf64_Rela
56 #else
57 # define ELF_RELOC      Elf64_Rel
58 #endif
59
60 #endif
61
62
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))
68
69 #endif  /* LINUXELF_H */