<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">https://code.google.com/p/address-sanitizer/issues/detail?id=327</a><br>
<br>Thanks, <br><br>--kcc <br><br></div>