summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-04-08 15:44:25 +0000
committermidipix <writeonce@midipix.org>2021-04-08 15:44:25 +0000
commit3174324e035bd0621ca464adb175bb652cc3f301 (patch)
tree67b1bd8c6ea29f28b2a0ee8222a132d79c6a5fef
parent9c5a301fe8f9f29010a625ac5e7f32d789af1a34 (diff)
downloadslibtool-3174324e035bd0621ca464adb175bb652cc3f301.tar.bz2
slibtool-3174324e035bd0621ca464adb175bb652cc3f301.tar.xz
link mode: set the -soname linker flag alongside the -avoid-version argument.
-rw-r--r--src/logic/slbt_exec_link.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index f47f01c..8b8efa2 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -1457,7 +1457,18 @@ static int slbt_exec_link_create_library(
*ectx->soname = "-Wl,-soname";
*ectx->lsoname = soname;
- } else if (!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION)) {
+ } else if (dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION) {
+ if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s%s",
+ ectx->sonameprefix,
+ dctx->cctx->libname,
+ dctx->cctx->settings.dsosuffix)
+ >= sizeof(soname))
+ return SLBT_BUFFER_ERROR(dctx);
+
+ *ectx->soname = "-Wl,-soname";
+ *ectx->lsoname = soname;
+
+ } else {
if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s%s.%d%s",
ectx->sonameprefix,
dctx->cctx->libname,