Question: In this problem, let REF(x.i)DEF(x.k) denote that the linker will associate an arbitrary reference to symbol x in module i to the definition of x
In this problem, let REF(x.i)→DEF(x.k) denote that the linker will associate an arbitrary reference to symbol x in module i to the definition of x in module k. For each example that follows, use this notation to indicate how the linker would resolve references to the multiply-defined symbol in each module. If there is a link-time error (rule 1), write “error”. If the linker arbitrarily chooses one of the definitions (rule 3), write “unknown”.

A. /* Module 1 */ int main() { } (a) REF (main.1) DEF( (b) REF (main.2) DEF( B. /* Module 1 */ void main() { } (a) REF (main.1) DEF (_ (b) REF (main.2) DEF( C. /* Module 1 */ int x; void main() { } (a) REF (x.1) DEF(__ (b) REF(x.2) DEF(_ /* Module 2 */ int main; int p2() { } /* Module 2 */ int main= 1; int p2() { } /* Module 2 */ double x = 1.0; int p2() { }
Step by Step Solution
3.47 Rating (157 Votes )
There are 3 Steps involved in it
This is a simple drill that checks your understanding of ... View full answer
Get step-by-step solutions from verified subject matter experts
