diff gen/naked.cpp @ 1190:ea7b8b6c96c0

Some more fixups for mingw -- missing underscores
author Kelly Wilson <wilsonk cpsc.ucalgary.ca>
date Thu, 02 Apr 2009 17:27:53 -0600
parents 5e8f7ad442ba
children 15e9762bb620
line wrap: on
line diff
--- a/gen/naked.cpp	Thu Apr 02 20:56:39 2009 +0200
+++ b/gen/naked.cpp	Thu Apr 02 17:27:53 2009 -0600
@@ -144,7 +144,14 @@
         if (DtoIsTemplateInstance(fd))
         {
             linkage = "weak";
-            tmpstr << "section\t.gnu.linkonce.t." << mangle << ",\"ax\",@progbits";
+            tmpstr << "section\t.gnu.linkonce.t.";
+            if (global.params.os != OSWindows)
+            {
+                tmpstr << mangle << ",\"ax\",@progbits";
+            } else
+            {
+                tmpstr << "_" << mangle << ",\"ax\"";
+            }
             section = tmpstr.str();
         }
         asmstr << "\t." << section << std::endl;
@@ -154,10 +161,11 @@
         {
             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;