summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-08-19 09:06:15 +0000
committerJoakim Tjernlund <joakim.tjernlund@transmode.se>2004-08-19 09:06:15 +0000
commit86eecc5c4007ef59b51911dcff41b77a393f45e1 (patch)
tree53524fae21145c150e0ecba2295d5e43ee14d170
parent0a98c1b6b0a98fc7010e69f48a4cc13fa31d6f81 (diff)
Move "debug_addr" ptr from dl-startup.c to ldso.c
-rw-r--r--ldso/include/ldso.h2
-rw-r--r--ldso/ldso/dl-startup.c9
-rw-r--r--ldso/ldso/ldso.c9
3 files changed, 9 insertions, 11 deletions
diff --git a/ldso/include/ldso.h b/ldso/include/ldso.h
index 6d978bf1d..f34fe17a9 100644
--- a/ldso/include/ldso.h
+++ b/ldso/include/ldso.h
@@ -68,7 +68,7 @@ extern char *_dl_strdup(const char *string);
extern void _dl_dprintf(int, const char *, ...);
extern void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
- Elf32_auxv_t auxvt[AT_EGID + 1], char **envp, struct r_debug *debug_addr,
+ Elf32_auxv_t auxvt[AT_EGID + 1], char **envp,
unsigned char *malloc_buffer, unsigned char *mmap_zero, char **argv);
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index 06bd146b8..88ca8bd8c 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -130,7 +130,6 @@ DL_BOOT(unsigned long args)
Elf32_auxv_t auxvt[AT_EGID + 1];
unsigned char *malloc_buffer, *mmap_zero;
Elf32_Dyn *dpnt;
- struct r_debug *debug_addr = NULL;
size_t pagesize;
int indx;
#if defined(__i386__)
@@ -299,12 +298,6 @@ found_got:
tpnt = LD_MALLOC(sizeof(struct elf_resolve));
_dl_memset(tpnt, 0, sizeof(struct elf_resolve));
- /*
- * This is used by gdb to locate the chain of shared libraries that are currently loaded.
- */
- debug_addr = LD_MALLOC(sizeof(struct r_debug));
- _dl_memset(debug_addr, 0, sizeof(struct r_debug));
-
/* OK, that was easy. Next scan the DYNAMIC section of the image.
We are only doing ourself right now - we will have to do the rest later */
#ifdef __SUPPORT_LD_DEBUG_EARLY__
@@ -433,7 +426,7 @@ found_got:
fixed up by now. Still no function calls outside of this library ,
since the dynamic resolver is not yet ready. */
_dl_get_ready_to_run(tpnt, load_addr, auxvt, envp,
- debug_addr, malloc_buffer, mmap_zero, argv);
+ malloc_buffer, mmap_zero, argv);
/* Transfer control to the application. */
diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
index 730d40da6..ce15d0e2b 100644
--- a/ldso/ldso/ldso.c
+++ b/ldso/ldso/ldso.c
@@ -85,7 +85,7 @@ static void debug_fini (int status, void *arg)
#endif
void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
- Elf32_auxv_t auxvt[AT_EGID + 1], char **envp, struct r_debug *debug_addr,
+ Elf32_auxv_t auxvt[AT_EGID + 1], char **envp,
unsigned char *malloc_buffer, unsigned char *mmap_zero, char **argv)
{
ElfW(Phdr) *ppnt;
@@ -97,6 +97,7 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
struct elf_resolve *tpnt1;
struct elf_resolve app_tpnt_tmp;
struct elf_resolve *app_tpnt = &app_tpnt_tmp;
+ struct r_debug *debug_addr;
unsigned long brk_addr, *lpnt;
int (*_dl_atexit) (void *);
#if defined (__SUPPORT_LD_DEBUG__)
@@ -173,7 +174,11 @@ void _dl_get_ready_to_run(struct elf_resolve *tpnt, unsigned long load_addr,
}
#endif
}
-
+ /*
+ * This is used by gdb to locate the chain of shared libraries that are currently loaded.
+ */
+ debug_addr = _dl_malloc(sizeof(struct r_debug));
+ _dl_memset(debug_addr, 0, sizeof(struct r_debug));
ppnt = (ElfW(Phdr) *) auxvt[AT_PHDR].a_un.a_ptr;
for (i = 0; i < auxvt[AT_PHNUM].a_un.a_val; i++, ppnt++) {