Commit 850844ef authored by Sergey Yanykin's avatar Sergey Yanykin Committed by Josh Bleecher Snyder

cmd/link/internal/ld: inline dosymtab

Updates #20205

Change-Id: I44a7ee46a1cdc7fe6fd36c4db4c0dd87a19f7f5d
Reviewed-on: https://go-review.googlesource.com/c/go/+/171733Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 431b5c69
......@@ -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)
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment