Program 'A' is dynamically linked to 'B'. 'B' is statically linked to 'C'.If we make some changes in 'C' what should be done?
-
Program C compilation and linkedit is enough
-
Program A ,Program B and Program C should be compiled
-
Program A and Program C should be compiled
-
Program B will have to be relinked with Program C
When B is statically linked to C, C's code is embedded in B at link time. If C changes, B must be recompiled and relinked to incorporate the new version. A doesn't need recompilation because it links dynamically to B - it will use the updated B at runtime. Only B needs relinking.
Static linking embeds the actual object code of the called module into the calling program's load module at link-edit time, so B's executable literally contains a copy of C's compiled code. If C changes, that copy inside B is now stale, so B must be re-link-edited against the new C to pick up the change (recompiling C alone is not enough, and B doesn't need recompiling, just relinking). Because A is dynamically linked to B, A calls B by reference at run time and is unaffected by changes inside B or C.