23 Libraries

23 Libraries - CMSC 216 Introduction to Computer Systems...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CMSC 216 Introduction to Computer Systems Lecture 23 Libraries Jan Plane & Pete Keleher {jplane, [email protected] Administrivia • Read Sections 2.2-2.4 of Bryant and O’Hallaron on data representation • Final Exam Thursday, May 12 4:00-6:00 pm ARM 0126 CMSC 216 - Wood, Sussman, Herman, Plane 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
L IBRARIES ( CONT .) Sections 7.6-7.13, Bryant and O'Hallaron CMSC 216 - Wood, Sussman, Herman, Plane 3 Types of libraries • Static libraries (extension .a , for "archive") – are linked into a program as part of the linking phase of compilation – require space in each executable that uses them, which uses disk space, and memory space during execution – updating a library requires recompiling (relinking) all applications using it – are easy to use • Shared libraries (extension .so , for "shared object") – are linked into a program at program startup, or during execution – require only one copy for the entire system – libraries can be updated independent of applications – must have version numbers associated with them, to control which version works with which applications 4 CMSC 216 - Wood, Sussman, Herman, Plane
Background image of page 2
Ways to Load Libraries During Linking Explicit on the compile line -l (and –L) on the compile line During Execution Loaded into an application at program startup by using LD_LIBRARY_PATH to find the so file it needs Loaded into an application during execution, not just at program startup – Enables an application to load different libraries (functions) depending upon input while it's running – Dynamically loading a library is more work for the programmer: dynamically loading a library requires that it first be explicitly opened by the program, and everything from the library that is then used must be explicitly looked up and loaded into memory 5 CMSC 216 - Wood, Sussman, Herman, Plane Creating a static library
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/16/2011 for the course CMSC 216 taught by Professor Plane during the Spring '11 term at Maryland.

Page1 / 8

23 Libraries - CMSC 216 Introduction to Computer Systems...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online