[PATCH] D26771: [asan] Create a .ASAN$G(A-Z) section for global registration

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 10:32:47 PST 2016


rnk added inline comments.


================
Comment at: lib/asan/asan_globals_win.cc:28
+static void call_on_globals(void (*hook)(__asan_global *, uptr)) {
+  __asan_global *start = (__asan_global *)(&__asan_globals_start + 1);
+  __asan_global *end = (__asan_global *)&__asan_globals_end;
----------------
kcc wrote:
> will this work in the presence of multiple DSOs? 
> I.e. if asan rt is on one DSO and the callback comes from the other. 
> (Just asking, I don't remember how this is done on Windows)
Yes, this file is special because we link it into every DSO. I added a test that shows we report globals from DSOs when stripping is enabled.


https://reviews.llvm.org/D26771





More information about the llvm-commits mailing list