summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;