]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal/ld: inline dosymtab
authorSergey Yanykin <syanykin@ozon.ru>
Sat, 13 Apr 2019 13:46:23 +0000 (16:46 +0300)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 16 Apr 2019 22:39:09 +0000 (22:39 +0000)
Updates #20205

Change-Id: I44a7ee46a1cdc7fe6fd36c4db4c0dd87a19f7f5d
Reviewed-on: https://go-review.googlesource.com/c/go/+/171733
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/symtab.go

index e421caabcea51d797aa7cad70d724a31036855f5..b869eea2786aceb9256d0c3f75bc9b84669a0994 100644 (file)
@@ -990,19 +990,6 @@ func addinitarrdata(ctxt *Link, s *sym.Symbol) {
        sp.AddAddr(ctxt.Arch, s)
 }
 
-func dosymtype(ctxt *Link) {
-       switch ctxt.BuildMode {
-       case BuildModeCArchive, BuildModeCShared:
-               for _, s := range ctxt.Syms.Allsym {
-                       // Create a new entry in the .init_array section that points to the
-                       // library initializer function.
-                       if s.Name == *flagEntrySymbol && ctxt.HeadType != objabi.Haix {
-                               addinitarrdata(ctxt, s)
-                       }
-               }
-       }
-}
-
 // symalign returns the required alignment for the given symbol s.
 func symalign(s *sym.Symbol) int32 {
        min := int32(thearch.Minalign)
index 3add7197b856654d34f49fe7b5f932d1e4754e2b..d686a8a476862f963fb33e57264034f8fdcd1377 100644 (file)
@@ -326,7 +326,16 @@ func textsectionmap(ctxt *Link) uint32 {
 }
 
 func (ctxt *Link) symtab() {
-       dosymtype(ctxt)
+       switch ctxt.BuildMode {
+       case BuildModeCArchive, BuildModeCShared:
+               for _, s := range ctxt.Syms.Allsym {
+                       // Create a new entry in the .init_array section that points to the
+                       // library initializer function.
+                       if s.Name == *flagEntrySymbol && ctxt.HeadType != objabi.Haix {
+                               addinitarrdata(ctxt, s)
+                       }
+               }
+       }
 
        // Define these so that they'll get put into the symbol table.
        // data.c:/^address will provide the actual values.