summaryrefslogtreecommitdiff
path: root/src/logic/slbt_exec_link.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-09-14 18:48:21 -0400
committermidipix <writeonce@midipix.org>2016-09-14 18:50:43 -0400
commit2f9f52a1648cc5da9a4dbb8eb06d0cc1ea55a82c (patch)
treec51ed8a0d7a67c86716548c7e08bc1abea987f0a /src/logic/slbt_exec_link.c
parent8f07c59b89632f15559720c95e994d512219a0ff (diff)
downloadslibtool-2f9f52a1648cc5da9a4dbb8eb06d0cc1ea55a82c.tar.bz2
slibtool-2f9f52a1648cc5da9a4dbb8eb06d0cc1ea55a82c.tar.xz
link mode: soname: properly handle -module when output begins with dso prefix.
Diffstat (limited to 'src/logic/slbt_exec_link.c')
-rw-r--r--src/logic/slbt_exec_link.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index be46fab..178335a 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -912,7 +912,7 @@ static int slbt_exec_link_create_library(
(void)0;
} else if (!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION)) {
if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s%s.%d",
- dctx->cctx->settings.dsoprefix,
+ ectx->sonameprefix,
dctx->cctx->libname,
dctx->cctx->settings.dsosuffix,
dctx->cctx->verinfo.major)
@@ -923,7 +923,7 @@ static int slbt_exec_link_create_library(
*ectx->lsoname = soname;
} else if (relfilename) {
if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s-%s%s",
- dctx->cctx->settings.dsoprefix,
+ ectx->sonameprefix,
dctx->cctx->libname,
dctx->cctx->release,
dctx->cctx->settings.dsosuffix)
@@ -1240,29 +1240,37 @@ int slbt_exec_link(
if (dctx->cctx->drvflags & SLBT_DRIVER_DRY_RUN)
return 0;
+ /* context */
+ if (ectx)
+ actx = 0;
+ else if ((ret = slbt_get_exec_ctx(dctx,&ectx)))
+ return SLBT_NESTED_ERROR(dctx);
+ else
+ actx = ectx;
+
/* libfoo.so.x.y.z */
if ((size_t)snprintf(soxyz,sizeof(soxyz),"%s%s%s.%d.%d.%d",
- dctx->cctx->settings.dsoprefix,
+ ectx->sonameprefix,
dctx->cctx->libname,
dctx->cctx->settings.dsosuffix,
dctx->cctx->verinfo.major,
dctx->cctx->verinfo.minor,
dctx->cctx->verinfo.revision)
- >= sizeof(soxyz))
+ >= sizeof(soxyz)) {
+ slbt_free_exec_ctx(actx);
return SLBT_BUFFER_ERROR(dctx);
+ }
/* libfoo.so.x */
sprintf(soname,"%s%s%s.%d",
- dctx->cctx->settings.dsoprefix,
+ ectx->sonameprefix,
dctx->cctx->libname,
dctx->cctx->settings.dsosuffix,
dctx->cctx->verinfo.major);
/* libfoo.so */
sprintf(solnk,"%s%s%s",
- (dctx->cctx->drvflags & SLBT_DRIVER_MODULE)
- ? ""
- : dctx->cctx->settings.dsoprefix,
+ ectx->sonameprefix,
dctx->cctx->libname,
dctx->cctx->settings.dsosuffix);
@@ -1272,14 +1280,6 @@ int slbt_exec_link(
dctx->cctx->libname,
dctx->cctx->settings.arsuffix);
- /* context */
- if (ectx)
- actx = 0;
- else if ((ret = slbt_get_exec_ctx(dctx,&ectx)))
- return SLBT_NESTED_ERROR(dctx);
- else
- actx = ectx;
-
/* output suffix */
output = dctx->cctx->output;
dot = strrchr(output,'.');