[PATCH] D56672: [HWASAN] Instrument globals

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 17 06:10:44 PST 2019


evgeny777 added a comment.

>> I wonder if the same could be achieved with a clever use of ifunc?
> 
> Do you mean generating ifunc for each instrumented global and tagging a pointer there?

I noticed that HWASAN forces compilation of position independent object files (this happens in SanitizerArgs.cpp). This means
that uninstrumented objects/libraries will also likely be position independent, beacuse linking PIE vs non-PIE is problematic

That said we can probably use ordinary ifuncs like it's already done with `__hwasan_shadow`. The `lld` linker can't handle this
at the moment because it can't create `R_*_IRELATIVE` relocs in `.rela.dyn` section, but GNU linkers can.

Your thoughts?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56672/new/

https://reviews.llvm.org/D56672





More information about the llvm-commits mailing list