The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+28 votes
2.8k views

A linker is given object modules for a set of programs that were compiled separately. What information need to be included in an object module?

  1. Object code

  2. Relocation bits

  3. Names and locations of all external symbols defined in the object module

  4. Absolute addresses of internal symbols

asked in Compiler Design by Veteran (59.6k points) | 2.8k views
+4

Correction:"what information need not to be included in an object module"

0

A linker is given object modules for a set of programs that were compiled separately. What information need to be included in an object module?

ACTUAL QUESTION:- A linker is given object modules for a set of programs that were compiled separately. What information need not be included in an object module?

1 Answer

+33 votes
Best answer
  1. is trivially there is an object module.
     
  2. must be there if we need to have relocation capability.
     
  3. is the answer. For linker to link external symbols (for example in C, to link an extern variable in one module to a global variable in another module), it must know the location of all external symbols. In C external symbols includes all global variables and function names.
     
  4. is no way needed.
answered by Veteran (358k points)
edited by
+8

@Arjun sir I think answer should be D as it not present in an object code info.

HEADER
TEXT   SEGMENT
DATA SEGMENT
RELOCATION INFO
SYMBOL TABLE
DEBUGGING INFO

Things present as an object code info.

0
@junaid..yeah my friend you are correct..!
0
@Arjun sir, shouldnt names of external symbols defined in the object module be there in object module for linker to know what to link to given particular object module?

Also question is "not needed". You gave option C and for option D too, you have written "no way needed". Whats the solution?
0
@junaid

But c option is what linker actually does,resolving external symbol references
0
so along with (c) we also need the object code and relocation bits then ans must be a,b,c


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

40,845 questions
47,506 answers
145,764 comments
62,261 users