[PATCH] D15358: CFI runtime library (cross-DSO support)

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 11 13:59:00 PST 2015


eugenis added inline comments.

================
Comment at: lib/cfi/cfi.cc:176
@@ +175,3 @@
+      // PT_RELRO?
+      uptr cur_beg = info->dlpi_addr + phdr->p_vaddr;
+      uptr cur_end = cur_beg + phdr->p_memsz;
----------------
pcc wrote:
> Maybe.
> 
> Why don't we build a libclang_rt.sanitizer_common library and have the sanitizers use that instead of each having its own copy of sanitizer_common? Then we could just have a cfi library and link the regular ubsan library conditionally.
The way it's done now, the "main" sanitizer calls Ubsan::InitAsPlugin and it also handles flags for ubsan. Replacing that with a runtime check could be brittle and would need to handle static vs shared linking, different initialization order (between the two runtime libraries), etc. Anyway, this is a bigger refactoring that would also affect asan+ubsan mode, I don't want to do it now.




Repository:
  rL LLVM

http://reviews.llvm.org/D15358





More information about the llvm-commits mailing list