]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Move non-executable stack assembly code to end of file
authorRuss Allbery <rra@stanford.edu>
Mon, 22 Mar 2010 19:42:48 +0000 (12:42 -0700)
committerDerrick Brashear <shadow@dementia.org>
Mon, 22 Mar 2010 21:37:06 +0000 (14:37 -0700)
The non-executable stack annotation used for Linux works by adding
an additional section to the generated object.  The annotation added
in 9bfd03d723a9cf17673f40513a7adde1d503bcbc was added to the beginning
of each assembly file.  This caused build failures on Linux s390
because the remainder of the assembly code was then put in that
section, which was discarded during linking.

Add the annotation to the end of each assembly file instead, following
the instructions at:

    http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

Change-Id: I5bd2d8d0ac31932b59757dcec0a942c459d61cac
Reviewed-on: http://gerrit.openafs.org/1615
Tested-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/lwp/process.amd64.s
src/lwp/process.i386.s
src/lwp/process.s
src/lwp/process.s390.s
src/lwp/process.s390x.s
src/sys/syscall.s

index 1d59cd4dd81561e99dedbeaf2a5660a00e3248cc..c7e1f2a4da4a27cf9afba9bbf16d60f3cac3cf8a 100644 (file)
 
 #include <lwp_elf.h>
        
-#if defined(__linux__) && defined(__ELF__)
-       .section .note.GNU-stack,"",%progbits
-#endif
-
        .file "process.s"
        .data
        .text
@@ -163,3 +159,6 @@ ENTRY(returnto)
        pushq   $1234
        call    _C_LABEL(abort)
 
+#if defined(__linux__) && defined(__ELF__)
+       .section .note.GNU-stack,"",%progbits
+#endif
index f5b3bc4166d6e8a07590dc519efc87a2dbf3309b..15173aac4f0df59d35ab0cfaff4ccf6ce0185ae8 100644 (file)
@@ -17,9 +17,6 @@
  */
 
 #include <lwp_elf.h>
-#if defined(__linux__) && defined(__ELF__)
-       .section .note.GNU-stack,"",%progbits
-#endif
 
        .file "process.s"
 
@@ -82,3 +79,6 @@ ENTRY(returnto)
        popl    %ebp
        ret
 
+#if defined(__linux__) && defined(__ELF__)
+       .section .note.GNU-stack,"",%progbits
+#endif
index 4f81456b16bdabb4c1e85ba00474bb2ded4b21ca..5d26c8779b67b4739c654f820dd57593fd6ca98f 100644 (file)
 #define        IGNORE_STDS_H   1
 #include <afs/param.h>
 
-#if defined(__linux__) && defined(__ELF__)
-       .section .note.GNU-stack,"",%progbits
-#endif
-
 #if defined(__arm32__) || defined(__arm__)
        /* register definitions */
        fp      .req    r11
@@ -1291,3 +1287,6 @@ returnto:
       blr
 #endif
        
+#if defined(__linux__) && defined(__ELF__)
+       .section .note.GNU-stack,"",%progbits
+#endif
index 585404fddff9e7ec61039cbeb0ada286a633d856..bda4522d974a046cb2e7205e0b68955eebd535a2 100644 (file)
 #define        IGNORE_STDS_H   1
 #include <afs/param.h>
 
-#if defined(__linux__) && defined(__ELF__)
-        .section .note.GNU-stack,"",%progbits
-#endif
-
        .file   "process.s"
 
               .globl savecontext
@@ -100,3 +96,6 @@ returnto:
       .returnto_end:
               .size   returnto,.returnto_end-returnto
 
+#if defined(__linux__) && defined(__ELF__)
+        .section .note.GNU-stack,"",%progbits
+#endif
index f3087bfcf7b66c52cde76bf7cdfd30f99986f0bb..f24afdce0cf0ddcb6d86d35c58925c3225d7fab4 100644 (file)
 #define IGNORE_STDS_H  1
 #include <afs/param.h>
 
-#if defined(__linux__) && defined(__ELF__)
-        .section .note.GNU-stack,"",%progbits
-#endif
-
        .file   "process.s"
 
               .globl savecontext
@@ -100,3 +96,6 @@ returnto:
       .returnto_end:
               .size   returnto,.returnto_end-returnto
 
+#if defined(__linux__) && defined(__ELF__)
+        .section .note.GNU-stack,"",%progbits
+#endif
index c42d5780f4c17dcdee833ba1857f686ab668699d..f14651f3d7c23cb449d7b6f142325f514e5731ab 100644 (file)
 #define        IGNORE_STDS_H
 #include <afs/param.h>
 
-#if defined(__linux__) && defined(__ELF__)
-       .section .note.GNU-stack,"",%progbits
-#endif
-
 #if defined(AFS_AIX32_ENV) && defined(RIOS)
        /*
         * This is never be referenced, and is only here as placeholder;
@@ -66,3 +62,6 @@ LEAF(afs_syscall)
 #endif /* AFS_SGI_ENV */
 #endif
 
+#if defined(__linux__) && defined(__ELF__)
+       .section .note.GNU-stack,"",%progbits
+#endif