genode/repos/base/lib/mk/ld-platform.inc
Norman Feske 9ea4a491d6 ld: generate symbol map from base/lib/symbols/ld
This patch removes the manually maintained symbol map from the dynamic
linker. This way, the symbol map stays in sync with the ABI and - more
importantly - no longer uses wildcards. So the symbols exported by the
dynamic linker are strictly limited by the ABI.

Issue #2190
2016-12-23 16:53:17 +01:00

47 lines
1.0 KiB
Makefile

SHARED_LIB = yes
DIR = $(BASE_DIR)/src/lib/ldso
LIB_IS_DYNAMIC_LINKER = yes
include $(BASE_DIR)/mk/base-libs.mk
LIBS = $(BASE_LIBS)
SRC_CC = main.cc test.cc exception.cc dependency.cc debug.cc \
shared_object.cc
SRC_S = jmp_slot.s
INC_DIR += $(DIR)/include
INC_DIR += $(BASE_DIR)/src/include
LD_OPT += -Bsymbolic-functions --version-script=symbol.map
#
# Generate symbol map from the ABI
#
$(LIB).lib.so: symbol.map
symbol.map: $(MAKEFILE_LIST)
symbol.map: $(BASE_DIR)/lib/symbols/ld
$(MSG_CONVERT)$@
$(VERBOSE)(echo -e "{\n\tglobal:";\
sed -n "s/^\(\w\+\) .*/\t\t\1;/p" $<;\
echo -e "\tlocal: *;\n};") > $@
ifneq ($(filter linux, $(SPECS)),)
ENTRY_POINT = _start_initial_stack
LD_OPT += -T$(call select_from_repositories,src/ld/stack_area.nostdlib.ld) \
ifneq ($(filter x86_32, $(SPECS)),)
LD_OPT += -T$(DIR)/linux-32.ld
endif
else
ENTRY_POINT = _start
LD_OPT += -T$(DIR)/linker.ld
endif
include $(BASE_DIR)/lib/import/import-ld.mk
vpath %.cc $(DIR)
# vi:ft=make