summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-08 02:19:27 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-08 02:19:27 +0000
commitb8565e7817d7c6afd8eac804867b88c9bad1c9f1 (patch)
tree9e17bf573db9a3681fd11d08a250844638fb82be /elf
parent1c14af448eef3274c386069b78b2ce93f2a5e3c6 (diff)
downloadglibc-b8565e7817d7c6afd8eac804867b88c9bad1c9f1.tar.gz
glibc-b8565e7817d7c6afd8eac804867b88c9bad1c9f1.tar.xz
glibc-b8565e7817d7c6afd8eac804867b88c9bad1c9f1.zip
Update.
	* elf/dl-addr.c (_dl_addr): Fill in correct information if symbol
	is in main program.
	* elf/Versions [ld] (GLIBC_2.2): Export _dl_argv.
Diffstat (limited to 'elf')
-rw-r--r--elf/Versions2
-rw-r--r--elf/dl-addr.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/elf/Versions b/elf/Versions
index 374110c832..a7c5a780f6 100644
--- a/elf/Versions
+++ b/elf/Versions
@@ -52,7 +52,7 @@ ld {
     _dl_dst_count; _dl_dst_substitute;
   }
   GLIBC_2.2 {
-    _dl_init; _dl_load_lock;
+    _dl_init; _dl_load_lock; _dl_argv;
 
     # this is defined in ld.so and overridden by libc
     _dl_init_first;
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 3932a6573a..d3adf12c67 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -63,6 +63,13 @@ _dl_addr (const void *address, Dl_info *info)
   info->dli_fname = match->l_name;
   info->dli_fbase = (void *) match->l_addr;
 
+  /* If this is the main program the information is incomplete.  */
+  if (__builtin_expect (info->dli_fbase == NULL, 0))
+    {
+      info->dli_fname = _dl_argv[0];
+      info->dli_fbase = (void *) match->l_map_start;
+    }
+
   symtab = (const void *) D_PTR (match, l_info[DT_SYMTAB]);
   strtab = (const void *) D_PTR (match, l_info[DT_STRTAB]);