I'd like to find out which symbol is called when my code runs 'system' function.
In my sample code, when the header stdlib.h is specifically included, the symbol is called _system$UNIX2003, and when the header isn't included, there (probably) default symbol named _system (without the suffix $UNIX2003)
The following image shows my experiment results :
Why do we have different symbols for system ?
Is there anyway to detect the correct symbol during runtime (I tried with dlsym, but i need handle for containing dynamic library, but couldn't figure out with library should i load with dlopen) ?
EDIT : this strange symbol mangling occur to me only when compiling under 32bits arch.
EDIT2: I was suggested to use implicit function pointer to acquire the address of the right symbol. but it won't work unless i specifically call that function in my code. otherwise, I get compilation error of using undeclared identifier 'system'