summaryrefslogtreecommitdiff
path: root/ldso
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2018-04-22 11:55:36 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2018-04-22 12:14:00 +0100
commitd86bd35298834f3162459dde763f7976f5c2a523 (patch)
tree9a35449f2f145c929ffcbe377a283c040c598f4a /ldso
parent8d7723d1c122c31a07cc6d51ab587ea879dca099 (diff)
libdl: end must be bigger than start
Diffstat (limited to 'ldso')
-rw-r--r--ldso/libdl/libdl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c
index ff2753591..d36ac6421 100644
--- a/ldso/libdl/libdl.c
+++ b/ldso/libdl/libdl.c
@@ -967,7 +967,8 @@ static int do_dlclose(void *vhandle, int need_fini)
end = (end + ADDR_ALIGN) & PAGE_ALIGN;
start = start & ~ADDR_ALIGN;
_dl_if_debug_print("unmapping: %s start: '%p' end: '%p'\n", tpnt->libname, start, end);
- DL_LIB_UNMAP (tpnt, end - start);
+ if (end > start)
+ DL_LIB_UNMAP (tpnt, end - start);
/* Free elements in RTLD_LOCAL scope list */
for (runp = tpnt->rtld_local; runp; runp = tmp) {
tmp = runp->next;