summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;