HP Encourages Your Comments

HP encourages your comments concerning this document. We are committed to providing documentation that meets your needs. Send any errors found, suggestions for improvement, or compliments to:

feedback@fc.hp.com

Include the document title, manufacturing part number, and any comment, error found, or suggestion for improvement you have concerning this document.

Document Organization

This guide is organized into the following chapters:

This document is organized as follows:

“Compiling and Linking Programs on HP-UX” (page 16)

This chapter describes the process of compiling and linking programs on HP-UX. An example is used to illustrate the process. The sections here describe the process of creating an executable file and explain how ld creates an executable file from one or more object files. This chapter also describes the conventions for using libraries with ld, describes the process of loading and binding programs at run time, and explains the thread-safe features of linker. In addition, it explains the means by which you can control how the linker links your programs or libraries.

“Determining How to Link Programs or Libraries (Linker Tasks)” (page 27)

This chapter describes the tasks you can perform using the Compiler commands and Linker commands. The tasks help you determine how the linker must link your program or library.

“Linker Tools for Itanium-Based Systems” (page 53)

This chapter describes the linker toolset available for IA systems. The linker toolset provides several tools to help you find symbols, display and modify object files, and determine link order.

“Linker Tools for PA-RISC Systems” (page 69)

This chapter describes the linker toolset available for PA-RISC systems. The linker toolset provides several tools to help you find symbols, display and modify object files, and determine link order.

“Linker Toolset Differences Between PA-RISC and Itanium-Based Systems” (page 79)

This chapter describes some of the linker toolset differences between PA-RISC and Itanium-based systems. This chapter also describes linker options specific to PA64 mode, symbols reserved by linker, system library location, changes to the library name extension, and dynamic path searching for shared libraries.

“Creating and Using Libraries” (page 89)

This chapter provides an overview of shared and archived libraries, explains creating and using libraries on HP-UX, and describes how to use shared libraries for programs in IA.

“Shared Library Management Routines” (page 136)

This chapter explains shared library header files, initializers for shared libraries, and the various shared library management routines.

“Writing and Generating Position-Independent Code” (page 185)

This chapter is applicable to only PA-RISC 32-bit applications. The chapter explains relocatable object code, absolute object code, and position-independent code. The chapter also explains how to generate position-independent code.

14