CSCI.4210 Operating Systems
Fall, 2004
Exercise 2.1, The Linker

The following two programs are compiled separately and then linked together to create an executable file by the linker. Show the contents of the definition table and the use table for One.o and Two.o. One.c
extern int a(int);
extern int b;
int c;

int d(int x) 
{
   int y;
   y = x * 2;
   return y;
}

int main()
{
   int e;
   c = 7;
   b = a(c);
   e = d(b);
   printf("%d\n",b);
   return 0;
}

Two.c
int b;
int d(int);
int a(int x)
{
   int z;
   z = d(x);
   return z;
}

RCS email: @rpi.edu