Omar
Omar

Reputation: 16

Using ASan on a single shared object

I have an executable that is linked against multiple shared objects. One of the shared objects is compiled with ASan and the executable itself isn't. Is there a way to make ASan track this shared object only? Is there an alternative to using LD_PRELOAD here?

Upvotes: 0

Views: 846

Answers (1)

yugr
yugr

Reputation: 21878

The only supported way in this case is to compile (and link) shared object with -fsanitize=address and set export LD_PRELOAD=$(gcc -print-file-name=libasan.so) when running the executable.

Upvotes: 2

Related Questions