[llvm-commits] AddressSanitizer, first patch

Kostya Serebryany kcc at google.com
Fri Sep 9 09:09:49 PDT 2011


On Fri, Sep 9, 2011 at 8:31 AM, Duncan Sands <baldrick at free.fr> wrote:

> 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.
>
This makes the code simpler indeed. Patch updated.

--kcc




>
> 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
>
> _______________________________________________
> 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/20110909/aec4ffe7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: issue4867059_19008.diff
Type: text/x-patch
Size: 23385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110909/aec4ffe7/attachment.bin>


More information about the llvm-commits mailing list