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.
This commit is contained in:
kai
2012-07-14 18:25:27 +02:00
parent f7e5245e03
commit fcd3ac6a11

View File

@@ -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;