mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: do not directly embed Symbols in Link
Mostly done with sed. Change-Id: Ic8c534a3fdd332b5420d062ee85bb77a30ad1efb Reviewed-on: https://go-review.googlesource.com/29346 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
d284d4ff92
commit
d41a7f77c5
16 changed files with 32 additions and 32 deletions
|
|
@ -110,7 +110,7 @@ func deadcode(ctxt *Link) {
|
|||
if Buildmode != BuildmodeShared {
|
||||
// Keep a typelink or itablink if the symbol it points at is being kept.
|
||||
// (When BuildmodeShared, always keep typelinks and itablinks.)
|
||||
for _, s := range ctxt.Allsym {
|
||||
for _, s := range ctxt.Syms.Allsym {
|
||||
if strings.HasPrefix(s.Name, "go.typelink.") ||
|
||||
strings.HasPrefix(s.Name, "go.itablink.") {
|
||||
s.Attr.Set(AttrReachable, len(s.R) == 1 && s.R[0].Sym.Attr.Reachable())
|
||||
|
|
@ -232,7 +232,7 @@ func (d *deadcodepass) init() {
|
|||
if Buildmode == BuildmodeShared {
|
||||
// Mark all symbols defined in this library as reachable when
|
||||
// building a shared library.
|
||||
for _, s := range d.ctxt.Allsym {
|
||||
for _, s := range d.ctxt.Syms.Allsym {
|
||||
if s.Type != 0 && s.Type != obj.SDYNIMPORT {
|
||||
d.mark(s, nil)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue