aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-25 23:21:20 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-25 23:21:20 +0000
commit722c33bbb6d2984cf537f0d3669617fba041fb50 (patch)
tree2a7f596c5e9979123c3833a1684a2d3516c067f9 /elf
parent788e8e7c221825916e6ab11f0079d4c5ede8a057 (diff)
downloadglibc-722c33bbb6d2984cf537f0d3669617fba041fb50.zip
glibc-722c33bbb6d2984cf537f0d3669617fba041fb50.tar.gz
glibc-722c33bbb6d2984cf537f0d3669617fba041fb50.tar.bz2
Update.
* string/bits/string2.h: Fix aliasing problems. * sysdeps/i386/i486/bits/string.h: Likewise. * sysdeps/i386/bits/string.h: Likewise. 1998-12-28 Geoff Keating <geoffk@ozemail.com.au> * sysdeps/powerpc/dl-machine.c: Handle shared library profiling. * elf/rtld.c (dl_main): Don't call malloc() between re-relocating the dynamic linker and running the application's crt0. 1999-07-21 Paul D. Smith <psmith@gnu.org> * sysdeps/generic/glob.c: Move getlogin{,_r} prototypes below glob.h to get __P() macro. * posix/fnmatch.c (internal_fnmatch): Use K&R definition syntax, not ANSI. (__strchrnul): This won't exist outside GLIBC, so create one. 1999-07-25 Jakub Jelinek <jj@ultra.linux.cz> * sysdeps/unix/sysv/linux/sparc/bits/types.h: Always define __qaddr_t. __ino64_t should be 32bit unsigned type on sparc32. Define __off64_t to __quad_t instead of __int64_t. Make __pic_pid_t unsigned on sparc32. 1999-07-25 Andreas Jaeger <aj@arthur.rhein-neckar.de> * localedata/tst-rpmatch.sh: Use "&" instead of "§" to avoid a bug in bash 2.03. 1999-07-25 Ulrich Drepper <drepper@cygnus.com>
Diffstat (limited to 'elf')
-rw-r--r--elf/rtld.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 6029380..72c81fb 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -1024,6 +1024,14 @@ of this helper program; chances are you did not intend to run this program.\n\
_dl_relocate_object might need to call `mprotect' for DT_TEXTREL. */
_dl_sysdep_start_cleanup ();
+ /* Now enable profiling if needed. Like the previous call,
+ this has to go here because the calls it makes should use the
+ rtld versions of the functions (particularly calloc()), but it
+ needs to have _dl_profile_map set up by the relocator. */
+ if (_dl_profile_map != NULL)
+ /* We must prepare the profiling. */
+ _dl_start_profile (_dl_profile_map, _dl_profile_output);
+
if (_dl_rtld_map.l_opencount > 0)
{
/* There was an explicit ref to the dynamic linker as a shared lib.
@@ -1082,11 +1090,6 @@ of this helper program; chances are you did not intend to run this program.\n\
_dl_unload_cache ();
#endif
- /* Now enable profiling if needed. */
- if (_dl_profile_map != NULL)
- /* We must prepare the profiling. */
- _dl_start_profile (_dl_profile_map, _dl_profile_output);
-
/* Once we return, _dl_sysdep_start will invoke
the DT_INIT functions and then *USER_ENTRY. */
}
@@ -1299,11 +1302,7 @@ process_envvars (enum mode *modep, int *lazyp)
/* Which shared object shall be profiled. */
if (memcmp (&envline[3], "PROFILE", 7) == 0)
- {
- _dl_profile = &envline[11];
- if (*_dl_profile == '\0')
- _dl_profile = NULL;
- }
+ _dl_profile = &envline[11];
break;
case 8:
@@ -1388,6 +1387,12 @@ process_envvars (enum mode *modep, int *lazyp)
unsetenv ("LD_PRELOAD");
if (library_path != NULL)
unsetenv ("LD_LIBRARY_PATH");
+ if (_dl_origin_path != NULL)
+ unsetenv ("LD_ORIGIN_PATH");
+ if (debug_output != NULL)
+ unsetenv ("LD_DEBUG_OUTPUT");
+ if (_dl_profile != NULL)
+ unsetenv ("LD_PROFILE");
for (cnt = 0;
cnt < sizeof (unsecure_envvars) / sizeof (unsecure_envvars[0]);
@@ -1395,6 +1400,10 @@ process_envvars (enum mode *modep, int *lazyp)
unsetenv (unsecure_envvars[cnt]);
}
+ /* The name of the object to profile cannot be empty. */
+ if (_dl_profile != NULL && *_dl_profile == '\0')
+ _dl_profile = NULL;
+
/* If we have to run the dynamic linker in debugging mode and the
LD_DEBUG_OUTPUT environment variable is given, we write the debug
messages to this file. */