Multiple choice technology programming languages

Program 'A' is dynamically linked to 'B'. 'B' is statically linked to 'C'.If we make some changes in 'C' what should be done?

  1. Program C compilation and linkedit is enough

  2. Program A ,Program B and Program C should be compiled

  3. Program A and Program C should be compiled

  4. Program B will have to be relinked with Program C

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

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.

AI explanation

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.