[PATCH] D17855: [asan] Fix odr_c_test failure with gold linker

Derek Bruening via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 3 09:42:56 PST 2016


bruening created this revision.
bruening added a reviewer: kcc.
bruening added a subscriber: llvm-commits.

Adds another global to asan's odr_c_test to help force the target global to
not lie at the start of bss with the gold linker where it is always
aligned.

http://reviews.llvm.org/D17855

Files:
  test/asan/TestCases/Linux/odr_c_test.c

Index: test/asan/TestCases/Linux/odr_c_test.c
===================================================================
--- test/asan/TestCases/Linux/odr_c_test.c
+++ test/asan/TestCases/Linux/odr_c_test.c
@@ -13,6 +13,9 @@
 #if defined(FILE1)
 __attribute__((aligned(8))) int x;
 __attribute__((aligned(1))) char y;
+// The gold linker puts ZZZ at the start of bss (where it is aligned)
+// unless we have a large alternative like Displace:
+__attribute__((aligned(1))) char Displace[105];
 __attribute__((aligned(1))) char ZZZ[100];
 #elif defined(FILE2)
 int ZZZ = 1;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17855.49747.patch
Type: text/x-patch
Size: 565 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160303/6bf83f3b/attachment.bin>


More information about the llvm-commits mailing list