aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/type.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/type.go')
-rw-r--r--src/runtime/type.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/type.go b/src/runtime/type.go
index 78018fd9a8..82ac5120bb 100644
--- a/src/runtime/type.go
+++ b/src/runtime/type.go
@@ -520,6 +520,11 @@ func moduleTypelinks(md *moduledata) []*_type {
// We have to increment by 1 to match the increment done in
// cmd/link/internal/data.go createRelroSect in allocateDataSections.
+ //
+ // We don't do that increment on AIX, but on AIX we need to adjust
+ // for the fact that the runtime.types symbol has a size of 8,
+ // and the type descriptors will follow that. This increment,
+ // followed by the forced alignment to 8, will do that.
td++
etypedesc := md.types + md.typedesclen
@@ -528,6 +533,9 @@ func moduleTypelinks(md *moduledata) []*_type {
// 0x20 does not make sense.
if GOARCH == "arm" {
td = alignUp(td, 0x8)
+ } else if GOOS == "aix" {
+ // The alignment of 8 is forced in the linker on AIX.
+ td = alignUp(td, 0x8)
} else {
td = alignUp(td, 0x20)
}