[debug-ltrace] Add latest version.
Add ltrace 0.5.2, propagate patchset from 0.5.1 and from Debian.
1 Original patch from: gentoo/src/patchsets/glibc/2.9/3000_all_2.3.6-dl_execstack-PaX-support.patch
3 -= BEGIN original header =-
4 With latest versions of glibc, a lot of apps failed on a PaX enabled
6 cannot enable executable stack as shared object requires: Permission denied
8 This is due to PaX 'exec-protecting' the stack, and ld.so then trying
9 to make the stack executable due to some libraries not containing the
10 PT_GNU_STACK section. Bug #32960. <azarah@gentoo.org> (12 Nov 2003).
12 Patch also NPTL. Bug #116086. <kevquinn@gentoo.org> (20 Dec 2005).
14 -= END original header =-
16 diff -durN glibc-2_9.orig/nptl/allocatestack.c glibc-2_9/nptl/allocatestack.c
17 --- glibc-2_9.orig/nptl/allocatestack.c 2008-08-16 00:35:27.000000000 +0200
18 +++ glibc-2_9/nptl/allocatestack.c 2009-02-02 22:01:20.000000000 +0100
20 # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
22 if (mprotect (stack, len, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
24 + if (errno != EACCES) /* PAX is enabled */
29 diff -durN glibc-2_9.orig/sysdeps/unix/sysv/linux/dl-execstack.c glibc-2_9/sysdeps/unix/sysv/linux/dl-execstack.c
30 --- glibc-2_9.orig/sysdeps/unix/sysv/linux/dl-execstack.c 2006-01-08 09:21:15.000000000 +0100
31 +++ glibc-2_9/sysdeps/unix/sysv/linux/dl-execstack.c 2009-02-02 22:01:20.000000000 +0100
37 + if (errno == EACCES) /* PAX is enabled */
48 - if (errno != ENOMEM) /* Unexpected failure mode. */
49 + if (errno == EACCES) /* PAX is enabled */
54 + else if (errno != ENOMEM) /* Unexpected failure mode. */
62 - if (errno != ENOMEM) /* Unexpected failure mode. */
63 + if (errno == EACCES) /* PAX is enabled */
68 + else if (errno != ENOMEM) /* Unexpected failure mode. */