OSDN Git Service

a23e89355263b88af544cb658aa4ce04db2fd9c1
[uclinux-h8/uClibc.git] / ldso / include / ldso.h
1 #ifndef _LDSO_H_
2 #define _LDSO_H_
3
4 #include <features.h>
5 /* Pull in compiler and arch stuff */
6 #include <stdlib.h>
7 #include <stdarg.h>
8 /* Pull in the arch specific type information */
9 #include <sys/types.h>
10 /* Now the ldso specific headers */
11 #include <dl-elf.h>
12 #include <dl-syscall.h>
13 #include <dl-hash.h>
14 #include <dl-string.h>
15 /* Pull in the arch specific page size */
16 #include <asm/page.h>
17 #ifndef PAGE_SIZE
18 #  define PAGE_SHIFT            12
19 #  define PAGE_SIZE             (1UL << PAGE_SHIFT)
20 #endif
21
22 /* Prepare for the case that `__builtin_expect' is not available.  */
23 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96
24 #define __builtin_expect(x, expected_value) (x)
25 #endif
26 #ifndef likely
27 # define likely(x)      __builtin_expect((!!(x)),1)
28 #endif
29 #ifndef unlikely
30 # define unlikely(x)    __builtin_expect((!!(x)),0)
31 #endif
32 #ifndef __LINUX_COMPILER_H
33 #define __LINUX_COMPILER_H
34 #endif
35
36
37 /* Global variables used within the shared library loader */
38 extern char *_dl_library_path;         /* Where we look for libraries */
39 extern char *_dl_preload;              /* Things to be loaded before the libs */
40 extern char *_dl_ldsopath;             /* Where the shared lib loader was found */
41 extern const char *_dl_progname;       /* The name of the executable being run */
42 extern unsigned char *_dl_malloc_addr; /* Lets _dl_malloc use the already allocated memory page */
43 extern unsigned char *_dl_mmap_zero;   /* Also used by _dl_malloc */
44 extern unsigned long *_dl_brkp;        /* The end of the data segment for brk and sbrk */
45 extern unsigned long *_dl_envp;        /* The environment address */
46 extern int _dl_secure;                 /* Are we dealing with setuid stuff? */
47
48 #ifdef __SUPPORT_LD_DEBUG__
49 extern char *_dl_debug;
50 extern char *_dl_debug_symbols;
51 extern char *_dl_debug_move;
52 extern char *_dl_debug_reloc;
53 extern char *_dl_debug_detail;
54 extern char *_dl_debug_nofixups;
55 extern char *_dl_debug_bindings;
56 extern int   _dl_debug_file;
57 #else
58 #define _dl_debug_file 2
59 #endif
60
61 #ifndef NULL
62 #define NULL ((void *) 0)
63 #endif
64
65 extern void *_dl_malloc(int size);
66 extern char *_dl_getenv(const char *symbol, char **envp);
67 extern void _dl_unsetenv(const char *symbol, char **envp);
68 extern char *_dl_strdup(const char *string);
69 extern void _dl_dprintf(int, const char *, ...);
70
71 extern void _dl_get_ready_to_run(struct elf_resolve *tpnt, struct elf_resolve *app_tpnt,
72                 unsigned long load_addr, unsigned long *hash_addr,
73                 Elf32_auxv_t auxvt[AT_EGID + 1], char **envp, struct r_debug *debug_addr,
74                 unsigned char *malloc_buffer, unsigned char *mmap_zero, char **argv);
75
76
77 #endif /* _LDSO_H_ */
78