D a relocated text section codelinkpdata exed 1 2 3 4

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } (a) REF(main.1) --> DEF(_____.___) 7.6. SYMBOL RESOLUTION (b) REF(main.2) --> DEF(_____.___) B. /* Module 1 */ void main() { } /* Module 2 */ int main=1; int p2() { } (a) REF(main.1) --> DEF(_____.___) (b) REF(main.2) --> DEF(_____.___) 361 /* Module 2 */ C. /* Module 1 */ double x=1.0; int x; int p2() void main() { { } } (a) REF(x.1) --> DEF(_____.___) (b) REF(x.2) --> DEF(_____.___) 7.6.2 Linking with Static Libraries So far we have assumed that the linker reads a collection of relocatable object files and links them together into an output executable file. In practice, all compilation systems provide a mechanism for packaging related object modules into a single file called a static library, which can then be supplied as input to the linker. When it builds the output executable, the linker copies only the object modules in the library that are referenced by the application program. Why do systems support the notion of libraries? Consider ANSI C, which defines an extensive collection of standard I/O, string manipulation, and integer math functions such as atoi, printf,...
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.

Ask a homework question - tutors are online