<div dir="ltr">Anders Carlsson added this logic to CGRTTI.cpp in r124096.  Currently it lives in ItaniumCXXABI.cpp.<div><br></div><div>Anders, why is this necessary?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Aug 5, 2014 at 7:06 AM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello Clang folks, <br><br>I have a question about typeinfo variables:<br><br>% cat a1.cc<br>struct AAA {<br> public:<br>  virtual ~ AAA ();<br>};<br>AAA::~AAA() { }<br>void foo () { throw AAA (); }<br><br>
% clang++ a1.cc -S -o - -emit-llvm    | grep '_ZTI3AAA.=.[^{]*' -o <br>
_ZTI3AAA = constant <br><br>% clang++ a1.cc -S -o - -emit-llvm  -fno-rtti  | grep '_ZTI3AAA.=.[^{]*' -o <br>_ZTI3AAA = linkonce_odr constant <br><br>As you can see, depending on the compilation mode (-fno-rtti) the definition of _ZTI3AAA<br>

(typeinfo for AAA) is different.  Is that expected? <br><br>This difference causes problem for AddressSanitizer, if one part of the code is built with <br>-fno-rtti and another part w/o -fno-rtti. <br>asan instruments global constants but can not instrument linkonce_odr variables,<br>

as a result we mix an instrumented and a non-instrumented global in the same binary. <br><a href="https://code.google.com/p/address-sanitizer/issues/detail?id=327" target="_blank">https://code.google.com/p/address-sanitizer/issues/detail?id=327</a><br>

<br>Thanks, <br><br>--kcc <br><br></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>