Comment 2 for bug 49192

Revision history for this message
John Moser (nigelenki) wrote :

The patching fix is as follows:

Append the following four lines:

/* Add these three lines to get us a PT_GNU_STACK header */
#ifdef __ELF__
.section .note.GNU-stack,"",%progbits
#endif

To all *.S source files. Use the below script:

e="/* Add these three lines to get us a PT_GNU_STACK header */
#ifdef __ELF__
.section .note.GNU-stack,\"\",%progbits
#endif"
for i in `find . -name \*.S`; do echo "$e" >> "$i"; done

Submit resulting changes upstream when finished and well tested, cite Ubuntu mainline as example.

Test data used:

bluefox@icebox:/tmp/x/libgcrypt11-1.2.2$ scanelf -qeRt .
RWX --- --- ./debian/tmp/usr/lib/libgcrypt.so.11.2.1
RWX --- --- ./debian/libgcrypt11/usr/lib/libgcrypt.so.11.2.1
RWX --- --- ./debian/libgcrypt11-dbg/usr/lib/debug/usr/lib/libgcrypt.so.11.2.1
!WX --- --- ./mpi/mpih-rshift.o
!WX --- --- ./mpi/mpih-lshift.o
!WX --- --- ./mpi/mpih-mul3.o
!WX --- --- ./mpi/mpih-mul2.o
!WX --- --- ./mpi/mpih-mul1.o
!WX --- --- ./mpi/mpih-sub1.o
!WX --- --- ./mpi/mpih-add1.o

Result after fix:
bluefox@icebox:/tmp/x/libgcrypt11-1.2.2$ scanelf -qeRt . bluefox@icebox:/tmp/x/libgcrypt11-1.2.2$