// relro_test.cc -- test -z relro for gold
-// Copyright 2008 Free Software Foundation, Inc.
+// Copyright (C) 2008-2017 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
static int i2 = 2;
// P1 is a global relro variable.
-int* const p1 = &i1;
+int* const p1 __attribute__ ((aligned(64))) = &i1;
// P2 is a local relro variable.
-int* const p2 = &i2;
+int* const p2 __attribute__ ((aligned(64))) = &i2;
+
+// Add a TLS variable to make sure -z relro works correctly with TLS.
+__thread int i3 = 1;
// Test symbol addresses.
assert(i1page != p2page);
assert(i2page != p1page);
assert(i2page != p2page);
+ assert(i3 == 1);
return true;
}