]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: remove pensect
authorAlex Brainman <alex.brainman@gmail.com>
Mon, 5 Jun 2017 05:53:08 +0000 (15:53 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Mon, 21 Aug 2017 02:08:01 +0000 (02:08 +0000)
Change-Id: Ia4abb76a8fa9e9ab280cd9162238ebd3fba79e4d
Reviewed-on: https://go-review.googlesource.com/56318
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/link/internal/ld/pe.go

index 9a632f74b619d9ea6b3d76adea0554120944a692..c7788d84af9f37e92738b46c81308cfd639a9c7b 100644 (file)
@@ -322,8 +322,6 @@ var PEFILEHEADR int32
 
 var pe64 int
 
-var pensect int
-
 var nextsectoff int
 
 var nextfileoff int
@@ -471,7 +469,6 @@ func (f *peFile) addSection(name string, sectsize int, filesize int) *peSection
                nextfileoff += int(sect.SizeOfRawData)
        }
        f.sections = append(f.sections, sect)
-       pensect++
        return sect
 }
 
@@ -1269,7 +1266,7 @@ func Asmbpe(ctxt *Link) {
                peemitreloc(ctxt, t, d, c)
        }
 
-       fh.NumberOfSections = uint16(pensect)
+       fh.NumberOfSections = uint16(len(pefile.sections))
 
        // Being able to produce identical output for identical input is
        // much more beneficial than having build timestamp in the header.