summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-23 06:30:54 +0000
committermidipix <writeonce@midipix.org>2024-02-23 06:30:54 +0000
commitac4a1be9a6897a4843f6a93c1e27a9e603b44623 (patch)
tree7249f369371c94d2a769f34a56a483c3b8d525bf
parentf4ad2465582e82a72e8b5cf06933b82b14fd45d8 (diff)
downloadslibtool-ac4a1be9a6897a4843f6a93c1e27a9e603b44623.tar.bz2
slibtool-ac4a1be9a6897a4843f6a93c1e27a9e603b44623.tar.xz
link mode: always create a symbol list (.exp) alongside a shared library.
-rw-r--r--src/logic/linkcmd/slbt_linkcmd_argv.c57
1 files changed, 35 insertions, 22 deletions
diff --git a/src/logic/linkcmd/slbt_linkcmd_argv.c b/src/logic/linkcmd/slbt_linkcmd_argv.c
index 6ad75bb..321d7d0 100644
--- a/src/logic/linkcmd/slbt_linkcmd_argv.c
+++ b/src/logic/linkcmd/slbt_linkcmd_argv.c
@@ -672,31 +672,44 @@ static int slbt_exec_link_create_expsyms_archive(
if (slbt_ar_get_archive_ctx(dctx,output,&arctx) < 0)
return SLBT_NESTED_ERROR(dctx);
- ret = slbt_ar_create_mapfile(
- arctx->meta,
- ectx->mapfilename,
- 0644);
-
/* .expsyms.a --> .exp */
- if (ret == 0) {
- *dot = '\0';
-
- if ((dot = strrchr(output,'.'))) {
- dot[1] = 'e';
- dot[2] = 'x';
- dot[3] = 'p';
- dot[4] = '\0';
-
- ret = slbt_ar_create_symfile(
- arctx->meta,
- output,
- 0644);
- }
+ if ((*dot = '\0'), !(dot = strrchr(output,'.'))) {
+ slbt_ar_free_archive_ctx(arctx);
+ return SLBT_CUSTOM_ERROR(
+ dctx,
+ SLBT_ERR_FLOW_ERROR);
+ }
+
+ dot[1] = 'e';
+ dot[2] = 'x';
+ dot[3] = 'p';
+ dot[4] = '\0';
+
+ /* symfile */
+ if (dctx->cctx->expsyms) {
+ struct slbt_symlist_ctx * sctx;
+ sctx = (slbt_get_exec_ictx(ectx))->sctx;
+
+ ret = slbt_util_create_symfile(
+ sctx,output,0644);
+ } else {
+ ret = slbt_ar_create_symfile(
+ arctx->meta,
+ output,
+ 0644);
+ }
+
+ /* mapfile */
+ if ((ret == 0) && (dctx->cctx->regex)) {
+ ret = slbt_ar_create_mapfile(
+ arctx->meta,
+ ectx->mapfilename,
+ 0644);
}
slbt_ar_free_archive_ctx(arctx);
- return ((ret < 0) && dot) ? SLBT_NESTED_ERROR(dctx) : 0;
+ return (ret < 0) ? SLBT_NESTED_ERROR(dctx) : 0;
}
@@ -889,8 +902,8 @@ slbt_hidden int slbt_exec_link_finalize_argument_vector(
}
}
- /* export-symbols-regex */
- if (dctx->cctx->regex)
+ /* export-symbols-regex, proper dlpreopen support */
+ if (dctx->cctx->libname)
if (slbt_exec_link_create_expsyms_archive(
dctx,ectx,lobjv,cnvlv) < 0)
return SLBT_NESTED_ERROR(dctx);