From 4582f239c3e4589d73dc9e273368f17a196bc09e Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 31 Oct 2024 09:49:47 -0400 Subject: cmd/internal/objabi, cmd/link: introduce SymKind helper methods These will be necessary when we start using the new FIPS symbols. Split into a separate CL so that these refactoring changes can be tested separate from any FIPS-specific changes. Passes golang.org/x/tools/cmd/toolstash/buildall. Change-Id: I73e5873fcb677f1f572f0668b4dc6f3951d822bc Reviewed-on: https://go-review.googlesource.com/c/go/+/625996 LUCI-TryBot-Result: Go LUCI Reviewed-by: Cherry Mui Auto-Submit: Russ Cox --- src/cmd/internal/obj/objfile.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cmd/internal/obj/objfile.go') diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go index 5ac15b8228..bc22765abc 100644 --- a/src/cmd/internal/obj/objfile.go +++ b/src/cmd/internal/obj/objfile.go @@ -896,7 +896,7 @@ func (ctxt *Link) writeSymDebugNamed(s *LSym, name string) { fmt.Fprintf(ctxt.Bso, "asm ") } fmt.Fprintf(ctxt.Bso, "size=%d", s.Size) - if s.Type == objabi.STEXT { + if s.Type.IsText() { fn := s.Func() fmt.Fprintf(ctxt.Bso, " args=%#x locals=%#x funcid=%#x align=%#x", uint64(fn.Args), uint64(fn.Locals), uint64(fn.FuncID), uint64(fn.Align)) if s.Leaf() { @@ -904,7 +904,7 @@ func (ctxt *Link) writeSymDebugNamed(s *LSym, name string) { } } fmt.Fprintf(ctxt.Bso, "\n") - if s.Type == objabi.STEXT { + if s.Type.IsText() { for p := s.Func().Text; p != nil; p = p.Link { fmt.Fprintf(ctxt.Bso, "\t%#04x ", uint(int(p.Pc))) if ctxt.Debugasm > 1 { -- cgit v1.3-6-g1900