3.3.1 Important Points in Using Unlink
When a module is being unlinked, dld tries to clean up as much as
it can to restore the executing process to a state as if this module has
never been linked. This clean up includes removing and reclaiming the
memory for storing the text and data segment of the module, and
un-defining any global symbols defined by this module.
However, side effects--such as modification of global variables,
input/output operations, and allocations of new memory blocks--caused
by the execution of any function in this module are not reversed. Thus,
it is the responsibility of the programmer to explicitly carry out all
necessary clean up operations before unlinking a module.