]> Cypherpunks repositories - gostls13.git/commit
cmd/link: split large elf text sections on ppc64x
authorLynn Boger <laboger@linux.vnet.ibm.com>
Thu, 25 Aug 2016 16:07:33 +0000 (11:07 -0500)
committerIan Lance Taylor <iant@golang.org>
Wed, 21 Sep 2016 20:23:49 +0000 (20:23 +0000)
commitb4efd09d1880793e33fbb191ccfe1657bfeba0c9
treeeeccf8c6d41a18b5cf7d644eec7fa737e5611876
parent445f51fb119789e08889abcb8ae54b4eb5029fad
cmd/link: split large elf text sections on ppc64x

Some applications built with Go on ppc64x with external linking
can fail to link with relocation truncation errors if the elf
text section that is generated is larger than 2^26 bytes and that
section contains a call instruction (bl) which calls a function
beyond the limit addressable by the 24 bit field in the
instruction.

This solution consists of generating multiple text sections where
each is small enough to allow the GNU linker to resolve the calls
by generating long branch code where needed.  Other changes were added
to handle differences in processing when multiple text sections exist.

Some adjustments were required to the computation of a method's address
when using the method offset table when there are multiple text sections.

The number of possible section headers was increased to allow for up
to 128 text sections.  A test case was also added.

Fixes #15823.

Change-Id: If8117b0e0afb058cbc072258425a35aef2363c92
Reviewed-on: https://go-review.googlesource.com/27790
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/link/internal/ld/data.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/ppc64/asm.go
src/cmd/link/linkbig_test.go [new file with mode: 0644]
src/runtime/symtab.go
src/runtime/type.go