@@ -99,6 +99,7 @@ type Arch struct {
99
99
Elfsetupplt func ()
100
100
Gentext func ()
101
101
Machoreloc1 func (* Reloc , int64 ) int
102
+ PEreloc1 func (* Reloc , int64 ) bool
102
103
Lput func (uint32 )
103
104
Wput func (uint16 )
104
105
Vput func (uint64 )
@@ -744,6 +745,13 @@ func hostlink() {
744
745
if HEADTYPE == Hopenbsd {
745
746
argv = append (argv , "-Wl,-nopie" )
746
747
}
748
+ if HEADTYPE == Hwindows {
749
+ if headstring == "windowsgui" {
750
+ argv = append (argv , "-mwindows" )
751
+ } else {
752
+ argv = append (argv , "-mconsole" )
753
+ }
754
+ }
747
755
748
756
if Iself && AssumeGoldLinker != 0 /*TypeKind(100016)*/ {
749
757
argv = append (argv , "-Wl,--rosegment" )
@@ -844,6 +852,9 @@ func hostlink() {
844
852
}
845
853
}
846
854
}
855
+ if HEADTYPE == Hwindows {
856
+ argv = append (argv , peimporteddlls ()... )
857
+ }
847
858
848
859
if Debug ['v' ] != 0 {
849
860
fmt .Fprintf (& Bso , "host link:" )
@@ -1379,6 +1390,13 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
1379
1390
case SFILE :
1380
1391
put (nil , s .Name , 'f' , s .Value , 0 , int (s .Version ), nil )
1381
1392
continue
1393
+
1394
+ case SHOSTOBJ :
1395
+ if HEADTYPE == Hwindows {
1396
+ put (s , s .Name , 'U' , s .Value , 0 , int (s .Version ), nil )
1397
+ }
1398
+ continue
1399
+
1382
1400
}
1383
1401
}
1384
1402
0 commit comments