OSDN Git Service

Bring over accumulated bug fixes from mainline.
[pf3gnuchains/gcc-fork.git] / gcc / go / gofrontend / gogo.cc
index 80ffe24..6e9b8c1 100644 (file)
@@ -339,9 +339,14 @@ Gogo::set_package_name(const std::string& package_name,
   // symbol names.
   if (!this->pkgpath_set_)
     {
-      if (!this->prefix_from_option_)
-       this->prefix_ = "go";
-      this->pkgpath_ = this->prefix_ + '.' + package_name;
+      if (!this->prefix_from_option_ && package_name == "main")
+       this->pkgpath_ = package_name;
+      else
+       {
+         if (!this->prefix_from_option_)
+           this->prefix_ = "go";
+         this->pkgpath_ = this->prefix_ + '.' + package_name;
+       }
       this->pkgpath_set_ = true;
     }