OSDN Git Service

ldso: simplify interp path search logic
[uclinux-h8/uClibc.git] / ldso / include / ldso.h
index 53bb5be..6f3b728 100644 (file)
@@ -27,6 +27,8 @@
 /* Pull in compiler and arch stuff */
 #include <stdlib.h>
 #include <stdarg.h>
+#include <stddef.h> /* for ptrdiff_t */
+#include <stdbool.h>
 #define _FCNTL_H
 #include <bits/fcntl.h>
 #include <bits/wordsize.h>
 #include <sys/types.h>
 /* Pull in the arch specific page size */
 #include <bits/uClibc_page.h>
+/* Pull in the MIN macro */
+#include <sys/param.h>
 /* Pull in the ldso syscalls and string functions */
 #ifndef __ARCH_HAS_NO_SHARED__
 #include <dl-syscall.h>
 #include <dl-string.h>
+#include <dlfcn.h>
 /* Now the ldso specific headers */
 #include <dl-elf.h>
 #ifdef __UCLIBC_HAS_TLS__
@@ -68,15 +73,27 @@ struct init_fini_list {
 /* Global variables used within the shared library loader */
 extern char *_dl_library_path;         /* Where we look for libraries */
 extern char *_dl_preload;              /* Things to be loaded before the libs */
-extern char *_dl_ldsopath;             /* Where the shared lib loader was found */
+#ifdef __LDSO_SEARCH_INTERP_PATH__
+extern const char *_dl_ldsopath;       /* Where the shared lib loader was found */
+#endif
 extern const char *_dl_progname;       /* The name of the executable being run */
 extern size_t _dl_pagesize;            /* Store the page size for use later */
+#ifdef __LDSO_PRELINK_SUPPORT__
+extern char *_dl_trace_prelink;        /* Library for prelinking trace */
+extern struct elf_resolve *_dl_trace_prelink_map;      /* Library map for prelinking trace */
+#else
+#define _dl_trace_prelink              0
+#endif
 
 #if defined(USE_TLS) && USE_TLS
 extern void _dl_add_to_slotinfo (struct link_map  *l);
 extern void ** __attribute__ ((const)) _dl_initial_error_catch_tsd (void);
 #endif
 
+#ifdef USE_TLS
+void _dl_add_to_slotinfo (struct link_map  *l);
+void ** __attribute__ ((const)) _dl_initial_error_catch_tsd (void);
+#endif
 #ifdef __SUPPORT_LD_DEBUG__
 extern char *_dl_debug;
 extern char *_dl_debug_symbols;
@@ -87,7 +104,7 @@ extern char *_dl_debug_nofixups;
 extern char *_dl_debug_bindings;
 extern int   _dl_debug_file;
 # define __dl_debug_dprint(fmt, args...) \
-       _dl_dprintf(_dl_debug_file, "%s:%i: " fmt, __FUNCTION__, __LINE__, ## args);
+       _dl_dprintf(_dl_debug_file, "%s:%i: " fmt, __func__, __LINE__, ## args);
 # define _dl_if_debug_dprint(fmt, args...) \
        do { if (_dl_debug) __dl_debug_dprint(fmt, ## args); } while (0)
 #else
@@ -139,7 +156,7 @@ extern void _dl_dprintf(int, const char *, ...);
 # define DL_GET_READY_TO_RUN_EXTRA_ARGS
 #endif
 
-extern void _dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+extern void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
                ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv
                DL_GET_READY_TO_RUN_EXTRA_PARMS);