summaryrefslogtreecommitdiff
path: root/packages/glibc/2.21/950-dlclose-assert.patch
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-05-27 07:01:49 (GMT)
committerAlexey Neyman <stilor@att.net>2017-07-08 17:57:56 (GMT)
commit57426168ad2c7e8367786ed466c86f6aeb49b3c3 (patch)
tree61510389772124cc07aff4ab8b53f4fc6ed9a460 /packages/glibc/2.21/950-dlclose-assert.patch
parente7deac3aad394325f9e6fc6fda41d34ec94a59e0 (diff)
Convert the rest of packages to new framework
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'packages/glibc/2.21/950-dlclose-assert.patch')
-rw-r--r--packages/glibc/2.21/950-dlclose-assert.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/packages/glibc/2.21/950-dlclose-assert.patch b/packages/glibc/2.21/950-dlclose-assert.patch
new file mode 100644
index 0000000..6e2fcff
--- /dev/null
+++ b/packages/glibc/2.21/950-dlclose-assert.patch
@@ -0,0 +1,40 @@
+commit 2bd2cad9e8a410643e80efa0b15f6f2882e1271b
+Author: Roland McGrath <roland@hack.frob.com>
+Date: Fri Apr 17 14:29:40 2015 -0700
+
+ Avoid confusing compiler with dynamically impossible statically invalid dereference in _dl_close_worker.
+
+diff --git a/elf/dl-close.c b/elf/dl-close.c
+index cf8f9e0465..412f71d70b 100644
+--- a/elf/dl-close.c
++++ b/elf/dl-close.c
+@@ -641,9 +641,16 @@ _dl_close_worker (struct link_map *map)
+ DL_UNMAP (imap);
+
+ /* Finally, unlink the data structure and free it. */
+- if (imap->l_prev != NULL)
+- imap->l_prev->l_next = imap->l_next;
+- else
++#if DL_NNS == 1
++ /* The assert in the (imap->l_prev == NULL) case gives
++ the compiler license to warn that NS points outside
++ the dl_ns array bounds in that case (as nsid != LM_ID_BASE
++ is tantamount to nsid >= DL_NNS). That should be impossible
++ in this configuration, so just assert about it instead. */
++ assert (nsid == LM_ID_BASE);
++ assert (imap->l_prev != NULL);
++#else
++ if (imap->l_prev == NULL)
+ {
+ assert (nsid != LM_ID_BASE);
+ ns->_ns_loaded = imap->l_next;
+@@ -652,6 +659,9 @@ _dl_close_worker (struct link_map *map)
+ we leave for debuggers to examine. */
+ r->r_map = (void *) ns->_ns_loaded;
+ }
++ else
++#endif
++ imap->l_prev->l_next = imap->l_next;
+
+ --ns->_ns_nloaded;
+ if (imap->l_next != NULL)