OSDN Git Service

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