Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22045

How to override the entrypoint like __libc_start_main with g++

$
0
0

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.

enter image description here


Viewing all articles
Browse latest Browse all 22045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>