FOR FREE CONTENT

Related Questions: SET, NET, GATE, and ISRO

 

Q Gate 2003

Which of the following is NOT an advantage of using shared; dynamically linked libraries as opposed to using statically linked libraries?

 

a) Smaller sizes of the executable file.

b) Lesser overall page fault rate in the system.

c) Faster program start-up.

d) Exiting programs need not be re-linked to take advantage of the newer version of libraries.

 

Answer:

 

Option (b) is correct

 

Question: West Bengal SET 2018, ISRO 2008, and Gate 1998                 

In a resident OS computer which of the following system software must reside in the main memory under all situations.

            a)         Assembler                              b)         Linker

            c)         Loader                                    d)         Compiler

 

Answer:

 

Option a: Assembler is not loaded all the time in main memory whenever required it will then load into memory.  Option a is wrong.

 

Option b:  It same as assembler whenever needed it will load in the main memory. Option b is wrong.

 

Option c: Loader is system software that must reside in the main all the time because the job of the loader is to load all the software in the main memory as per the requirement so, without a loader, it is not possible to load anything in main memory.  Option c is correct.

 

Option d: It same as assembler and linker whenever needed it will load in the main memory. Option d is not correct.

 

Question: UGC NET 2017 July – 35

Which of the following statement(s) regarding a linker software is/are true?

 

I. A function of a linker is to combine several object modules into a single load module.

II. A function of a linker is to replace absolute references in an object module with symbolic references to locations in other modules.

 

(a) Only I 

(b) Only II 

(c) Both I and II 

(d) Neither I nor II.

 

Answer: 

 

Option a: The function of the linker or linked editor is try to resolve all unresolved symbols at the symbol table and combine all object external modules into a single object file. (See linker

 

So, I is true means Option a is correct.

 

Option b: II. Actually its points to reallocation by the absolute address which is done by loader but not linker. 

 

Yes, linker also does relocation but here relocation at the time of linker means change all the relocatable addresses to new relocated addresses. The linker does not deal with an absolute address. (See linker). 

 

So, II is wrong and option b, c, d is not correct.

 

Question: Gate 2001

The process of assigning load addresses to the various parts of the program and adjusting the code and data in the program to reflect the assigned address is called.

            a)         Assembly                                b)         Passing

            c)         Relocation                              d)         Symbol Resolution.

 

Answer: 

 

This is relocation because at the time loading all the relocatable addresses change to absolute addresses by adjusting the code.

 

So, Option c correct.

 

Question: Gate 2004

Consider a program 'P' that consists of two sources modules M1 and M2 contained in two different files. If M1 contains a reference to a function defined in M2 the reference will be resolved at

            a)         Edit time                                 b)         Compile time

            c)         Link time                                d)         Load time.

 

 

Answer: 

 

At the time of linking, the linker is trying to solve all externals references & unresolved symbols and also to combine several object modules into a single load module.

 

So, option c is correct.

 

Other option:

a) Edit time: It never solve external references or link and combine modules into a single module. Here we write program code in different modules with a different name. 

 

So, option a is wrong.

 

b) Compile time: At compile time, the source program is converted to an assembly-level program (high-level program). Different module linking and solve unresolved symbols has never happened in this stage.

 

So, option b is wrong.

 

d) Load time: At time of load, linked object file loaded to main memory and convert all relocatable addresses to absolute addresses. So, a different module linking, external reference is solved before load time. (See load time)

 

So, option d is not correct.