1
0
mirror of https://github.com/golang/go synced 2024-11-17 16:14:42 -07:00

cmd/link/internal/ld: inline dosymtab

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>
This commit is contained in:
Sergey Yanykin 2019-04-13 16:46:23 +03:00 committed by Josh Bleecher Snyder
parent 431b5c69ca
commit 850844ef65
2 changed files with 10 additions and 14 deletions

View 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)

View 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.