Skip to content

Commit 7ef0e9e

Browse files
rscpull[bot]
authored andcommitted
cmd/internal/objabi, cmd/link: add FIPS symbol kinds
Add FIPS symbol kinds that will be needed for FIPS support. This is a separate CL to keep the re-generated changes in the string methods separate from hand-written changes. The separate symbol kinds will let us group the FIPS-related code and data together, so that it can be checksummed at startup, as required by FIPS. It's also separate because it breaks buildall, by changing the on-disk symbol kind enumeration. We want non-buildall changes to be as simple as possible. For #69536. Change-Id: I2d5a238498929fff8b24736ee54330c17323bd86 Reviewed-on: https://go-review.googlesource.com/c/go/+/625995 Auto-Submit: Russ Cox <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent fb75b3f commit 7ef0e9e

File tree

4 files changed

+133
-83
lines changed

4 files changed

+133
-83
lines changed

src/cmd/internal/objabi/symkind.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ const (
4444
Sxxx SymKind = iota
4545
// Executable instructions
4646
STEXT
47+
STEXTFIPS
4748
// Read only static data
4849
SRODATA
50+
SRODATAFIPS
4951
// Static data that does not contain any pointers
5052
SNOPTRDATA
53+
SNOPTRDATAFIPS
5154
// Static data
5255
SDATA
56+
SDATAFIPS
5357
// Statically data that is initially all 0s
5458
SBSS
5559
// Statically data that is initially all 0s and does not contain pointers

src/cmd/internal/objabi/symkind_string.go

Lines changed: 25 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/link/internal/sym/symkind.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ type SymKind uint8
4343
const (
4444
Sxxx SymKind = iota
4545
STEXT
46+
STEXTFIPSSTART
47+
STEXTFIPS
48+
STEXTFIPSEND
49+
STEXTEND
4650
SELFRXSECT
4751
SMACHOPLT
4852

@@ -53,6 +57,10 @@ const (
5357
SGOFUNC
5458
SGCBITS
5559
SRODATA
60+
SRODATAFIPSSTART
61+
SRODATAFIPS
62+
SRODATAFIPSEND
63+
SRODATAEND
5664
SFUNCTAB
5765

5866
SELFROSECT
@@ -87,14 +95,23 @@ const (
8795
// Writable sections.
8896
SFirstWritable
8997
SBUILDINFO
98+
SFIPSINFO
9099
SELFSECT
91100
SMACHO
92101
SMACHOGOT
93102
SWINDOWS
94103
SELFGOT
95104
SNOPTRDATA
105+
SNOPTRDATAFIPSSTART
106+
SNOPTRDATAFIPS
107+
SNOPTRDATAFIPSEND
108+
SNOPTRDATAEND
96109
SINITARR
97110
SDATA
111+
SDATAFIPSSTART
112+
SDATAFIPS
113+
SDATAFIPSEND
114+
SDATAEND
98115
SXCOFFTOC
99116
SBSS
100117
SNOPTRBSS
@@ -135,9 +152,13 @@ const (
135152
var AbiSymKindToSymKind = [...]SymKind{
136153
objabi.Sxxx: Sxxx,
137154
objabi.STEXT: STEXT,
155+
objabi.STEXTFIPS: STEXTFIPS,
138156
objabi.SRODATA: SRODATA,
157+
objabi.SRODATAFIPS: SRODATAFIPS,
139158
objabi.SNOPTRDATA: SNOPTRDATA,
159+
objabi.SNOPTRDATAFIPS: SNOPTRDATAFIPS,
140160
objabi.SDATA: SDATA,
161+
objabi.SDATAFIPS: SDATAFIPS,
141162
objabi.SBSS: SBSS,
142163
objabi.SNOPTRBSS: SNOPTRBSS,
143164
objabi.STLSBSS: STLSBSS,
@@ -166,6 +187,10 @@ var ReadOnly = []SymKind{
166187
SGOFUNC,
167188
SGCBITS,
168189
SRODATA,
190+
SRODATAFIPSSTART,
191+
SRODATAFIPS,
192+
SRODATAFIPSEND,
193+
SRODATAEND,
169194
SFUNCTAB,
170195
}
171196

src/cmd/link/internal/sym/symkind_string.go

Lines changed: 79 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)