diff --git a/repos/base/lib/mk/ld-platform.inc b/repos/base/lib/mk/ld-platform.inc index a434c8329..f1ccab2f6 100644 --- a/repos/base/lib/mk/ld-platform.inc +++ b/repos/base/lib/mk/ld-platform.inc @@ -11,7 +11,18 @@ SRC_CC = main.cc test.cc exception.cc dependency.cc debug.cc \ SRC_S = jmp_slot.s INC_DIR += $(DIR)/include INC_DIR += $(BASE_DIR)/src/include -LD_OPT += -Bsymbolic-functions --version-script=$(DIR)/symbol.map +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)),) diff --git a/repos/base/lib/mk/ld.mk b/repos/base/lib/mk/ld.mk index 09ae1de84..f5094ee57 100644 --- a/repos/base/lib/mk/ld.mk +++ b/repos/base/lib/mk/ld.mk @@ -19,7 +19,6 @@ SYMBOLS := $(BASE_DIR)/lib/symbols/ld SHARED_LIB := yes -LD_OPT += -Bsymbolic-functions --version-script=$(BASE_DIR)/src/lib/ldso/symbol.map LD_OPT += -T$(BASE_DIR)/src/lib/ldso/linker.ld symbols.s: $(MAKEFILE_LIST) diff --git a/repos/base/src/lib/ldso/symbol.map b/repos/base/src/lib/ldso/symbol.map deleted file mode 100644 index 0cbd41934..000000000 --- a/repos/base/src/lib/ldso/symbol.map +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Symbols exported by the ld.lib.so - */ -{ - global: - - /* We export all C++ symbols with prefix Genode::, as well as all vtables, - * type informations and operators new and delete - */ - extern "C++" { - Genode::*; - *typeinfo*; - vtable*; - init_exception_handling*; - operator*new*; - operator*delete*; - genode_atexit*; - genode_exit*; - genode___cxa_finalize*; - genode_envp; - genode_argv; - genode_argc; - }; - __dynamic_cast; - - /* - * Symbols for calls generated by the compiler (i.e., on ARM), and - * provided by the C++ runtime. - */ - memcpy; - memset; - memmove; - - /* - * Debugging - */ - wait_for_continue; - stdout_write; - stdout_reconnect; - - /* Testing */ - extern "C++" { - __ldso_raise_exception*; - }; - - /* GNU verbose terminate handler */ - extern "C++" { __gnu_cxx::__verbose_terminate_handler*; }; - - extern "C++" { std::terminate*; }; - extern "C++" { std::bad_exception*; }; - extern "C++" { std::exception*; }; - extern "C++" { std::uncaught_exception*; }; - - /* x86 */ - __cxa*; - _Unwind_Complete; - _Unwind_DeleteException; - _Unwind_Resume; - __gxx_personality_v0; - dl_iterate_phdr; - - /* ARM */ - __aeabi_*; - dl_unwind_find_exidx; - - /* - * Kernel specific symbols - */ - - /* Fiasco.OC */ - l4_utcb_wrap; - __l4_sys_direct_sycalls; - l4_atomic_cmpxchg; - - extern "C++" { - main_thread_utcb*; - }; - - /* Linux */ - lx_syscall; - - /* Linux hybrid */ - lx_environ; - - /* Base HW */ - extern "C++" { - Kernel::*; - }; - - /* Pistachio */ - __L4_ThreadSwitch; - __L4_Ipc; - - local: - - /* - * Everything else is local - */ - *; -};