mirror of https://github.com/golang/go.git
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:
parent
431b5c69ca
commit
850844ef65
|
|
@ -990,19 +990,6 @@ func addinitarrdata(ctxt *Link, s *sym.Symbol) {
|
||||||
sp.AddAddr(ctxt.Arch, s)
|
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.
|
// symalign returns the required alignment for the given symbol s.
|
||||||
func symalign(s *sym.Symbol) int32 {
|
func symalign(s *sym.Symbol) int32 {
|
||||||
min := int32(thearch.Minalign)
|
min := int32(thearch.Minalign)
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,16 @@ func textsectionmap(ctxt *Link) uint32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctxt *Link) symtab() {
|
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.
|
// Define these so that they'll get put into the symbol table.
|
||||||
// data.c:/^address will provide the actual values.
|
// data.c:/^address will provide the actual values.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue