[Bug dynamic-link/25486] RFE: Stop exporting free, realloc, calloc, and malloc from ld.so

lzsiga at freemail dot c3.hu sourceware-bugzilla@sourceware.org
Thu Feb 20 16:09:00 GMT 2020


https://sourceware.org/bugzilla/show_bug.cgi?id=25486

--- Comment #11 from Lorinczy Zsigmond <lzsiga at freemail dot c3.hu> ---
Hi, I looked at fpc-SVN where these lines have been added; I think it means the
shared object created by fpc has to depend on _some_ other shared object
(doesn't matter what shared object), to prevent some problem during
finalization. So it doesn't actually imports anything from ld-linux.so, it just
needs a dependendent share-object.

-------------------------------------------------------------------------------
r19036 | tom_at_work | 2011-09-08 23:17:35 +0200 (Thu, 08 Sep 2011) | 27 lines

Fix shared library loading and unloading for Linux platforms.
Shared library initialization and finalization are now called correctly
at program startup for compile-time linked dynamic libraries on
powerpc-/powerpc64-/arm-/i386- and x86_64-linux.

Every startup code must now provide an additional entry point called
"_dynamic_start"
that is set as new the entry point if the program links to a Pascal shared
library.
Its purpose is to set up an exit hook usually passed via a register,
which should be called during program finalization if non-nil.

We use this additional entry point because this register only has meaningful
content
when there are any compile-time linked shared libraries, otherwise it often
contains random garbage.
The difference between the _dynamic_start and the original code is minimal;
actually in all implementations the _dynamic_start code passes on control to
the old startup code,
so we use an additional entry point instead of an additional startup file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list