Files
glibc/tls-dtor-list-mangling.patch
Dominique Leuenberger d5afe5554a Accepting request 360165 from Base:System
- isinf-cxx11-conflict.patch: Fix isinf/isnan declaration conflict with
  C++11 (bsc#963700, BZ #19439) (forwarded request 360162 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/360165
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=199
2016-02-22 09:09:52 +00:00

38 lines
1.2 KiB
Diff

2015-10-06 Florian Weimer <fweimer@redhat.com>
[BZ #19018]
* stdlib/cxa_thread_atexit_impl.c (__cxa_thread_atexit_impl):
Mangle function pointer before storing it.
(__call_tls_dtors): Demangle function pointer before calling it.
Index: glibc-2.22/stdlib/cxa_thread_atexit_impl.c
===================================================================
--- glibc-2.22.orig/stdlib/cxa_thread_atexit_impl.c
+++ glibc-2.22/stdlib/cxa_thread_atexit_impl.c
@@ -98,6 +98,10 @@ static __thread struct link_map *lm_cach
int
__cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
{
+#ifdef PTR_MANGLE
+ PTR_MANGLE (func);
+#endif
+
/* Prepend. */
struct dtor_list *new = calloc (1, sizeof (struct dtor_list));
new->func = func;
@@ -142,9 +146,13 @@ __call_tls_dtors (void)
while (tls_dtor_list)
{
struct dtor_list *cur = tls_dtor_list;
+ dtor_func func = cur->func;
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (func);
+#endif
tls_dtor_list = tls_dtor_list->next;
- cur->func (cur->obj);
+ func (cur->obj);
/* Ensure that the MAP dereference happens before
l_tls_dtor_count decrement. That way, we protect this access from a