summaryrefslogtreecommitdiff
path: root/ldso/libdl/libdl.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-07-05 19:05:55 +0000
committerMike Frysinger <vapier@gentoo.org>2006-07-05 19:05:55 +0000
commitb536763f513920b64d73ead1bd7b083159866a85 (patch)
treed4d3b8291e918c1abbafa95a5dccc9d1f77584ba /ldso/libdl/libdl.c
parente5657ed358ddb5956171df3144e4e698205de1b4 (diff)
patch from Bernd Schmidt to abstract away load address checks
Diffstat (limited to 'ldso/libdl/libdl.c')
-rw-r--r--ldso/libdl/libdl.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index 322230860..418a720e0 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -175,8 +175,7 @@ void *dlopen(const char *libname, int flag)
tfrom = NULL;
for (dpnt = _dl_symbol_tables; dpnt; dpnt = dpnt->next) {
tpnt = dpnt->dyn;
- if (tpnt->loadaddr < from
- && (tfrom == NULL || tfrom->loadaddr < tpnt->loadaddr))
+ if (DL_ADDR_IN_LOADADDR(from, tpnt, tfrom))
tfrom = tpnt;
}
}
@@ -436,8 +435,7 @@ void *dlsym(void *vhandle, const char *name)
tfrom = NULL;
for (rpnt = _dl_symbol_tables; rpnt; rpnt = rpnt->next) {
tpnt = rpnt->dyn;
- if (tpnt->loadaddr < from
- && (tfrom == NULL || tfrom->loadaddr < tpnt->loadaddr)) {
+ if (DL_ADDR_IN_LOADADDR(from, tpnt, tfrom)) {
tfrom = tpnt;
handle = rpnt->next;
}
@@ -664,10 +662,8 @@ int dladdr(const void *__address, Dl_info * __info)
fprintf(stderr, "Module \"%s\" at %p\n",
tpnt->libname, tpnt->loadaddr);
#endif
- if (tpnt->loadaddr < (ElfW(Addr)) __address
- && (pelf == NULL || pelf->loadaddr < tpnt->loadaddr)) {
+ if (DL_ADDR_IN_LOADADDR((ElfW(Addr)) __address, tpnt, pelf))
pelf = tpnt;
- }
}
if (!pelf) {