summaryrefslogtreecommitdiff
path: root/src/logic
diff options
context:
space:
mode:
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/slbt_exec_ctx.c22
-rw-r--r--src/logic/slbt_exec_link.c34
2 files changed, 51 insertions, 5 deletions
diff --git a/src/logic/slbt_exec_ctx.c b/src/logic/slbt_exec_ctx.c
index 9ff962c..213a9fa 100644
--- a/src/logic/slbt_exec_ctx.c
+++ b/src/logic/slbt_exec_ctx.c
@@ -413,6 +413,28 @@ int slbt_get_exec_ctx(
/* relfilename */
if (dctx->cctx->release) {
ictx->ctx.relfilename = ch;
+ ch += dctx->cctx->verinfo.verinfo
+ ? sprintf(ch,"%s%s%s-%s%s.%d.%d.%d",
+ ictx->ctx.ldirname,
+ dsoprefix,
+ dctx->cctx->libname,
+ dctx->cctx->release,
+ dctx->cctx->settings.dsosuffix,
+ dctx->cctx->verinfo.major,
+ dctx->cctx->verinfo.minor,
+ dctx->cctx->verinfo.revision)
+ : sprintf(ch,"%s%s%s-%s%s",
+ ictx->ctx.ldirname,
+ dsoprefix,
+ dctx->cctx->libname,
+ dctx->cctx->release,
+ dctx->cctx->settings.dsosuffix);
+ ch++;
+ }
+
+ /* dsorellnkname */
+ if (dctx->cctx->release) {
+ ictx->ctx.dsorellnkname = ch;
ch += sprintf(ch,"%s%s%s-%s%s",
ictx->ctx.ldirname,
dsoprefix,
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index f49574e..1b632bd 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -1115,10 +1115,12 @@ static int slbt_exec_link_create_library(
/* -soname */
if ((dctx->cctx->drvflags & SLBT_DRIVER_IMAGE_MACHO)) {
(void)0;
- } else if (!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION)) {
- if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s%s.%d",
+
+ } else if (relfilename && dctx->cctx->verinfo.verinfo) {
+ if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s-%s%s.%d",
ectx->sonameprefix,
dctx->cctx->libname,
+ dctx->cctx->release,
dctx->cctx->settings.dsosuffix,
dctx->cctx->verinfo.major)
>= sizeof(soname))
@@ -1126,6 +1128,7 @@ static int slbt_exec_link_create_library(
*ectx->soname = "-Wl,-soname";
*ectx->lsoname = soname;
+
} else if (relfilename) {
if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s-%s%s",
ectx->sonameprefix,
@@ -1137,6 +1140,18 @@ static int slbt_exec_link_create_library(
*ectx->soname = "-Wl,-soname";
*ectx->lsoname = soname;
+
+ } else if (!(dctx->cctx->drvflags & SLBT_DRIVER_AVOID_VERSION)) {
+ if ((size_t)snprintf(soname,sizeof(soname),"-Wl,%s%s%s.%d",
+ ectx->sonameprefix,
+ dctx->cctx->libname,
+ dctx->cctx->settings.dsosuffix,
+ dctx->cctx->verinfo.major)
+ >= sizeof(soname))
+ return SLBT_BUFFER_ERROR(dctx);
+
+ *ectx->soname = "-Wl,-soname";
+ *ectx->lsoname = soname;
}
/* PE: --output-def */
@@ -1412,20 +1427,29 @@ static int slbt_exec_link_create_library_symlink(
target,lnkname,
false))
return SLBT_NESTED_ERROR(dctx);
- } else
+ } else {
sprintf(target,"%s.%d.%d.%d",
ectx->dsofilename,
dctx->cctx->verinfo.major,
dctx->cctx->verinfo.minor,
dctx->cctx->verinfo.revision);
+ }
+
- if (fmajor)
+ if (fmajor && ectx->dsorellnkname) {
+ sprintf(lnkname,"%s.%d",
+ ectx->dsorellnkname,
+ dctx->cctx->verinfo.major);
+
+ } else if (fmajor) {
sprintf(lnkname,"%s.%d",
ectx->dsofilename,
dctx->cctx->verinfo.major);
- else
+ } else {
strcpy(lnkname,ectx->dsofilename);
+ }
+
if (fmajor && (dctx->cctx->drvflags & SLBT_DRIVER_IMAGE_PE))
return slbt_copy_file(