about summary refs log tree commit diff
path: root/elf/dl-close.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-close.c')
-rw-r--r--elf/dl-close.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index ad84f94338..566e345165 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -95,8 +95,11 @@ _dl_close (struct link_map *map)
 	      do
 		--tail;
 	      while (*tail != imap);
-	      memcpy (tail, tail + 1,
-		      (char *) _dl_global_scope_end - (char *) tail);
+	      while (tail <= _dl_global_scope_end)
+		{
+		  tail[0] = tail[1];
+		  ++tail;
+		}
 	      --_dl_global_scope_end;
 	    }