summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2004-02-25 17:06:16 +0000
committerkan <kan@FreeBSD.org>2004-02-25 17:06:16 +0000
commit524af60ccd893b07a952cc4f4bbe5720f7f604d0 (patch)
tree6a3541f1e44c9664f347fd5441d6e53e1cf418bd
parent3e911d2a9e5c1b34a6499a8c74d398ea446da042 (diff)
downloadFreeBSD-src-524af60ccd893b07a952cc4f4bbe5720f7f604d0.zip
FreeBSD-src-524af60ccd893b07a952cc4f4bbe5720f7f604d0.tar.gz
Do not depend on existence of _end symbol in obj_from_addr, use
obj->mapbase and obj->mapsize instead. Prompted by: OpenOffice debugging session at last BSDCon.
-rw-r--r--libexec/rtld-elf/rtld.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 73568d6..7981fa9 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -54,7 +54,6 @@
#include "rtld.h"
#include "libmap.h"
-#define END_SYM "_end"
#define PATH_RTLD "/libexec/ld-elf.so.1"
/* Types. */
@@ -1229,18 +1228,12 @@ load_object(char *path)
static Obj_Entry *
obj_from_addr(const void *addr)
{
- unsigned long endhash;
Obj_Entry *obj;
- endhash = elf_hash(END_SYM);
for (obj = obj_list; obj != NULL; obj = obj->next) {
- const Elf_Sym *endsym;
-
if (addr < (void *) obj->mapbase)
continue;
- if ((endsym = symlook_obj(END_SYM, endhash, obj, true)) == NULL)
- continue; /* No "end" symbol?! */
- if (addr < (void *) (obj->relocbase + endsym->st_value))
+ if (addr < (void *) (obj->mapbase + obj->mapsize))
return obj;
}
return NULL;
OpenPOWER on IntegriCloud