From 3a56ea26730755076cb5bc1d07727c7a4fcb8fd7 Mon Sep 17 00:00:00 2001 From: Andreas Krebbel Date: Fri, 15 Jan 2010 09:09:35 -0800 Subject: ld.so: Adjust the auxv if ld.so is directly invoked. If a binary gets invoked by passing it as argument to ld.so the stack still holds the auxiliary vector of ld.so when entering the _start routine of the executable. So the invocation via ld.so is not fully transparent to the executable. This causes problems if the executable wants to scan the auxv itself. --- elf/dl-open.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'elf/dl-open.c') diff --git a/elf/dl-open.c b/elf/dl-open.c index e920c7738c..754a263fa1 100644 --- a/elf/dl-open.c +++ b/elf/dl-open.c @@ -1,5 +1,5 @@ /* Load a shared object at runtime, relocate it, and run its initializer. - Copyright (C) 1996-2007, 2009 Free Software Foundation, Inc. + Copyright (C) 1996-2007, 2009, 2010 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -40,7 +40,8 @@ extern ElfW(Addr) _dl_sysdep_start (void **start_argptr, void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phnum, - ElfW(Addr) *user_entry)); + ElfW(Addr) *user_entry, + ElfW(auxv_t) *auxv)); weak_extern (BP_SYM (_dl_sysdep_start)) extern int __libc_multiple_libcs; /* Defined in init-first.c. */ @@ -346,8 +347,8 @@ dl_open_worker (void *a) { /* If this here is the shared object which we want to profile make sure the profile is started. We can find out whether - this is necessary or not by observing the `_dl_profile_map' - variable. If was NULL but is not NULL afterwars we must + this is necessary or not by observing the `_dl_profile_map' + variable. If was NULL but is not NULL afterwars we must start the profiling. */ struct link_map *old_profile_map = GL(dl_profile_map); -- cgit 1.4.1