Advertisement

04.29.2008 at 09:53PM PDT, ID: 23364430
[x]
Attachment Details

Linkers and how they resolve multiply defined global symbols

Asked by dongyowlin in C Programming Language

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 below, 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 (Rule1), write "ERROR". If the linker arbitrarily chooses one of the definitions (Rule 3), write "UNKNOWN".
Rule1: Multiple strong symbols are not allowed
Rule2: Given a strong symbol and multiple weak symbols, choose the strong symbol
Rule3: Given multiple weak symbols, choose any of the weak symbols

A.
      /*Module 1*/                              /*Module 2*/
      int main()                              static int main=1;
      {                              int p2()
      }
                              
(a)      REF(main.1) --> DEF(______._____)
(b)      REF(main.2) --> DEF(______._____)

B.
      /*Module 1*/                              /*Module 2*/
      int x;                              double x;
      void main()                              int p2()
      {                              {            }                               }      

(a)      REF(x.1) --> DEF(___.___)
(b)      REF(x.2) --> DEF(___.___)


C.
      /*Module 1*/                              /*Module 2*/
      int x=1;                              double x=1.0;
      void main()                              int p2()
      {                              {      
      }                              }

(a)      REF(x.1) --> DEF(___.___)
(b)      REF(x.2) --> DEF(___.___)


can someone please help??Start Free Trial
[+][-]04.29.2008 at 09:59PM PDT, ID: 21468174

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 10:00PM PDT, ID: 21468176

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 10:01PM PDT, ID: 21468180

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 10:04PM PDT, ID: 21468197

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 10:10PM PDT, ID: 21468223

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: C Programming Language
Sign Up Now!
Solution Provided By: sunnycoder
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.29.2008 at 10:12PM PDT, ID: 21468230

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 10:17PM PDT, ID: 21468244

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 10:24PM PDT, ID: 21468261

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 10:27PM PDT, ID: 21468270

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.29.2008 at 10:31PM PDT, ID: 21468284

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628