Set child stack alignment in trace-clone.c
authorPetr Machata <pmachata@apm-mustang-ev2-02.ml3.eng.bos.redhat.com>
Wed, 5 Feb 2014 00:57:50 +0000 (19:57 -0500)
committerChanho Park <chanho61.park@samsung.com>
Fri, 22 Aug 2014 11:38:24 +0000 (20:38 +0900)
- This is important on aarch64, which requires 16-byte aligned
  stack pointer.  This might be relevant on other arches as well,
  I suspect we just happened to get the 16-byte boundary in some
  cases.

testsuite/ltrace.minor/trace-clone.c

index db1936d..ded930c 100644 (file)
@@ -8,6 +8,7 @@
 #include <sys/types.h>
 #include <stdlib.h>
 #include <sched.h>
+#include <unistd.h>
 
 int child ()
 {
@@ -22,7 +23,8 @@ typedef int (* myfunc)();
 int main ()
 {
   pid_t pid;
-  static char stack[STACK_SIZE];
+  static __attribute__ ((aligned (16))) char stack[STACK_SIZE];
+
 #ifdef __ia64__
   pid = __clone2((myfunc)&child, stack, STACK_SIZE, CLONE_FS, NULL);
 #else