diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2018-04-19 15:24:53 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2018-04-19 08:24:53 -0700 |
commit | 2130a2afe7e45001936bb55b8ba1340c54953bbd (patch) | |
tree | a61f01c14df45fb3a0760abacb653112c645df89 /gcc | |
parent | 5f9ca0b8bfdce679dea03b6ac402c28d5ecfd5c2 (diff) | |
download | gcc-2130a2afe7e45001936bb55b8ba1340c54953bbd.zip gcc-2130a2afe7e45001936bb55b8ba1340c54953bbd.tar.gz gcc-2130a2afe7e45001936bb55b8ba1340c54953bbd.tar.bz2 |
x86/cet: Properly output labels in property note section
Replace ASM_OUTPUT_LABEL with fprintf so that internal labels in property
note section are unchanged by -fleading-underscore.
gcc/
PR target/85404
* config/i386/cet.c (file_end_indicate_exec_stack_and_cet):
Replace ASM_OUTPUT_LABEL with fprintf.
gcc/testsuite/
PR target/85404
* gcc.target/i386/pr85404.c: New test.
From-SVN: r259498
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/cet.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr85404.c | 6 |
4 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 89c6c91..89a4f3f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2018-04-19 H.J. Lu <hongjiu.lu@intel.com> + PR target/85404 + * config/i386/cet.c (file_end_indicate_exec_stack_and_cet): + Replace ASM_OUTPUT_LABEL with fprintf. + +2018-04-19 H.J. Lu <hongjiu.lu@intel.com> + PR target/85417 * config/i386/cet.c (file_end_indicate_exec_stack_and_cet): Check flag_cf_protection instead of TARGET_IBT and TARGET_SHSTK. diff --git a/gcc/config/i386/cet.c b/gcc/config/i386/cet.c index eb3be17..9dd90f0 100644 --- a/gcc/config/i386/cet.c +++ b/gcc/config/i386/cet.c @@ -57,20 +57,20 @@ file_end_indicate_exec_stack_and_cet (void) fprintf (asm_out_file, ASM_LONG " 4f - 1f\n"); /* note type: NT_GNU_PROPERTY_TYPE_0. */ fprintf (asm_out_file, ASM_LONG " 5\n"); - ASM_OUTPUT_LABEL (asm_out_file, "0"); + fprintf (asm_out_file, "0:\n"); /* vendor name: "GNU". */ fprintf (asm_out_file, STRING_ASM_OP " \"GNU\"\n"); - ASM_OUTPUT_LABEL (asm_out_file, "1"); + fprintf (asm_out_file, "1:\n"); ASM_OUTPUT_ALIGN (asm_out_file, p2align); /* pr_type: GNU_PROPERTY_X86_FEATURE_1_AND. */ fprintf (asm_out_file, ASM_LONG " 0xc0000002\n"); /* pr_datasz. */\ fprintf (asm_out_file, ASM_LONG " 3f - 2f\n"); - ASM_OUTPUT_LABEL (asm_out_file, "2"); + fprintf (asm_out_file, "2:\n"); /* GNU_PROPERTY_X86_FEATURE_1_XXX. */ fprintf (asm_out_file, ASM_LONG " 0x%x\n", feature_1); - ASM_OUTPUT_LABEL (asm_out_file, "3"); + fprintf (asm_out_file, "3:\n"); ASM_OUTPUT_ALIGN (asm_out_file, p2align); - ASM_OUTPUT_LABEL (asm_out_file, "4"); + fprintf (asm_out_file, "4:\n"); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 884e772..d09c567 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-04-19 H.J. Lu <hongjiu.lu@intel.com> + PR target/85404 + * gcc.target/i386/pr85404.c: New test. + +2018-04-19 H.J. Lu <hongjiu.lu@intel.com> + PR target/85417 * c-c++-common/attr-nocf-check-1.c: Compile with -fcf-protection=none. diff --git a/gcc/testsuite/gcc.target/i386/pr85404.c b/gcc/testsuite/gcc.target/i386/pr85404.c new file mode 100644 index 0000000..bbf456e --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr85404.c @@ -0,0 +1,6 @@ +/* { dg-do assemble } */ +/* { dg-options "-fleading-underscore -mcet -fcf-protection" } */ + +void func(void) __asm("_func"); +void _func(int x) {} +void func(void) {} |