Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cmd/compile/internal/base/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ type CmdFlags struct {
JSON string "help:\"version,file for JSON compiler/optimizer detail output\""
Lang string "help:\"Go language version source code expects\""
LinkObj string "help:\"write linker-specific object to `file`\""
LinkShared *bool "help:\"generate code that will be linked against Go shared libraries\"" // &Ctxt.Flag_linkshared, set below
LinkShared *bool "help:\"generate code that will be linked against Go shared libraries\"" // &Ctxt.Flag_linkshared, set below
Ptabs *bool "help:\"generate and ptabs to encode type information for all exported symbols\"" // &Ctxt.Flag_emitptabs, set below
Live CountFlag "help:\"debug liveness analysis\""
MSan bool "help:\"build code compatible with C/C++ memory sanitizer\""
MemProfile string "help:\"write memory profile to `file`\""
Expand Down Expand Up @@ -162,6 +163,7 @@ func ParseFlags() {
Flag.ImportCfg = readImportCfg
Flag.CoverageCfg = readCoverageCfg
Flag.LinkShared = &Ctxt.Flag_linkshared
Flag.Ptabs = &Ctxt.Flag_ptabs
Flag.Shared = &Ctxt.Flag_shared
Flag.WB = true
Flag.WrapGlobalMapInit = true
Expand Down
8 changes: 4 additions & 4 deletions src/cmd/compile/internal/reflectdata/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ func TypeSymPrefix(prefix string, t *types.Type) *types.Sym {
NeedRuntimeType(t)
signatmu.Unlock()

//print("algsym: %s -> %+S\n", p, s);
// print("algsym: %s -> %+S\n", p, s);

return s
}
Expand Down Expand Up @@ -1356,7 +1356,7 @@ func writeITab(lsym *obj.LSym, typ, iface *types.Type, allowNonImplement bool) {

func WriteTabs() {
// process ptabs
if types.LocalPkg.Name == "main" && len(ptabs) > 0 {
if (types.LocalPkg.Name == "main" || base.Ctxt.Flag_ptabs) && len(ptabs) > 0 {
ot := 0
s := base.Ctxt.Lookup("go:plugin.tabs")
for _, p := range ptabs {
Expand Down Expand Up @@ -1757,7 +1757,7 @@ func ZeroAddr(size int64) ir.Node {
}

func CollectPTabs() {
if !base.Ctxt.Flag_dynlink || types.LocalPkg.Name != "main" {
if (!base.Ctxt.Flag_dynlink || types.LocalPkg.Name != "main") && !base.Ctxt.Flag_ptabs {
return
}
for _, exportn := range typecheck.Target.Exports {
Expand All @@ -1773,7 +1773,7 @@ func CollectPTabs() {
if !types.IsExported(s.Name) {
continue
}
if s.Pkg.Name != "main" {
if s.Pkg.Name != "main" && !base.Ctxt.Flag_ptabs {
continue
}
ptabs = append(ptabs, n)
Expand Down
1 change: 1 addition & 0 deletions src/cmd/internal/obj/link.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,7 @@ type Link struct {
Flag_shared bool
Flag_dynlink bool
Flag_linkshared bool
Flag_ptabs bool
Flag_optimize bool
Flag_locationlists bool
Flag_noRefName bool // do not include referenced symbol names in object file
Expand Down