Tech Support > Computers & Technology > Programming > static linked functions in shared library
static linked functions in shared library
Posted by Yingjian Zhan on January 12th, 2007


Let's consider a shared library libfoo.so statically linked c library
containing such routine:
void foo ( )
{
printf ( "foo...\n" );
}

A statically linked program using dlopen to load the shared library and then
call foo. here's the question.
which printf routine will be called when call foo ? I guess the
statically linked printf in the shared library. But I'm not sure about that.
Could somebody explains it and fPIC option to me? thx a lot!!



Similar Posts