HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 48 (of 101)
Chapter 11 Software Development
October 29, 2013
Tools
The tools to look at in this workshop can be divided into three categories:
1. Development utilities
2. Tools for obtaining static information
3. Tools for runtime analysis
In the Development Utilities section we will look at build process management and versioning
tools.
Static information is considered to be properties of files in general. These tools look into binary
files to get information about versions, required libraries, symbols etc.
Runtime analysis tools can obtain information from running processes like executed instructions,
system calls and open files.
This section will only give a short view over the tools available. It cannot describe them in detail
because some of the tools would require a separate workshop to discuss them in depth.
Development Utilities
ar(1)
Big applications usually are made of a large number of objects. To organize them, ar(1) can
package them into archives which can be treated as libraries by the linker. Unlike tar(1), ar(1)
also stores a symbol table inside the library, that contains the symbols of all objects. At link time
these libraries can be passed to ld(1) in the same way as shared libraries:
$ ar -r libmylib.a x.o y.o z.o
$ cc HelloWorld.o -lmylib
The ar(1) command creates an archive library and adds the specified objects to it. cc(1) passes
HelloWorld.o and the option -lmylib to the linker which in turn extracts libmylib.a and links
all required objects into the executable.
ar(1) belongs to the linker tools.