aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/objabi
diff options
context:
space:
mode:
authorerifan01 <eric.fang@arm.com>2019-04-16 02:49:09 +0000
committerIan Lance Taylor <iant@golang.org>2019-04-17 23:31:28 +0000
commit3b37ff453edd9664045e656d1c02e63703517399 (patch)
treeff9554f43a8664a7fd851021e08c3995dc85756a /src/cmd/internal/objabi
parentb5946ed48d75332ba95962a181a28bb6b203459f (diff)
downloadgo-3b37ff453edd9664045e656d1c02e63703517399.tar.xz
cmd/link: increase the reserved space for ELF relocations
Currently the offset values of ELF relocations and Macho relocations are 256 and 512 respectively, which means that the space reserved for ELF relocations is only 256. But AARCH64 has more than 256 ELF relocation types, in fact the maximum AARCH64 ELF relocation type recorded in file src/debug/elf/elf.go is 1032 currently. So this CL increases the offset of Macho relocations to 2048 to leave enough space for AARCH64 ELF relocations. Change-Id: I784ac38aeb3e102ac7825f6d621086849c8d3146 Reviewed-on: https://go-review.googlesource.com/c/go/+/172497 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/internal/objabi')
-rw-r--r--src/cmd/internal/objabi/util.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/internal/objabi/util.go b/src/cmd/internal/objabi/util.go
index e28447d141..57f19f2e3c 100644
--- a/src/cmd/internal/objabi/util.go
+++ b/src/cmd/internal/objabi/util.go
@@ -34,6 +34,11 @@ var (
Version = version
)
+const (
+ ElfRelocOffset = 256
+ MachoRelocOffset = 2048 // reserve enough space for ELF relocations
+)
+
func goarm() int {
switch v := envOr("GOARM", defaultGOARM); v {
case "5":