[llvm-commits] [ASan] set larger alignment for ASan mapping constants (issue 5844058)

Kostya Serebryany kcc at google.com
Mon Mar 19 09:11:34 PDT 2012


I would just disable these two globals -- they are used only for
experiments right now.
Let me do the change.

--kcc

On Mon, Mar 19, 2012 at 3:00 AM, <samsonov at google.com> wrote:

> Reviewers: kcc,
>
>
>
> Please review this at http://codereview.appspot.com/5844058/
>
> Affected files:
>   M     lib/Transforms/Instrumentation/AddressSanitizer.cpp
>
>
> Index: lib/Transforms/Instrumentation/AddressSanitizer.cpp
> ===================================================================
> --- lib/Transforms/Instrumentation/AddressSanitizer.cpp (revision 153031)
> +++ lib/Transforms/Instrumentation/AddressSanitizer.cpp (working copy)
> @@ -62,6 +62,7 @@
>  static const char *kAsanHandleNoReturnName = "__asan_handle_no_return";
>  static const char *kAsanMappingOffsetName = "__asan_mapping_offset";
>  static const char *kAsanMappingScaleName = "__asan_mapping_scale";
> +static const int   kAsanMappingConstantsAlignment = 1 << 5;
>  static const char *kAsanStackMallocName = "__asan_stack_malloc";
>  static const char *kAsanStackFreeName = "__asan_stack_free";
>
> @@ -584,10 +585,12 @@
>        new GlobalVariable(M, IntptrTy, true,
> GlobalValue::LinkOnceODRLinkage,
>                       ConstantInt::get(IntptrTy, MappingOffset),
>                       kAsanMappingOffsetName);
> +  asan_mapping_offset->setAlignment(kAsanMappingConstantsAlignment);
>    GlobalValue *asan_mapping_scale =
>        new GlobalVariable(M, IntptrTy, true,
> GlobalValue::LinkOnceODRLinkage,
>                           ConstantInt::get(IntptrTy, MappingScale),
>                           kAsanMappingScaleName);
> +  asan_mapping_scale->setAlignment(kAsanMappingConstantsAlignment);
>    // Read these globals, otherwise they may be optimized away.
>    IRB.CreateLoad(asan_mapping_scale, true);
>    IRB.CreateLoad(asan_mapping_offset, true);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120319/a51cf098/attachment.html>


More information about the llvm-commits mailing list