From fcd3ac6a11737175b798fd02a71122223ff94958 Mon Sep 17 00:00:00 2001 From: kai Date: Sat, 14 Jul 2012 18:25:27 +0200 Subject: [PATCH] Do not add a second underscore to naked functions on Windows. This leads to missing symbols during linking on Windows x64. If this changes breaks other Windows platforms then we have to analyze the triple instead of global.params.os. --- gen/naked.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gen/naked.cpp b/gen/naked.cpp index c36786d3..992d1e8d 100644 --- a/gen/naked.cpp +++ b/gen/naked.cpp @@ -162,11 +162,10 @@ void DtoDefineNakedFunction(FuncDeclaration* fd) { std::string def = "def"; std::string endef = "endef"; - asmstr << "\t." << def << "\t_" << mangle << ";"; + asmstr << "\t." << def << "\t" << mangle << ";"; // hard code these two numbers for now since gas ignores .scl and llvm // is defaulting to .type 32 for everything I have seen asmstr << "\t.scl 2; .type 32;\t" << "." << endef << std::endl; - asmstr << "_"; } else { asmstr << "\t." << linkage << "\t" << mangle << std::endl;