]> Cypherpunks repositories - gostls13.git/commit
cmd/link: fix moduledata symbols for aix/ppc64 and external linking
authorClément Chigot <clement.chigot@atos.net>
Wed, 20 Feb 2019 15:20:56 +0000 (16:20 +0100)
committerIan Lance Taylor <iant@golang.org>
Wed, 6 Mar 2019 15:56:41 +0000 (15:56 +0000)
commitf0749c74fd5c32b8981065c24cc593328ccf5591
tree507e91c7af667c4c4d14fb032d1443fdc888548e
parent80f10965ee9f6063f587baffce9c1fa8fc80a5ba
cmd/link: fix moduledata symbols for aix/ppc64 and external linking

Moduledata symbols like runtime.data or runtime.text must have the
same position in the final executable (as some symbol accesses are made
by offset from them).
ld on AIX might move them randomly if there are nil size symbols.

ld will also remove unreachable symbols like runtime.epclntab or
runtime.rodata. In order to keep them, R_REF relocations are created
between firstmoduledata and these symbols. This relocation tells ld to
keep these symbols even if there aren't reachable.

Change-Id: Ie5a28cf406977131cec6442f7f5b6fd89fb775a3
Reviewed-on: https://go-review.googlesource.com/c/go/+/164004
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/internal/objabi/reloctype.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/ld/xcoff.go
src/cmd/link/internal/ppc64/asm.go