HomeFreeBSD

On shared object unload, in __cxa_finalize, call and clear all installed
rS211706Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

On shared object unload, in cxa_finalize, call and clear all installed
atexit and
cxa_atexit handlers that are either installed by unloaded
dso, or points to the functions provided by the dso.

Use _rtld_addr_phdr to locate segment information from the address of
private variable belonging to the dso, supplied by crtstuff.c. Provide
utility function __elf_phdr_match_addr to do the match of address against
dso executable segment.

Call back into libthr from cxa_finalize using weak
pthread_cxa_finalize symbol to remove any atfork handler which
function points into unloaded object.

The rtld needs private __pthread_cxa_finalize symbol to not require
resolution of the weak undefined symbol at initialization time. This
cannot work, since rtld is relocated before sym_zero is set up.

Idea by: kan
Reviewed by: kan (previous version)
MFC after: 3 weeks

Details

Provenance
kibAuthored on
Parents
rS211705: Introduce implementation-private rtld interface _rtld_addr_phdr, which
Branches
Unknown
Tags
Unknown

Event Timeline