dlopen_pa.3c (2010 09)
d
dlopen_pa(3C)
PA-RISC Systems Only
dlopen_pa(3C)
externally visible symbols are typically exported: specifically those referenced by the shared objects with
which the a.out is linked.
The exact set of exported symbols for any shared object or the
a.out can be controlled using the linker
(see ld(1)).
HP 9000 64-bit dlopene()
The dlopen_opts structure has the following members:
struct dlopen_opts {
long flags;
char* text_addr;
char* data_addr;
};
flags contains the load option, defined by the logical OR of the following values:
RTLD_EXT_TEXT_ADDR
Indicates that an explicit base address for the shared library text segment is pro-
vided.
RTLD_EXT_DATA_ADDR
Indicates that an explicit base address for the shared library private data segment
is provided.
RTLD_EXT_DATA_NO_ZERO_FILL
If this flag is set, dlopene() does not zero fill the bss part of the data segment.
This may improve load time for libraries with large bss sections.
This flag is only valid with
RTLD_EXT_DATA_ADDR
.
The dynamic loader only accesses the address fields that are specified by the flags fields.
text_addr contains the explicit base address for the shared library’s text segment.
data_addr contains the explicit base address for the shared library’s data segment.
Both the text_addr and data_addr must be aligned at a 16-byte boundary.
The caller can invoke
dlgetfileinfo()
to obtain the information needed to allocate memory for the
load segments.
The caller of
dlopene() is responsible for allocating memory with the appropriate permission:
• READ, WRITE and EXECUTE (RWX) permission for text_addr .
• READ and WRITE (RW) permission for data_addr .
RETURN VALUE
If file cannot be found, cannot be opened for reading, is not a shared object, or if an error occurs during
the process of loading file or relocating its symbolic references,
dlopen() returns NULL. More detailed
diagnostic information is available through dlerror() or dlerrno() (64-bit only).
ERRORS
If
dlopen() or dlopene() fails, a subsequent call to dlerrno() returns one of the following values:
[RTLD_ERR_BAD_ABI1] 64-bit program found a 32-bit shared library.
[RTLD_ERR_BAD_ABI2] 32-bit program found a 64-bit shared library.
[RTLD_ERR_BAD_DLL] Not a valid library.
[RTLD_ERR_BAD_DLL_ALIGNMENT] Invalid library: bad alignment.
[RTLD_ERR_BAD_DLL_BAD_MACHINE] Invalid library: bad machine type.
[RTLD_ERR_BAD_DLL_BAD_PHDR] Invalid library: program header not found.
[RTLD_ERR_BAD_DLL_BAD_OBJFILE] Invalid library: bad object file type.
[RTLD_ERR_BAD_DLL_MAGIC_NUM] Invalid library: bad magic number.
[RTLD_ERR_BAD_DLL_NO_SYMTAB] Invalid library: symbol table missing.
4 Hewlett-Packard Company − 4 − HP-UX 11i Version 3: September 2010