We want to inject some functions before user's main function and found LD_PRELOAD
to override __libc_start_main
would work for C programes with gcc
.
However, it doesn't work with cpp file which may use g++ by default. We have dumped the symbol and found the difference between binaries from gcc and g++. After compiling with g++
, the libc start main function was rename and we don't know how to override it.