From 752c02b178233ce8dbee73ebf4cab8a6759c8d12 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 22 Feb 2024 13:40:56 +0000 Subject: link mode: implemented -export-symbols-regex (for all supported flavors). --- src/logic/linkcmd/slbt_linkcmd_dsolib.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/logic/linkcmd/slbt_linkcmd_dsolib.c') diff --git a/src/logic/linkcmd/slbt_linkcmd_dsolib.c b/src/logic/linkcmd/slbt_linkcmd_dsolib.c index 00705a1..4d611a0 100644 --- a/src/logic/linkcmd/slbt_linkcmd_dsolib.c +++ b/src/logic/linkcmd/slbt_linkcmd_dsolib.c @@ -224,6 +224,26 @@ slbt_hidden int slbt_exec_link_create_library( } } + /* -export-symbols-regex; and see also: */ + /* slbt_exec_link_create_expsyms_archive() */ + if (dctx->cctx->regex) { + if (slbt_snprintf(mapfile,sizeof(mapfile), + "-Wl,%s", + ectx->mapfilename) < 0) + return SLBT_BUFFER_ERROR(dctx); + + if (slbt_host_group_is_darwin(dctx)) { + *ectx->explarg = "-Wl,-exported_symbols_list"; + *ectx->expsyms = mapfile; + + } else if (slbt_host_group_is_winnt(dctx)) { + *ectx->expsyms = mapfile; + } else { + *ectx->explarg = "-Wl,--version-script"; + *ectx->expsyms = mapfile; + } + } + /* shared/static */ if (dctx->cctx->drvflags & SLBT_DRIVER_ALL_STATIC) { *ectx->dpic = "-static"; -- cgit v1.2.3