[PATCH] x86/cet: Properly output labels in property note section
H.J. Lu
hjl.tools@gmail.com
Thu Apr 19 19:12:00 GMT 2018
On Thu, Apr 19, 2018 at 11:56 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> "H.J. Lu" <hongjiu.lu@intel.com> writes:
>
>> Replace ASM_OUTPUT_LABEL with fprintf so that internal labels in property
>> note section are unchanged -fleading-underscore.
>>
>> OK for trunk?
>>
>> H.J.
>> ---
>> 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.
>
> The testcase FAILs on Solaris/x86 with /bin/as:
>
> FAIL: gcc.target/i386/pr85404.c (test for excess errors)
>
> Excess errors:
> Assembler: pr85404.c
> "/var/tmp//cc_MI..a.s", line 6 : Illegal mnemonic
> Near line: " endbr32"
> "/var/tmp//cc_MI..a.s", line 6 : Syntax error
> Near line: " endbr32"
> "/var/tmp//cc_MI..a.s", line 13 : Illegal mnemonic
> Near line: " endbr32"
> "/var/tmp//cc_MI..a.s", line 13 : Syntax error
> Near line: " endbr32"
>
> There are also FAILs on gcc-testresults for i686-pc-linux-gnu,
> x86_64-unknown-linux-gnu, and i586-unknown-freebsd10.4 (probably older
> versions of gas).
>
> It either needs a dg-require-effective-target cet or be demoted to a
> compile test, depending on intent.
>
I am checking in this.
--
H.J.
diff --git a/gcc/testsuite/gcc.target/i386/pr85404.c
b/gcc/testsuite/gcc.target/i386/pr85404.c
index bbf456ec024..0194f7b7edd 100644
--- a/gcc/testsuite/gcc.target/i386/pr85404.c
+++ b/gcc/testsuite/gcc.target/i386/pr85404.c
@@ -1,4 +1,4 @@
-/* { dg-do assemble } */
+/* { dg-do assemble { target cet } } */
/* { dg-options "-fleading-underscore -mcet -fcf-protection" } */
void func(void) __asm("_func");
More information about the Gcc-patches
mailing list