mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: introduce a rel.ro segment
When internally linking with using rel.ro sections, this segment covers the sections. To do this, move to other read-only sections, SELFROSECT and SMACHOPLT, out of the way. Part of adding PIE internal linking on linux/amd64. Change-Id: I4fb3d180e92f7e801789ab89864010faf5a2cb6d Reviewed-on: https://go-review.googlesource.com/28538 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
13dc4d378b
commit
276803d611
11 changed files with 168 additions and 72 deletions
|
|
@ -519,10 +519,16 @@ func asmb(ctxt *ld.Link) {
|
|||
if ctxt.Debugvlog != 0 {
|
||||
ctxt.Logf("%5.2f rodatblk\n", obj.Cputime())
|
||||
}
|
||||
|
||||
ld.Cseek(int64(ld.Segrodata.Fileoff))
|
||||
ld.Datblk(ctxt, int64(ld.Segrodata.Vaddr), int64(ld.Segrodata.Filelen))
|
||||
}
|
||||
if ld.Segrelrodata.Filelen > 0 {
|
||||
if ctxt.Debugvlog != 0 {
|
||||
ctxt.Logf("%5.2f rodatblk\n", obj.Cputime())
|
||||
}
|
||||
ld.Cseek(int64(ld.Segrelrodata.Fileoff))
|
||||
ld.Datblk(ctxt, int64(ld.Segrelrodata.Vaddr), int64(ld.Segrelrodata.Filelen))
|
||||
}
|
||||
|
||||
if ctxt.Debugvlog != 0 {
|
||||
ctxt.Logf("%5.2f datblk\n", obj.Cputime())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue