mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link/internal/ld: unexport ReadOnly and RelROMap
Change-Id: I08e33b92dd8a22e28ec15aa5753904aa8e1c71f5 Reviewed-on: https://go-review.googlesource.com/42031 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
4aca8b00ff
commit
e29ea14100
2 changed files with 13 additions and 13 deletions
|
|
@ -1361,8 +1361,8 @@ func (ctxt *Link) dodata() {
|
|||
// "read only" data with relocations needs to go in its own section
|
||||
// when building a shared library. We do this by boosting objects of
|
||||
// type SXXX with relocations to type SXXXRELRO.
|
||||
for _, symnro := range ReadOnly {
|
||||
symnrelro := RelROMap[symnro]
|
||||
for _, symnro := range readOnly {
|
||||
symnrelro := relROMap[symnro]
|
||||
|
||||
ro := []*Symbol{}
|
||||
relro := data[symnrelro]
|
||||
|
|
@ -1640,14 +1640,14 @@ func (ctxt *Link) dodata() {
|
|||
ctxt.Syms.Lookup("runtime.types", 0).Sect = sect
|
||||
ctxt.Syms.Lookup("runtime.etypes", 0).Sect = sect
|
||||
}
|
||||
for _, symn := range ReadOnly {
|
||||
for _, symn := range readOnly {
|
||||
align := dataMaxAlign[symn]
|
||||
if sect.Align < align {
|
||||
sect.Align = align
|
||||
}
|
||||
}
|
||||
datsize = Rnd(datsize, int64(sect.Align))
|
||||
for _, symn := range ReadOnly {
|
||||
for _, symn := range readOnly {
|
||||
for _, s := range data[symn] {
|
||||
datsize = aligndatsize(datsize, s)
|
||||
s.Sect = sect
|
||||
|
|
@ -1720,16 +1720,16 @@ func (ctxt *Link) dodata() {
|
|||
sect.Vaddr = 0
|
||||
ctxt.Syms.Lookup("runtime.types", 0).Sect = sect
|
||||
ctxt.Syms.Lookup("runtime.etypes", 0).Sect = sect
|
||||
for _, symnro := range ReadOnly {
|
||||
symn := RelROMap[symnro]
|
||||
for _, symnro := range readOnly {
|
||||
symn := relROMap[symnro]
|
||||
align := dataMaxAlign[symn]
|
||||
if sect.Align < align {
|
||||
sect.Align = align
|
||||
}
|
||||
}
|
||||
datsize = Rnd(datsize, int64(sect.Align))
|
||||
for _, symnro := range ReadOnly {
|
||||
symn := RelROMap[symnro]
|
||||
for _, symnro := range readOnly {
|
||||
symn := relROMap[symnro]
|
||||
for _, s := range data[symn] {
|
||||
datsize = aligndatsize(datsize, s)
|
||||
if s.Outer != nil && s.Outer.Sect != nil && s.Outer.Sect != sect {
|
||||
|
|
|
|||
|
|
@ -124,10 +124,10 @@ var abiSymKindToSymKind = [...]SymKind{
|
|||
SDWARFINFO,
|
||||
}
|
||||
|
||||
// ReadOnly are the symbol kinds that form read-only sections. In some
|
||||
// readOnly are the symbol kinds that form read-only sections. In some
|
||||
// cases, if they will require relocations, they are transformed into
|
||||
// rel-ro sections using RelROMap.
|
||||
var ReadOnly = []SymKind{
|
||||
// rel-ro sections using relROMap.
|
||||
var readOnly = []SymKind{
|
||||
STYPE,
|
||||
SSTRING,
|
||||
SGOSTRING,
|
||||
|
|
@ -137,9 +137,9 @@ var ReadOnly = []SymKind{
|
|||
SFUNCTAB,
|
||||
}
|
||||
|
||||
// RelROMap describes the transformation of read-only symbols to rel-ro
|
||||
// relROMap describes the transformation of read-only symbols to rel-ro
|
||||
// symbols.
|
||||
var RelROMap = map[SymKind]SymKind{
|
||||
var relROMap = map[SymKind]SymKind{
|
||||
STYPE: STYPERELRO,
|
||||
SSTRING: SSTRINGRELRO,
|
||||
SGOSTRING: SGOSTRINGRELRO,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue