Commit d765e41c authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle Committed by Ian Lance Taylor

cmd/internal/ld: make a few more symbols local

The symbols for the actual data in a constant string or bytes literal should
be local.

Change-Id: Idafcfba9a638eaa4e460e5103d96843960559b35
Reviewed-on: https://go-review.googlesource.com/8772Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
parent e1366f94
......@@ -367,9 +367,18 @@ func symtab() {
// just defined above will be first.
// hide the specific symbols.
for s := Ctxt.Allsym; s != nil; s = s.Allsym {
if !s.Reachable || s.Special != 0 || s.Type != SRODATA {
if !s.Reachable || s.Special != 0 {
continue
}
if strings.Contains(s.Name, "..gostring.") || strings.Contains(s.Name, "..gobytes.") {
s.Local = true
}
if s.Type != SRODATA {
continue
}
if strings.HasPrefix(s.Name, "type.") && !DynlinkingGo() {
s.Type = STYPE
s.Hide = 1
......
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