]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
x86: Add .note.GNU-stack section only for Linux
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 6 May 2022 17:55:53 +0000 (10:55 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 10 May 2022 16:41:51 +0000 (09:41 -0700)
Add .note.GNU-stack section only for Linux since it may not be supported
on non-Linux OSes.  __ELF__ isn't checked since these tests can only run
on Linux/x86 ELF systems.

PR target/105472
* gcc.target/i386/iamcu/asm-support.S: Add .note.GNU-stack section
only for Linux.
* gcc.target/x86_64/abi/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512f/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S: Likewise.
* gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S: Likewise.
* gcc.target/x86_64/abi/ms-sysv/do-test.S: Likewise.

gcc/testsuite/gcc.target/i386/iamcu/asm-support.S
gcc/testsuite/gcc.target/x86_64/abi/asm-support.S
gcc/testsuite/gcc.target/x86_64/abi/avx/asm-support.S
gcc/testsuite/gcc.target/x86_64/abi/avx512f/asm-support.S
gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/asm-support.S
gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m256h/asm-support.S
gcc/testsuite/gcc.target/x86_64/abi/avx512fp16/m512h/asm-support.S
gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/do-test.S

index db08f52a34f72d5c03cb97009d884bcb4f6a7c5d..9d6be88e7d526efd398be11233612bfe98e488da 100644 (file)
@@ -300,4 +300,6 @@ iamcu_noprintf:
        .align 4
 .LCiamcu_noprintf1:
        .long   1132527616
+#ifdef __linux__
        .section        .note.GNU-stack,"",@progbits
+#endif
index 2f8d3a09c6b27221c1311658f0c511eee0c1d4a7..b2ad67aef8748a3add8abecf0840c1d695765fc8 100644 (file)
@@ -82,4 +82,6 @@ snapshot_ret:
        .comm   xmm_regs,256,32
        .comm   x87_regs,128,32
        .comm   volatile_var,8,8
+#ifdef __linux__
        .section        .note.GNU-stack,"",@progbits
+#endif
index 77b3480ac32773176894acd535e3bada2c8c7e21..24c8b3c9023672d2815254e6ebd3e6ab91e22772 100644 (file)
@@ -79,4 +79,6 @@ snapshot_ret:
        .comm   ymm_regs,512,32
        .comm   x87_regs,128,32
        .comm   volatile_var,8,8
+#ifdef __linux__
        .section        .note.GNU-stack,"",@progbits
+#endif
index 2e3306c44cb52913ca41ba2099bfd6efa5e46498..86d54d11c58e738169a1b93941b40064bf1e7a8a 100644 (file)
@@ -95,4 +95,6 @@ snapshot_ret:
        .comm   zmm_regs,2048,64
        .comm   x87_regs,128,32
        .comm   volatile_var,8,8
+#ifdef __linux__
        .section        .note.GNU-stack,"",@progbits
+#endif
index 0793acf048b67400e21ac75820627ee4fbefe59d..a8165d86317c8574c7d8b2759bc6be07ba67cb85 100644 (file)
@@ -79,4 +79,6 @@ snapshot_ret:
        .comm   xmm_regs,256,32
        .comm   x87_regs,128,32
        .comm   volatile_var,8,8
+#ifdef __linux__
        .section        .note.GNU-stack,"",@progbits
+#endif
index 77b3480ac32773176894acd535e3bada2c8c7e21..24c8b3c9023672d2815254e6ebd3e6ab91e22772 100644 (file)
@@ -79,4 +79,6 @@ snapshot_ret:
        .comm   ymm_regs,512,32
        .comm   x87_regs,128,32
        .comm   volatile_var,8,8
+#ifdef __linux__
        .section        .note.GNU-stack,"",@progbits
+#endif
index 2e3306c44cb52913ca41ba2099bfd6efa5e46498..86d54d11c58e738169a1b93941b40064bf1e7a8a 100644 (file)
@@ -95,4 +95,6 @@ snapshot_ret:
        .comm   zmm_regs,2048,64
        .comm   x87_regs,128,32
        .comm   volatile_var,8,8
+#ifdef __linux__
        .section        .note.GNU-stack,"",@progbits
+#endif
index f5dff4c10abadb09f0af06ae211b186461c47032..37338b23fec709e7be1475ade1c335f99daf2773 100644 (file)
@@ -30,7 +30,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #ifdef __ELF__
 # define FN_TYPE(fn) .type fn,@function
 # define FN_SIZE(fn) .size fn,.-fn
+# ifdef __linux__
        .section        .note.GNU-stack,"",@progbits
+# endif
 #else
 # define FN_TYPE(fn)
 # define FN_SIZE(fn)