]> Cypherpunks repositories - gostls13.git/commit
cmd/link: add Minalign field to ld.Arch
authorMichael Munday <munday@ca.ibm.com>
Thu, 3 Mar 2016 02:24:04 +0000 (21:24 -0500)
committerMinux Ma <minux@golang.org>
Thu, 3 Mar 2016 04:29:08 +0000 (04:29 +0000)
commit90cb1fdaf2eb0d1a7154b494fb3ea8b1c0177bdf
tree3582b2ff897d28b0d37f7a86f0570c591b3e8c24
parentb0f4ee533a875c258ac1030ee382f0ffe2de304b
cmd/link: add Minalign field to ld.Arch

The new Minalign field sets the minimum alignment for all symbols.
This is required for the upcoming s390x port which requires symbols
be 2-byte aligned for efficient relative addressing.

All preexisting architectures have Minalign set to 1 which means
that this commit should have no effect.

I tested values of 2, 4 and 8 on linux amd64 and the tests appear to
pass. Increasing Minalign to 16 appears to break the runtime. I
think this is due to assumptions made about the layout of module
data.

toolstash -cmp on linux amd64 shows no changes due to this commit.

Resolves #14604

Change-Id: I0fe042d52c4e4732eba5fabcd0c31102a2408764
Reviewed-on: https://go-review.googlesource.com/20149
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
14 files changed:
src/cmd/link/internal/amd64/l.go
src/cmd/link/internal/amd64/obj.go
src/cmd/link/internal/arm/l.go
src/cmd/link/internal/arm/obj.go
src/cmd/link/internal/arm64/l.go
src/cmd/link/internal/arm64/obj.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/mips64/l.go
src/cmd/link/internal/mips64/obj.go
src/cmd/link/internal/ppc64/l.go
src/cmd/link/internal/ppc64/obj.go
src/cmd/link/internal/x86/l.go
src/cmd/link/internal/x86/obj.go