diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-02-03 00:31:37 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-02-03 00:31:37 +0000 |
commit | 7969407a01a108298ea506e0c37c1d6b7c9d424c (patch) | |
tree | 3c4f570e330a91ce712a574ee2d7ea1e9476c397 /elf/rtld.c | |
parent | 88794e308552d6051453544f8790986314fd9e1c (diff) | |
download | glibc-7969407a01a108298ea506e0c37c1d6b7c9d424c.tar.gz glibc-7969407a01a108298ea506e0c37c1d6b7c9d424c.tar.xz glibc-7969407a01a108298ea506e0c37c1d6b7c9d424c.zip |
Update.
Change ld.so to not use functions which are exported. One cannot interpose them anyway. Use INT() to mark uses, INTDEF() to mark definitions. * include/libc-symbols.h: Define INT and INTDEF. * sysdeps/generic/ldsodefs.h: Declare _dl_debug_printf_internal, _dl_signal_error_internal, _dl_map_object_internal, _dl_map_object_deps_internal, _dl_lookup_symbol_internal, _dl_lookup_versioned_symbol_internal, _dl_relocate_object_internal, _dl_debug_state_internal, _dl_start_profile_internal, and _dl_unload_cache_internal. * include/dlfcn.h: Declare _dl_catch_error_internal. * elf/rtld.c: Use INT for calls to any of the *_internal functions above. Add INTDEF to function definitions. * elf/dl-debug.c: Likewise. * elf/dl-deps.c: Likewise. * elf/dl-dst.h: Likewise. * elf/dl-error.c: Likewise. * elf/dl-fini.c: Likewise. * elf/dl-init.c: Likewise. * elf/dl-load.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-misc.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-profile.c: Likewise. * elf/dl-reloc.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-version.c: Likewise. * elf/do-lookup.h: Likewise. * sysdeps/generic/dl-cache.c: Likewise. * sysdeps/generic/dl-sysdep.c: Likewise. * sysdeps/alpha/dl-machine.h (RTLD_START): Call _dl_init_internal instead of _dl_init. * sysdeps/arm/dl-machine.h: Likewise. * sysdeps/cris/dl-machine.h: Likewise. * sysdeps/hppa/dl-machine.h: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * sysdeps/ia64/dl-machine.h: Likewise. * sysdeps/m68k/dl-machine.h: Likewise. * sysdeps/mips/dl-machine.h: Likewise. * sysdeps/mips/mips64/dl-machine.h: Likewise. * sysdeps/s390/s390-32/dl-machine.h: Likewise. * sysdeps/s390/s390-64/dl-machine.h: Likewise. * sysdeps/sh/dl-machine.h: Likewise. * sysdeps/sparc/sparc32/dl-machine.h: Likewise. * sysdeps/sparc/sparc64/dl-machine.h: Likewise. * sysdeps/x86_64/dl-machine.h: Likewise. * sysdeps/powerpc/dl-start.S (_dl_start_user): Likewise. * elf/Versions: Don't export _dl_check_all_versions, _dl_sysdep_start, and _dl_debug_initialize.
Diffstat (limited to 'elf/rtld.c')
-rw-r--r-- | elf/rtld.c | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/elf/rtld.c b/elf/rtld.c index b835bd5dda..4dd288b072 100644 --- a/elf/rtld.c +++ b/elf/rtld.c @@ -297,15 +297,14 @@ relocate_doit (void *a) { struct relocate_args *args = (struct relocate_args *) a; - _dl_relocate_object (args->l, args->l->l_scope, - args->lazy, 0); + INT(_dl_relocate_object) (args->l, args->l->l_scope, args->lazy, 0); } static void map_doit (void *a) { struct map_args *args = (struct map_args *) a; - args->main_map = _dl_map_object (NULL, args->str, 0, lt_library, 0, 0); + args->main_map = INT(_dl_map_object) (NULL, args->str, 0, lt_library, 0, 0); } static void @@ -495,7 +494,7 @@ of this helper program; chances are you did not intend to run this program.\n\ struct map_args args; args.str = _dl_argv[0]; - (void) _dl_catch_error (&objname, &err_str, map_doit, &args); + (void) INT(_dl_catch_error) (&objname, &err_str, map_doit, &args); if (__builtin_expect (err_str != NULL, 0)) { if (err_str != _dl_out_of_memory) @@ -506,7 +505,7 @@ of this helper program; chances are you did not intend to run this program.\n\ else { HP_TIMING_NOW (start); - _dl_map_object (NULL, _dl_argv[0], 0, lt_library, 0, 0); + INT(_dl_map_object) (NULL, _dl_argv[0], 0, lt_library, 0, 0); HP_TIMING_NOW (stop); HP_TIMING_DIFF (load_time, start, stop); @@ -703,8 +702,9 @@ of this helper program; chances are you did not intend to run this program.\n\ && (__builtin_expect (! __libc_enable_secure, 1) || strchr (p, '/') == NULL)) { - struct link_map *new_map = _dl_map_object (GL(dl_loaded), p, 1, - lt_library, 0, 0); + struct link_map *new_map = INT(_dl_map_object) (GL(dl_loaded), p, + 1, lt_library, + 0, 0); if (++new_map->l_opencount == 1) /* It is no duplicate. */ ++npreloads; @@ -771,8 +771,10 @@ of this helper program; chances are you did not intend to run this program.\n\ while ((p = strsep (&runp, ": \t\n")) != NULL) if (p[0] != '\0') { - struct link_map *new_map = _dl_map_object (GL(dl_loaded), p, 1, - lt_library, 0, 0); + struct link_map *new_map = INT(_dl_map_object) (GL(dl_loaded), + p, 1, + lt_library, + 0, 0); if (++new_map->l_opencount == 1) /* It is no duplicate. */ ++npreloads; @@ -782,8 +784,8 @@ of this helper program; chances are you did not intend to run this program.\n\ if (problem != NULL) { char *p = strndupa (problem, file_size - (problem - file)); - struct link_map *new_map = _dl_map_object (GL(dl_loaded), p, 1, - lt_library, 0, 0); + struct link_map *new_map = INT(_dl_map_object) (GL(dl_loaded), p, 1, + lt_library, 0, 0); if (++new_map->l_opencount == 1) /* It is no duplicate. */ ++npreloads; @@ -816,7 +818,7 @@ of this helper program; chances are you did not intend to run this program.\n\ specified some libraries to load, these are inserted before the actual dependencies in the executable's searchlist for symbol resolution. */ HP_TIMING_NOW (start); - _dl_map_object_deps (GL(dl_loaded), preloads, npreloads, mode == trace); + INT(_dl_map_object_deps) (GL(dl_loaded), preloads, npreloads, mode == trace); HP_TIMING_NOW (stop); HP_TIMING_DIFF (diff, start, stop); HP_TIMING_ACCUM_NT (load_time, diff); @@ -938,9 +940,9 @@ of this helper program; chances are you did not intend to run this program.\n\ ElfW(Addr) loadbase; lookup_t result; - result = _dl_lookup_symbol (_dl_argv[i], GL(dl_loaded), - &ref, GL(dl_loaded)->l_scope, - ELF_RTYPE_CLASS_PLT, 1); + result = INT(_dl_lookup_symbol) (_dl_argv[i], GL(dl_loaded), + &ref, GL(dl_loaded)->l_scope, + ELF_RTYPE_CLASS_PLT, 1); loadbase = LOOKUP_VALUE_ADDRESS (result); @@ -976,8 +978,8 @@ of this helper program; chances are you did not intend to run this program.\n\ if ((GL(dl_debug_mask) & DL_DEBUG_PRELINK) && GL(dl_rtld_map).l_opencount > 1) - _dl_relocate_object (&GL(dl_rtld_map), GL(dl_loaded)->l_scope, - 0, 0); + INT(_dl_relocate_object) (&GL(dl_rtld_map), + GL(dl_loaded)->l_scope, 0, 0); } #define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED)) @@ -1174,7 +1176,8 @@ of this helper program; chances are you did not intend to run this program.\n\ } if (l != &GL(dl_rtld_map)) - _dl_relocate_object (l, l->l_scope, GL(dl_lazy), consider_profiling); + INT(_dl_relocate_object) (l, l->l_scope, GL(dl_lazy), + consider_profiling); l = l->l_prev; } @@ -1196,14 +1199,15 @@ of this helper program; chances are you did not intend to run this program.\n\ needs to have _dl_profile_map set up by the relocator. */ if (__builtin_expect (GL(dl_profile_map) != NULL, 0)) /* We must prepare the profiling. */ - _dl_start_profile (GL(dl_profile_map), GL(dl_profile_output)); + INT(_dl_start_profile) (GL(dl_profile_map), GL(dl_profile_output)); if (GL(dl_rtld_map).l_opencount > 1) { /* There was an explicit ref to the dynamic linker as a shared lib. Re-relocate ourselves with user-controlled symbol definitions. */ HP_TIMING_NOW (start); - _dl_relocate_object (&GL(dl_rtld_map), GL(dl_loaded)->l_scope, 0, 0); + INT(_dl_relocate_object) (&GL(dl_rtld_map), GL(dl_loaded)->l_scope, + 0, 0); HP_TIMING_NOW (stop); HP_TIMING_DIFF (add, start, stop); HP_TIMING_ACCUM_NT (relocate_time, add); @@ -1248,12 +1252,12 @@ of this helper program; chances are you did not intend to run this program.\n\ /* Notify the debugger that all objects are now mapped in. */ r->r_state = RT_ADD; - _dl_debug_state (); + INT(_dl_debug_state) (); } #ifndef MAP_COPY /* We must munmap() the cache file. */ - _dl_unload_cache (); + INT(_dl_unload_cache) (); #endif /* Once we return, _dl_sysdep_start will invoke @@ -1593,8 +1597,9 @@ print_statistics (void) if (HP_TIMING_AVAIL) { HP_TIMING_PRINT (buf, sizeof (buf), rtld_total_time); - _dl_debug_printf ("\nruntime linker statistics:\n" - " total startup time in dynamic loader: %s\n", buf); + INT(_dl_debug_printf) ("\nruntime linker statistics:\n" + " total startup time in dynamic loader: %s\n", + buf); } /* Print relocation statistics. */ @@ -1616,14 +1621,15 @@ print_statistics (void) *wp++ = *cp++; } *wp = '\0'; - _dl_debug_printf (" time needed for relocation: %s (%s%%)\n", - buf, pbuf); + INT(_dl_debug_printf) ("\ + time needed for relocation: %s (%s%%)\n", + buf, pbuf); } #endif - _dl_debug_printf (" number of relocations: %lu\n", - GL(dl_num_relocations)); - _dl_debug_printf (" number of relocations from cache: %lu\n", - GL(dl_num_cache_relocations)); + INT(_dl_debug_printf) (" number of relocations: %lu\n", + GL(dl_num_relocations)); + INT(_dl_debug_printf) (" number of relocations from cache: %lu\n", + GL(dl_num_cache_relocations)); #ifndef HP_TIMING_NONAVAIL /* Time spend while loading the object and the dependencies. */ @@ -1645,8 +1651,9 @@ print_statistics (void) *wp++ = *cp++; } *wp = '\0'; - _dl_debug_printf (" time needed to load objects: %s (%s%%)\n", - buf, pbuf); + INT(_dl_debug_printf) ("\ + time needed to load objects: %s (%s%%)\n", + buf, pbuf); } #endif } |