[llvm-commits] AddressSanitizer, first patch

Duncan Sands baldrick at free.fr
Fri Sep 9 08:31:24 PDT 2011


Hi John,

> SAFECode also adds calls in llvm.global_ctors in
> lib/InsertPoolChecks/RegisterRuntimeInitializer.cpp (line 144). At the time I
> wrote the code, ctor priorities were not honored as documented in the Language
> Reference Manual. Through experimentation, I determined that they were executed
> in one order on Linux and another on Mac OS X, and the code in
> RegisterRuntimeInitializer.cpp uses that information.
>
> That said, I seem to recall seeing a commit recently that may have fixed the
> problem with ctor priority numbers. Has that, in fact, been fixed?

yes, it has been fixed.

Best wishes, Duncan.

  If so, it
> would be better to rely upon the documented priority numbers instead of on
> undocumented behavior observed in the wild.
> :)
>
> -- John T.
>
>
>>
>>     Please get rid of blockHasException and the dependent code; the
>>     eh_exception intrinsic is going away very soon, and you shouldn't run
>>     into similar issues with the new exception handling framework.
>>
>>
>> Done.
>>
>>
>>     + GlobalValue *asan_mapping_offset =
>>     + new GlobalVariable(M, IntPtrTy, true, GlobalValue::LinkOnceODRLinkage,
>>     + ConstantInt::get(IntPtrTy, 1ULL << MappingOffsetLog),
>>     + "__asan_mapping_offset");
>>     + GlobalValue *asan_mapping_scale =
>>     + new GlobalVariable(M, IntPtrTy, true, GlobalValue::LinkOnceODRLinkage,
>>     + ConstantInt::get(IntPtrTy, MappingScale),
>>     + "__asan_mapping_scale");
>>
>>     If you use WeakLinkage for these, you won't need the fake loads.
>>
>>
>> Surprisingly these globals *were* optimized away at -O3, at least at some point.
>> Dropped the fake loads for now.
>>
>>
>>     -Eli
>>
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu  <mailto:llvm-commits at cs.uiuc.edu>
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list