HP-UX Architecture Conventions

Shared Libraries

Shared Libraries

The field selectors T', LT', and RT' are used to write position-independent code in assembly language. When you use these selectors and invoke the Assembler with the as command, you must use the +z or +Z compiler option on the command line.

Any assembly code that is to be used with shared libraries must follow the standard procedure call mechanism as defined in the runtime architecture documents under the topic PA-RISC Architecture at URL: http://www.software.hp.com/STK/. Any external procedures must be exported as type ENTRY for the shared library interface to work correctly.

For more information on position-independent code and shared libraries, refer to the HP-UX Linker and Libraries Online User Guide and the ELF 64 Object File Format, URL: http://www.software.hp.com/STK/.

Assembly Listing

The Assembler command-line option, -l, causes an assembly listing to standard output. For each line of source code, the listing provides:

line number

the subspace offset

the hexadecimal representation of the assembled code (possibly flagged with an asterisk (*) to indicate address relocation)

the source text

any comments.

The following is a line of assembly language as it appears in the source file:

SAVE

LDO

VAL(%r0),%r20

;retain value

The above line would appear in the assembly listing as follows:

line no. offset

hex representation

label

opcode

operands

comment

16

0000004c

(341400A)

SAVE

LDO

VAL(%r0),%r20

;retain value

Chapter 3

51