Write a linker for object modules produced by the as611 assembler. The linker should take two object modules, bind them together, resolve external references, and output the result as one object module.
The two input filenames will be given on the command line. The output filename should be a.exe.
If the output object module does not have an empty outsymbol table, print to stderr the names of all undefined symbols. Also, if there is a duplicate symbol, write an error message.
Here are the steps the linker should perform:
Actually there is a subtle bug in the above description concerning the end-of-list marker in the outsymbol linked lists. Think about it!
Use the symbol table routines from as611 for the linker's symbol table.
Look in ~cs611/public/prog3 for direction on how the source code will be organized. Your task is to complete the `link' function in the file link.c.
Six public test cases (pairs of assembly language source files) are available in ~cs611/public/prog3/tests. Each case tests a different aspect of the assignment. Read the file TESTS for information about the test cases. Most of these cases are simply meant to be used to test the linker and the output is not intended to be executed by sim611. One hidden test case will be used to test error handling and other items not covered in the public files. All test files will have equal weight for grading purposes.
Your implementation must be performed using C.
Your program will be graded primarily by testing it for correct functionality. However, you may lose points if your program is not properly structured or adequately documented.
Your code should be submitted for grading from a
CIS Alpha machine (e.g. cisunix.unh.edu).
To turn in this assignment, type:
~cs611/bin/submit prog3 link.c
Do not turn in any other files!
Submissions can be checked by typing:
~cs611/bin/scheck prog3
To receive full credit for the assignment, you must turn in your files prior to 8am on Monday October 15. Late submissions will be accepted at the penalty of 5 points per day up to one week late.
Your programs will be graded using an Intel IA-32 Linux machine (e.g. kng509.unh.edu) so be sure to test in that environment.
Remember: as always you are expected to do your own work on this assignment.
Comments and questions should be directed to pjh@cs.unh.edu