]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: write ELF relocations in mmap on all architectures
authorCherry Zhang <cherryyz@google.com>
Sat, 4 Jul 2020 22:14:08 +0000 (18:14 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 6 Jul 2020 19:58:23 +0000 (19:58 +0000)
commit8c46cb1bf534adb169a8789489e85bf777655066
tree01eb18a69248e22a1811f318b3e6084d51fa75fe
parent36939aef772219e896e00e60b4ad83cd7bee2aa5
[dev.link] cmd/link: write ELF relocations in mmap on all architectures

In CL 240399 we changed to precompute the size for ELF relocation
records and use mmap to write them, but we left architectures
where elfreloc1 write non-fixed number of bytes. This CL handles
those architectures. When a Go relocation will turn into multiple
ELF relocations, in relocsym we account this difference and add
it to the size calculation. So when emitting ELF relocations, we
know the number of ELF relocations to be emitted.

Change-Id: I6732ab674b442f4618405e5412a77f6e4a3315d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/241079
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
15 files changed:
src/cmd/link/internal/amd64/asm.go
src/cmd/link/internal/arm/asm.go
src/cmd/link/internal/arm64/asm.go
src/cmd/link/internal/arm64/obj.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/mips/asm.go
src/cmd/link/internal/mips64/asm.go
src/cmd/link/internal/ppc64/asm.go
src/cmd/link/internal/ppc64/obj.go
src/cmd/link/internal/riscv64/asm.go
src/cmd/link/internal/s390x/asm.go
src/cmd/link/internal/x86/asm.go
src/cmd/link/internal/x86/obj.go