about summary refs log tree commit diff
path: root/elf/rtld.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 453f56eb15..aaf8c32595 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -324,7 +324,7 @@ DL_SYSINFO_IMPLEMENTATION
    is fine, too.  The latter is important here.  We can avoid setting
    up a temporary link map for ld.so if we can mark _rtld_global as
    hidden.  */
-#ifdef PI_STATIC_AND_HIDDEN
+#if 0 //def PI_STATIC_AND_HIDDEN
 # define DONT_USE_BOOTSTRAP_MAP	1
 #endif
 
@@ -439,9 +439,27 @@ _dl_start_final (void *arg, struct dl_start_final_info *info)
   return start_addr;
 }
 
+#ifndef NESTING
+#ifdef DONT_USE_BOOTSTRAP_MAP
+# define bootstrap_map GL(dl_rtld_map)
+#else
+struct dl_start_final_info info;
+# define bootstrap_map info.l
+#endif
+
+  /* This #define produces dynamic linking inline functions for
+     bootstrap relocation instead of general-purpose relocation.
+     Since ld.so must not have any undefined symbols the result
+     is trivial: always the map of ld.so itself.  */
+#define RTLD_BOOTSTRAP
+#define RESOLVE_MAP(sym, version, flags) (&bootstrap_map)
+#include "dynamic-link.h"
+#endif /* n NESTING */
+
 static ElfW(Addr) __attribute_used__
 _dl_start (void *arg)
 {
+#ifdef NESTING
 #ifdef DONT_USE_BOOTSTRAP_MAP
 # define bootstrap_map GL(dl_rtld_map)
 #else
@@ -457,6 +475,7 @@ _dl_start (void *arg)
 #define BOOTSTRAP_MAP (&bootstrap_map)
 #define RESOLVE_MAP(sym, version, flags) BOOTSTRAP_MAP
 #include "dynamic-link.h"
+#endif /* NESTING */
 
   if (HP_TIMING_INLINE && HP_SMALL_TIMING_AVAIL)
 #ifdef DONT_USE_BOOTSTRAP_MAP
@@ -2785,3 +2804,18 @@ print_statistics (hp_timing_t *rtld_total_timep)
     }
 #endif
 }
+
+#ifndef NESTING
+char *dummy1 = (char *)elf_get_dynamic_info;
+# if ! ELF_MACHINE_NO_REL
+char *dummy2 = (char *)elf_machine_rel;
+char *dummy3 = (char *)elf_machine_rel_relative;
+#endif
+# if ! ELF_MACHINE_NO_RELA
+char *dummy4 = (char *)elf_machine_rela;
+char *dummy5 = (char *)elf_machine_rela_relative;
+#endif
+# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
+char *dummy6 = (char *)elf_machine_lazy_rel;
+#endif
+#endif