[PATCH] [compiler-rt] Don't instrument globals from __objc_classname

Kuba Brecka kuba.brecka at gmail.com
Tue Dec 2 15:30:15 PST 2014


Hi samsonov, glider,

Fixes https://code.google.com/p/address-sanitizer/issues/detail?id=360 – Using Obj-C blocks triggers a false-positive ODR violation

The change in r221451 (http://llvm.org/viewvc/llvm-project?view=revision&revision=221451) caused Obj-C related global constants to be instrumented, but the linker rearranges the sections, so the redzones break. We already added a check to skip __objc_methname section from being instrumented because of this, see r221480 (http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?view=diff&r1=221479&r2=221480&pathrev=221480). The same issue still exists for class names in __objc_classname, this patch skips the __objc_classname section from being instrumented, as well.

http://reviews.llvm.org/D6488

Files:
  lib/Transforms/Instrumentation/AddressSanitizer.cpp
  projects/compiler-rt/test/asan/TestCases/Darwin/objc-odr.mm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6488.16834.patch
Type: text/x-patch
Size: 1481 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141202/e477ece4/attachment.bin>


More information about the llvm-commits mailing list