summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-08-27 08:46:19 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-08-27 08:46:19 +0000
commit45dd7bda4ea543f41dbd535d6727e76cc438d11a (patch)
tree3fc50d2499d14ab737d74e2264a60ff089630479 /ldso
parent6cd34f77ff5044e6aeb1cf01f02a8403351c4ad1 (diff)
As Mike Frysinger notes, this code is still needed. I
misread this code and removed it, sorry. I printed the values of _dl_brkp and _dl_envp in ldso and got this when executing: ls: __curbrk: 0x300c16e0 __environ: 0x1008372c ldd: __curbrk: 0x300776e0 __environ: 0x3007759c why is__environ in the app when executing ls but not ldd?
Diffstat (limited to 'ldso')
-rw-r--r--ldso/ldso/ldso.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index c18a176b2..dbb5b87be 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -99,6 +99,8 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
struct r_debug *debug_addr;
unsigned long brk_addr, *lpnt;
int (*_dl_atexit) (void *);
+ unsigned long *_dl_brkp; /* The end of the data segment for brk and sbrk */
+ unsigned long *_dl_envp; /* The environment address */
#if defined (__SUPPORT_LD_DEBUG__)
int (*_dl_on_exit) (void (*FUNCTION)(int STATUS, void *ARG),void*);
#endif
@@ -689,6 +691,14 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
dynamicly linked if we are using ld.so.1, so we have to look
up each symbol individually. */
+ _dl_brkp = (unsigned long *) (intptr_t) _dl_find_hash("__curbrk", _dl_symbol_tables, 0);
+ if (_dl_brkp)
+ *_dl_brkp = brk_addr;
+
+ _dl_envp = (unsigned long *) (intptr_t) _dl_find_hash("__environ", _dl_symbol_tables, 0);
+ if (_dl_envp)
+ *_dl_envp = (unsigned long) envp;
+
#ifndef FORCE_SHAREABLE_TEXT_SEGMENTS
{
unsigned int j;