[llvm] r370408 - Allow '@' to appear in x86 mingw symbols

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 29 14:15:02 PDT 2019


Author: rnk
Date: Thu Aug 29 14:15:02 2019
New Revision: 370408

URL: http://llvm.org/viewvc/llvm-project?rev=370408&view=rev
Log:
Allow '@' to appear in x86 mingw symbols

Summary:
There is no reason to differ in assembler behavior here between -msvc
and -gnu targets. Without this setting, the text after the '@' is
interpreted as a symbol variable, like foo at IMGREL.

Reviewers: mstorsjo

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66974

Added:
    llvm/trunk/test/MC/X86/stdcall.s
Modified:
    llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp

Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp?rev=370408&r1=370407&r2=370408&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp Thu Aug 29 14:15:02 2019
@@ -163,5 +163,7 @@ X86MCAsmInfoGNUCOFF::X86MCAsmInfoGNUCOFF
 
   TextAlignFillValue = 0x90;
 
+  AllowAtInName = true;
+
   UseIntegratedAssembler = true;
 }

Added: llvm/trunk/test/MC/X86/stdcall.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/X86/stdcall.s?rev=370408&view=auto
==============================================================================
--- llvm/trunk/test/MC/X86/stdcall.s (added)
+++ llvm/trunk/test/MC/X86/stdcall.s Thu Aug 29 14:15:02 2019
@@ -0,0 +1,19 @@
+# RUN: llvm-mc %s -filetype=obj -o - -triple i686-windows-msvc | llvm-nm - | FileCheck %s
+# RUN: llvm-mc %s -filetype=obj -o - -triple i686-windows-gnu | llvm-nm - | FileCheck %s
+
+# CHECK: T _mystdcall at 8{{$}}
+# CHECK: T foo
+
+.text
+.global _mystdcall at 8
+_mystdcall at 8:
+	movl 4(%esp), %eax
+	addl 8(%esp), %eax
+	retl $8
+
+.global foo
+foo:
+	pushl $1
+	pushl $2
+	calll _mystdcall at 8
+	retl




More information about the llvm-commits mailing list