summaryrefslogtreecommitdiffhomepage
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-21 01:57:13 +0000
committermidipix <writeonce@midipix.org>2024-02-21 03:24:48 +0000
commitaf35a17870c2fcb8689b6b67089b41697a5d30c1 (patch)
treea2563e376da21a42be0662ccd1c53556bdb1c585 /src/logic
parentf420747a94d043196cc10c98eaa89c6a3b1e6cc6 (diff)
downloadslibtool-af35a17870c2fcb8689b6b67089b41697a5d30c1.tar.bz2
slibtool-af35a17870c2fcb8689b6b67089b41697a5d30c1.tar.xz
link mode: implemented -export-symbols (for all supported flavors).
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/linkcmd/slbt_linkcmd_dsolib.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/logic/linkcmd/slbt_linkcmd_dsolib.c b/src/logic/linkcmd/slbt_linkcmd_dsolib.c
index 38ecbd3..00705a1 100644
--- a/src/logic/linkcmd/slbt_linkcmd_dsolib.c
+++ b/src/logic/linkcmd/slbt_linkcmd_dsolib.c
@@ -72,6 +72,7 @@ slbt_hidden int slbt_exec_link_create_library(
char output [PATH_MAX];
char soname [PATH_MAX];
char symfile[PATH_MAX];
+ char mapfile[PATH_MAX];
struct slbt_deps_meta depsmeta = {0,0,0,0};
/* initial state */
@@ -198,6 +199,31 @@ slbt_hidden int slbt_exec_link_create_library(
*ectx->symfile = symfile;
}
+ /* -export-symbols */
+ if (dctx->cctx->expsyms) {
+ struct slbt_symlist_ctx * sctx;
+ sctx = (slbt_get_exec_ictx(ectx))->sctx;
+
+ if (slbt_util_create_mapfile(sctx,ectx->mapfilename,0644) < 0)
+ return SLBT_NESTED_ERROR(dctx);
+
+ 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";