1
0
mirror of https://github.com/golang/go synced 2024-11-24 03:30:18 -07:00

cmd/link: use keyed literal for AbiSymKindToSymKind

The correspondence is clearer. Also avoid accidental mismatch.

Change-Id: Ibd9a31cfcd7c2301614f3496cac67cbae99972a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/351334
Trust: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Mui 2021-09-21 18:05:28 -04:00
parent 55d22f7490
commit 74ba70be68

View File

@ -30,6 +30,8 @@
package sym
import "cmd/internal/objabi"
// A SymKind describes the kind of memory represented by a symbol.
type SymKind uint8
@ -123,24 +125,24 @@ const (
// AbiSymKindToSymKind maps values read from object files (which are
// of type cmd/internal/objabi.SymKind) to values of type SymKind.
var AbiSymKindToSymKind = [...]SymKind{
Sxxx,
STEXT,
SRODATA,
SNOPTRDATA,
SDATA,
SBSS,
SNOPTRBSS,
STLSBSS,
SDWARFCUINFO,
SDWARFCONST,
SDWARFFCN,
SDWARFABSFCN,
SDWARFTYPE,
SDWARFVAR,
SDWARFRANGE,
SDWARFLOC,
SDWARFLINES,
SLIBFUZZER_EXTRA_COUNTER,
objabi.Sxxx: Sxxx,
objabi.STEXT: STEXT,
objabi.SRODATA: SRODATA,
objabi.SNOPTRDATA: SNOPTRDATA,
objabi.SDATA: SDATA,
objabi.SBSS: SBSS,
objabi.SNOPTRBSS: SNOPTRBSS,
objabi.STLSBSS: STLSBSS,
objabi.SDWARFCUINFO: SDWARFCUINFO,
objabi.SDWARFCONST: SDWARFCONST,
objabi.SDWARFFCN: SDWARFFCN,
objabi.SDWARFABSFCN: SDWARFABSFCN,
objabi.SDWARFTYPE: SDWARFTYPE,
objabi.SDWARFVAR: SDWARFVAR,
objabi.SDWARFRANGE: SDWARFRANGE,
objabi.SDWARFLOC: SDWARFLOC,
objabi.SDWARFLINES: SDWARFLINES,
objabi.SLIBFUZZER_EXTRA_COUNTER: SLIBFUZZER_EXTRA_COUNTER,
}
// ReadOnly are the symbol kinds that form read-only sections. In some