[PATCH] LSan in LD_PRELOAD library form

Kostya Serebryany kcc at google.com
Tue May 21 01:24:22 PDT 2013



================
Comment at: lib/lsan/tests/lsan_testlib.cc:1
@@ +1,2 @@
+//===-- lsan_testlib.cc ---------------------------------------------------===//
+//
----------------
is this going to be a method recommended to users? 
If yes, the name is not perfect (maybe lsan_preload_lib.cc ?) 
and I expect to see lit-style tests and cmake support in the following CLs.


================
Comment at: lib/lsan/tests/lsan_testlib.cc:23
@@ +22,3 @@
+
+static void constructor() __attribute__((constructor));
+
----------------
can't you express this in one line ?

__attribute__((constructor))
static void constructor()  {
   ...
}


Also, how does this work in the presence of other CTORs/DTORs in the program? 
Does LD_PRELOAD guarantee anything w.r.t the order of CTORSs? 
If so, it deserves a comment and a test. 



http://llvm-reviews.chandlerc.com/D832



More information about the llvm-commits mailing list