The LD_PRELOAD
trick can help for dynamic linking of binaries at runtime, but it will fail for a statically linked binary.
I want to override some c++ startup functions (like changing code for __libc_start_main
, __libc_csu_init
and a few others). I was thinking of changing the code directly from glibc
but I want to be sure that there is no other way to get things worked out.
Is there any other way to override c++ startup functions than to change code from glibc
and building it again?