This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ation programmers could link into their executables:
unix> gcc main.c /usr/lib/libc.o This approach has the advantage that it would decouple the implementation of the standard functions from the implementation of the compiler, and would still be reasonably convenient for programmers. However, a 362 CHAPTER 7. LINKING big disadvantage is that every executable ﬁle in a system would now contain a complete copy of the collection of standard functions, which would be extremely wasteful of disk space. (On a typical system, libc.a is about 8 MB and libm.a is about 1 MB.) Worse, each running program would now contain its own copy of these functions in memory, which would be extremely wasteful of memory. Another big disadvantage is that any change to any standard function, no matter how small, would require the library developer to recompile the entire source ﬁle, a time-consuming operation that would complicate the development and maintenance of the standard functions. We could address some of these problems by creating a separate relocatable ﬁle for each standard function and storing them in a well-known directory. However thi...
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