OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [linux/] [uClibc/] [ldso/] [include/] [ld_elf.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1325 phoenix
#ifndef LINUXELF_H
2
#define LINUXELF_H
3
 
4
#include <ld_sysdep.h> /* before elf.h to get ELF_USES_RELOCA right */
5
#include <elf.h>
6
#include <link.h>
7
 
8
#ifdef DEBUG
9
#  define LDSO_CONF  "../util/ld.so.conf"
10
#  define LDSO_CACHE "../util/ld.so.cache"
11
#  define LDSO_PRELOAD "../util/ld.so.preload"
12
#else
13
#  define LDSO_CONF  UCLIBC_RUNTIME_PREFIX "etc/ld.so.conf"
14
#  define LDSO_CACHE UCLIBC_RUNTIME_PREFIX "etc/ld.so.cache"
15
#  define LDSO_PRELOAD UCLIBC_RUNTIME_PREFIX "etc/ld.so.preload"
16
#endif
17
 
18
 
19
#define LIB_ANY      -1
20
#define LIB_DLL       0
21
#define LIB_ELF       1
22
#define LIB_ELF64     0x80
23
#define LIB_ELF_LIBC5 2
24
#define LIB_ELF_LIBC6 3
25
#define LIB_ELF_LIBC0 4
26
 
27
/* Forward declarations for stuff defined in ld_hash.h */
28
struct dyn_elf;
29
struct elf_resolve;
30
 
31
 
32
/* Definitions and prototypes for cache stuff */
33
#ifdef USE_CACHE
34
extern int _dl_map_cache(void);
35
extern int _dl_unmap_cache(void);
36
 
37
#define LDSO_CACHE_MAGIC "ld.so-"
38
#define LDSO_CACHE_MAGIC_LEN (sizeof LDSO_CACHE_MAGIC -1)
39
#define LDSO_CACHE_VER "1.7.0"
40
#define LDSO_CACHE_VER_LEN (sizeof LDSO_CACHE_VER -1)
41
 
42
typedef struct {
43
        char magic   [LDSO_CACHE_MAGIC_LEN];
44
        char version [LDSO_CACHE_VER_LEN];
45
        int nlibs;
46
} header_t;
47
 
48
typedef struct {
49
        int flags;
50
        int sooffset;
51
        int liboffset;
52
} libentry_t;
53
 
54
#else
55
static inline void _dl_map_cache(void) { }
56
static inline void _dl_unmap_cache(void) { }
57
#endif  
58
 
59
 
60
/* Function prototypes for non-static stuff in readelflib1.c */
61
int _dl_copy_fixups(struct dyn_elf * tpnt);
62
extern int _dl_parse_copy_information(struct dyn_elf *rpnt,
63
        unsigned long rel_addr, unsigned long rel_size, int type);
64
extern void _dl_parse_lazy_relocation_information(struct elf_resolve *tpnt,
65
        unsigned long rel_addr, unsigned long rel_size, int type);
66
extern int _dl_parse_relocation_information(struct elf_resolve *tpnt,
67
        unsigned long rel_addr, unsigned long rel_size, int type);
68
extern struct elf_resolve * _dl_load_shared_library(int secure,
69
        struct dyn_elf **rpnt, struct elf_resolve *tpnt, char *full_libname);
70
extern struct elf_resolve * _dl_load_elf_shared_library(int secure,
71
        struct dyn_elf **rpnt, char *libname);
72
extern struct elf_resolve *_dl_check_if_named_library_is_loaded(const char *full_libname);
73
extern int _dl_linux_resolve(void);
74
 
75
 
76
/*
77
 * Datatype of a relocation on this platform
78
 */
79
#ifdef ELF_USES_RELOCA
80
# define ELF_RELOC      ElfW(Rela)
81
#else
82
# define ELF_RELOC      ElfW(Rel)
83
#endif
84
 
85
 
86
/* Convert between the Linux flags for page protections and the
87
   ones specified in the ELF standard. */
88
#define LXFLAGS(X) ( (((X) & PF_R) ? PROT_READ : 0) | \
89
                    (((X) & PF_W) ? PROT_WRITE : 0) | \
90
                    (((X) & PF_X) ? PROT_EXEC : 0))
91
 
92
 
93
#endif  /* LINUXELF_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.