From fbb80bbae0922694102e7afb4358d46da28889d2 Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 17 Apr 2016 16:17:35 -0400 Subject: link mode: PE support: added symdef generation. --- src/logic/slbt_exec_link.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/logic/slbt_exec_link.c') 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"; -- cgit v1.2.3