aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--nptl/pthread_attr_getstack.c4
-rw-r--r--nptl/pthread_attr_setstack.c8
3 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a9cff1d..2837093 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-03-13 Carlos O'Donell <carlos@redhat.com>
+
+ * nptl/pthread_attr_setstack.c (__pthread_attr_setstack)
+ [!_STACK_GROWS_DOWN]: Don't add stacksize to stackaddr.
+ (__old_pthread_attr_setstack): Likewise.
+ * nptl/pthread_attr_getstack.c (__pthread_attr_getstack)
+ [!_STACK_GROWS_DOWN]: Likewise.
+
2014-03-13 Mike Frysinger <vapier@gentoo.org>
* config.make.in (have-bash2): Delete.
@@ -86,7 +94,7 @@
[BZ #16381]
* elf/Makefile (tests): Add tst-pie2.
- (tests-pie): Add tst-pie2.
+ (tests-pie): Add tst-pie2.
* elf/tst-pie2.c: New file.
* elf/dl-load.c (_dl_map_object_from_fd): Assert correct l_type
for ET_EXEC.
diff --git a/nptl/pthread_attr_getstack.c b/nptl/pthread_attr_getstack.c
index 3f4fd8d..0e245a0 100644
--- a/nptl/pthread_attr_getstack.c
+++ b/nptl/pthread_attr_getstack.c
@@ -32,7 +32,11 @@ __pthread_attr_getstack (attr, stackaddr, stacksize)
iattr = (struct pthread_attr *) attr;
/* Store the result. */
+#if _STACK_GROWS_DOWN
*stackaddr = (char *) iattr->stackaddr - iattr->stacksize;
+#else
+ *stackaddr = (char *) iattr->stackaddr;
+#endif
*stacksize = iattr->stacksize;
return 0;
diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c
index 19a5b54..4785501 100644
--- a/nptl/pthread_attr_setstack.c
+++ b/nptl/pthread_attr_setstack.c
@@ -48,7 +48,11 @@ __pthread_attr_setstack (attr, stackaddr, stacksize)
#endif
iattr->stacksize = stacksize;
+#if _STACK_GROWS_DOWN
iattr->stackaddr = (char *) stackaddr + stacksize;
+#else
+ iattr->stackaddr = (char *) stackaddr;
+#endif
iattr->flags |= ATTR_FLAG_STACKADDR;
return 0;
@@ -81,7 +85,11 @@ __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr,
# endif
iattr->stacksize = stacksize;
+#if _STACK_GROWS_DOWN
iattr->stackaddr = (char *) stackaddr + stacksize;
+#else
+ iattr->stackaddr = (char *) stackaddr;
+#endif
iattr->flags |= ATTR_FLAG_STACKADDR;
return 0;