retagged by
444 views
0 votes
0 votes
Consider the following statements:
S1: When you statically link a file into an executable, the contents of the file are included during link time.
S2: When you link dynamically, it is only during run time when a pointer to the file which is linked in is included in the executable and then the contents of said file are loaded.
Which of the above statements is/are true?
retagged by

1 Answer

0 votes
0 votes
Both are true

in static linking, each object code(executable file) produced by compiler should come with its library routine  before load. so  all the shared files or other files referenced by the object codes are linked with them at link time

at run time , those shared routines are replaced by stub or glue code which is replaced by actual code at run time. Hence linking of all the object files with their references(can be shared file, library routines etc) is done at run time and only called routines are loaded.

Related questions

0 votes
0 votes
1 answer
1
1 votes
1 votes
1 answer
2
sripo asked Nov 3, 2018
2,157 views
Does Heap Allocation support both recursion and dynamic memory allocation? Because,a stack can be implemented using dynamic memory allocation.Please correct me.Test Serie...
0 votes
0 votes
1 answer
3
shashank023 asked Jun 17, 2017
1,005 views
How storage mapping is done by compilers ?Even though actual loading of program in memory is done by loader.PS: This is the exact question as given in book, but i think i...