[llvm-dev] Weak symbol function in shared library and strong symbol function in main problem

Simone Atzeni via llvm-dev
2017-01-08T05:34:55Z

Hi,

I have a pass that add a function in the module where the “main” is. Then, I
have the same function declared as weak symbol in a shared library that I load
at runtime with LD_PRELOAD.
When I run a program the weak symbol function gets called over the function was
added by the pass.

Is it a correct behavior? Is there a way to call the strong symbol function when
it’s present in the module?
In other words, when I don’t apply the pass I want the program to call the weak
symbol function, otherwise when I apply the pass I want the program to call the
function added by the pass.

Thanks!
Best,
Simone