summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-03-09 22:43:23 +0000
committermidipix <writeonce@midipix.org>2024-03-10 02:40:15 +0000
commit9c46bdbfb161a06b5a3c0559abb456961ca519f9 (patch)
tree6b0df87f0d2e46558c47ceebaf5918bd842125cf
parent97cd9fb083e0e73eac1c9df614a6d1c62db26656 (diff)
downloadslibtool-9c46bdbfb161a06b5a3c0559abb456961ca519f9.tar.bz2
slibtool-9c46bdbfb161a06b5a3c0559abb456961ca519f9.tar.xz
link mode: --disable-shared: also delete the associated .expsyms.a archive.
-rw-r--r--src/internal/slibtool_symlink_impl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/internal/slibtool_symlink_impl.c b/src/internal/slibtool_symlink_impl.c
index 019d3d6..06751c7 100644
--- a/src/internal/slibtool_symlink_impl.c
+++ b/src/internal/slibtool_symlink_impl.c
@@ -34,6 +34,7 @@ slbt_hidden int slbt_create_symlink(
char ** oargv;
const char * slash;
char * ln[5];
+ char * dot;
char * dotdot;
char tmplnk [PATH_MAX];
char lnkarg [PATH_MAX];
@@ -82,10 +83,22 @@ slbt_hidden int slbt_create_symlink(
fdcwd = slbt_driver_fdcwd(dctx);
/* placeholder? */
- if (fdevnull)
+ if (fdevnull) {
if (unlinkat(fdcwd,lnkname,0) && (errno != ENOENT))
return SLBT_SYSTEM_ERROR(dctx,0);
+ if ((dot = strrchr(lnkname,'.'))) {
+ if (!strcmp(dot,dctx->cctx->settings.dsosuffix)) {
+ strcpy(dot,".expsyms.a");
+
+ if (unlinkat(fdcwd,lnkname,0) && (errno != ENOENT))
+ return SLBT_SYSTEM_ERROR(dctx,0);
+
+ strcpy(dot,dctx->cctx->settings.dsosuffix);
+ }
+ }
+ }
+
if (suffix) {
sprintf(alnkarg,"%s%s",lnkname,suffix);
lnkname = alnkarg;