summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/logic/slbt_exec_link.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 7cf671a..d205623 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -504,6 +504,7 @@ static int slbt_exec_link_create_library(
char cwd [PATH_MAX];
char output [PATH_MAX];
char soname [PATH_MAX];
+ char symfile[PATH_MAX];
struct slbt_deps_meta depsmeta = {0};
/* initial state */
@@ -543,6 +544,17 @@ static int slbt_exec_link_create_library(
*ectx->lsoname = soname;
}
+ /* PE: --output-def */
+ if (dctx->cctx->drvflags & SLBT_DRIVER_IMAGE_PE) {
+ if ((size_t)snprintf(symfile,sizeof(symfile),"-Wl,%s",
+ ectx->deffilename)
+ >= sizeof(output))
+ return -1;
+
+ *ectx->symdefs = "-Wl,--output-def";
+ *ectx->symfile = symfile;
+ }
+
/* shared object */
*ectx->dpic = "-shared";
*ectx->fpic = "-fPIC";