HP.com home PA-RISC Procedure Calling Conventions Reference Manual > Appendix D The Stack Unwind Process

D.3 Unwinding From Stubs on HP-UX

MPE documents

Complete PDF
Table of Contents

A few HP-UX specific stubs have been designed to support the shared library mechanism. Calls to external routines in HP-UX will return via an export stub. The call itself will go through an import stub, similar to the calling and called stubs of Chapter 5. The import stub stores the following registers: RP (at SP - 24) and gr19 (at SP - 32).

In the HP-UX shared library implementation, gr19 plays the role of the shared library link register. It points to a shared library descriptor. This descriptor contains a pointer to the location where the unwind tables and stub tables are located. Note that each shared library has its own tables.

When unwinding through the HP-UX-export stub, the. registers RP and gr19 are restored from the stack. In most normal cases, the RP that is restored will point to the caller. But in one particular case, the RP value has the address of the export stub for _sigreturn(). This happens only when the stack frame has an interrupt-marker on it, which means that a trap occurred and you are unwinding from a trap handler.

Note that these stubs will not be encountered when unwinding in the absence of shared libraries. In this case, gr19 will play the normal role of a caller-save register only.




D.2 Unwinding From Stubs on MPE XL


D.4 Unwinding From Millicode