summaryrefslogtreecommitdiff
path: root/src/logic/linkcmd/slbt_linkcmd_dsolib.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-22 13:40:56 +0000
committermidipix <writeonce@midipix.org>2024-02-22 13:47:14 +0000
commit752c02b178233ce8dbee73ebf4cab8a6759c8d12 (patch)
treeb92781647aafab4c92f452edf59960e2613d4c13 /src/logic/linkcmd/slbt_linkcmd_dsolib.c
parent279932401cb1e799f2e8bdae7eae47b788c3001d (diff)
downloadslibtool-752c02b178233ce8dbee73ebf4cab8a6759c8d12.tar.bz2
slibtool-752c02b178233ce8dbee73ebf4cab8a6759c8d12.tar.xz
link mode: implemented -export-symbols-regex (for all supported flavors).
Diffstat (limited to 'src/logic/linkcmd/slbt_linkcmd_dsolib.c')
-rw-r--r--src/logic/linkcmd/slbt_linkcmd_dsolib.c20
1 files changed, 20 insertions, 0 deletions
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";