<br><br><div class="gmail_quote">On Fri, Sep 9, 2011 at 8:31 AM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr">baldrick@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi John,<br>
<div class="im"><br>
> SAFECode also adds calls in llvm.global_ctors in<br>
> lib/InsertPoolChecks/RegisterRuntimeInitializer.cpp (line 144). At the time I<br>
> wrote the code, ctor priorities were not honored as documented in the Language<br>
> Reference Manual. Through experimentation, I determined that they were executed<br>
> in one order on Linux and another on Mac OS X, and the code in<br>
> RegisterRuntimeInitializer.cpp uses that information.<br>
><br>
> That said, I seem to recall seeing a commit recently that may have fixed the<br>
> problem with ctor priority numbers. Has that, in fact, been fixed?<br>
<br>
</div>yes, it has been fixed.<br></blockquote><div>This makes the code simpler indeed. Patch updated. </div><div><br></div><div>--kcc </div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

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