HP-UX Reference (11i v1 05/09) - 3 Library Functions A-M (vol 6)

d
dlopen(3C) dlopen(3C)
[RTLD_ERR_SIGINHIBIT_FAILED]
siginhibit failed on entry to dld API.
[RTLD_ERR_SIGENABLE_FAILED]
sigenable failed on exit from dld API.
[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_MAGIC_NUM]
Invalid library: bad magic number.
[RTLD_ERR_BAD_DLL_ALIGNMENT]
Invalid library: bad alignment.
[RTLD_ERR_BAD_DLL_NO_SYMTAB]
Invalid library: symbol table missing.
[RTLD_ERR_BAD_DLL_BAD_PHDR]
Invalid library: program header not found.
[RTLD_ERR_BAD_DLL_BAD_MACHINE]
Invalid library: bad machine type.
[RTLD_ERR_BAD_DLL_BAD_OBJFILE]
Invalid library: bad object file type.
[RTLD_ERR_DLDD_COMM_FAILURE]
Library needs a shared fixed address but unable to obtain it from
dldd.
[RTLD_ERR_BAD_DLL_SEGMENT_COUNT]
Library needs a shared fixed address but has multiple data seg-
ments.
[RTLD_ERR_FILTER_TLS] Cannot open filtered library: TLS size exceeds size recorded in
filter.
[RTLD_ERR_DYN_FILTER_STLS_REF]
Library contains a static TLS reference to a symbol defined in a
dynamically loaded library.
[RTLD_ERR_SETCANCELSTATE_FAILED]
__thread_setcancelstate
failed on entry to or exit from
dld API.
[RTLD_ERR_MPROTECT_FAILED]
mprotect() failed for the library.
[RTLD_ERR_DLOPENE_BAD_ADDR]
Invalid load address for segment (dlopene() only).
[RTLD_ERR_PREALLOC_ADDR_NOT_USE]
Cannot use pre-allocated address for mapping library that
requires a fixed address (dlopene() only).
[RTLD_ERR_DLOPENE_NO_EXEC_PERM]
Shared library missing execution permission (dlopene()
only).
[RTLD_ERR_NOMMAP_FAILED] Encounter error while loading library (
dlopene() only).
EXAMPLE
The following example illustrates the use of
dlopene() to load a shared library with an explicit data seg-
ment address. For simplicity, error checking has been omitted.
#include <dlfcn.h>
#include <sys/mman.h>
int main() {
struct dlfileinfo info;
Section 3176 Hewlett-Packard Company 5 HP-UX 11i Version 1: September 2005