Cleanup shared-object support mechanics

The former ldso-startup static library (now called ldso_so_support) is
used to spice each shared object/library with local support code for the
dynamic linker (execution of static constructors and ARM-EABI).
Therefore, the library must be statically linked to each dynamic
library.

As a result recipes for dynamic libraries must always depend on the "so"
API, which makes ldso_so_support.mk and so_support.c available
independent of "base". Additionally, ldso_so_support is also provided in
the libc API to cut the dependency early for libc/posix libraries.

Issue #3720
This commit is contained in:
Christian Helmuth
2020-04-02 08:19:34 +02:00
committed by Norman Feske
parent 589b416ca8
commit 42fddf8390
14 changed files with 95 additions and 109 deletions

View File

@@ -181,10 +181,11 @@ $(LIB_A): $(OBJECTS)
$(VERBOSE)$(AR) -rcs $@ $(OBJECTS)
#
# Link ldso-startup library to each shared library
# Link ldso-support library to each shared library to provide local hook
# functions for constructors and ARM
#
ifdef SHARED_LIB
override ARCHIVES += ldso-startup.lib.a
override ARCHIVES += ldso_so_support.lib.a
endif
#
@@ -208,10 +209,6 @@ STATIC_LIBS_BRIEF := $(subst $(LIB_CACHE_DIR),$$libs,$(STATIC_LIBS))
# (LIB_SO_DEPS) to the library to store the library-dependency information in
# the generated shared object.
#
# The 'ldso-startup/startup.o' object file, which contains the support code for
# constructing static objects must be specified as object file to prevent the
# linker from garbage-collecting it.
#
#
# Default entry point of shared libraries