aboutsummaryrefslogtreecommitdiff
path: root/ports/sysdeps
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@tilera.com>2013-07-22 11:46:44 -0400
committerChris Metcalf <cmetcalf@tilera.com>2013-07-22 11:56:36 -0400
commit1fe2988f523ddbad93ca7abc98fea982f2ae0505 (patch)
tree283f35a8c794ad6438c0898a8a13ca6ebb1d7096 /ports/sysdeps
parenta8fc7a03a82959a69ca262c850be23a4932142ce (diff)
downloadglibc-1fe2988f523ddbad93ca7abc98fea982f2ae0505.tar
glibc-1fe2988f523ddbad93ca7abc98fea982f2ae0505.tar.gz
glibc-1fe2988f523ddbad93ca7abc98fea982f2ae0505.tar.bz2
glibc-1fe2988f523ddbad93ca7abc98fea982f2ae0505.zip
tile BZ #15759: Fix bug in _dl_unmap
We returned without calling __munmap if not in the simulator. Now we call a separate sim_dlclose() function to make the control flow work correctly.
Diffstat (limited to 'ports/sysdeps')
-rw-r--r--ports/sysdeps/tile/dl-runtime.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ports/sysdeps/tile/dl-runtime.c b/ports/sysdeps/tile/dl-runtime.c
index 84b5a5af5a..42f0ab3ac2 100644
--- a/ports/sysdeps/tile/dl-runtime.c
+++ b/ports/sysdeps/tile/dl-runtime.c
@@ -127,8 +127,8 @@ _dl_after_load (struct link_map *l)
}
/* Support notifying the simulator about removed objects prior to munmap(). */
-void internal_function
-_dl_unmap (struct link_map *l)
+static void
+sim_dlclose (ElfW(Addr) map_start)
{
int shift;
@@ -144,9 +144,15 @@ _dl_unmap (struct link_map *l)
DLPUTC ('0');
DLPUTC ('x');
for (shift = (int) sizeof (unsigned long) * 8 - 4; shift >= 0; shift -= 4)
- DLPUTC ("0123456789abcdef"[(l->l_map_start >> shift) & 0xF]);
+ DLPUTC ("0123456789abcdef"[(map_start >> shift) & 0xF]);
DLPUTC ('\0');
+
#undef DLPUTC
+}
+void internal_function
+_dl_unmap (struct link_map *l)
+{
+ sim_dlclose (l->l_map_start);
__munmap ((void *) l->l_map_start, l->l_map_end - l->l_map_start);
}