This preview shows page 1. Sign up to view the full content.
Unformatted text preview: r example, suppose foo.c calls a function in libx.a that calls a function in liby.a that calls a function in libx.a. Then libx.a must be repeated on the command line:
unix> gcc foo.c libx.a liby.a libx.a Alternatively, we could combine libx.a and liby.a into a single archive. Practice Problem 7.3:
Let a and b denote object modules or static libraries in the current directory, and let a b denote that a depends on b, in the sense that b deﬁnes a symbol that is referenced by a. For each of the following scenarios, show the minimal command line (i.e., one with the least number of ﬁle object ﬁle and library arguments) that will allow the static linker to resolve all symbol references. A. p.o B. p.o C. p.o libx.a. libx.a libx.a liby.a. liby.a and liby.a libx.a p.o. 7.7 Relocation
Once the linker has completed the symbol resolution step, it has associated each symbol reference in the code with exactly one symbol deﬁnition (i.e., a symbol table entry in one of its input object modules). At 366 CHAPTER 7. LINKING this point, the linker knows the exact siz...
View Full Document
This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.
- Spring '10
- The American