summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-02-07 23:06:15 -0500
committermidipix <writeonce@midipix.org>2017-02-08 01:19:08 -0500
commitc12a925ddba06fc1d11298fc26c10f2d5ffb91db (patch)
tree8440a09f0972f71282c5fefe1b6d56fc2a9bc036
parent2f03312a60aefe175c0d6764975c632b41e676c8 (diff)
downloadmdso-c12a925ddba06fc1d11298fc26c10f2d5ffb91db.tar.bz2
mdso-c12a925ddba06fc1d11298fc26c10f2d5ffb91db.tar.xz
driver: added --asm support.
-rw-r--r--include/mdso/mdso.h1
-rw-r--r--src/driver/mdso_amain.c10
-rw-r--r--src/driver/mdso_driver_ctx.c4
-rw-r--r--src/internal/mdso_driver_impl.h1
-rw-r--r--src/skin/mdso_skin_default.c3
5 files changed, 13 insertions, 6 deletions
diff --git a/include/mdso/mdso.h b/include/mdso/mdso.h
index 59a38bc..6ef0c0a 100644
--- a/include/mdso/mdso.h
+++ b/include/mdso/mdso.h
@@ -33,6 +33,7 @@ extern "C" {
#define MDSO_DRIVER_VERSION 0x0010
#define MDSO_DRIVER_DRY_RUN 0x0020
#define MDSO_DRIVER_QUAD_PTR 0x0040
+#define MDSO_DRIVER_GENERATE_ASM 0x0100
#define MDSO_DRIVER_ANNOTATE_ALWAYS 0x1000
#define MDSO_DRIVER_ANNOTATE_NEVER 0x2000
diff --git a/src/driver/mdso_amain.c b/src/driver/mdso_amain.c
index 985278d..b85a568 100644
--- a/src/driver/mdso_amain.c
+++ b/src/driver/mdso_amain.c
@@ -50,9 +50,7 @@ static void mdso_perform_unit_actions(
struct mdso_driver_ctx * dctx,
struct mdso_unit_ctx * uctx)
{
- uint64_t flags = uctx->cctx->fmtflags;
-
- if (flags & MDSO_OUTPUT_EXPORT_SYMS)
+ if (uctx->cctx->fmtflags & MDSO_OUTPUT_EXPORT_SYMS)
mdso_output_export_symbols(
dctx,uctx,stdout);
}
@@ -80,6 +78,9 @@ int mdso_main(int argc, char ** argv, char ** envp)
if ((mdso_version(dctx)) < 0)
return mdso_exit(dctx,MDSO_ERROR);
+ if (dctx->cctx->drvflags & MDSO_DRIVER_GENERATE_ASM)
+ mdso_create_implib_sources(dctx);
+
for (unit=dctx->units; *unit && !dctx->errv[0]; unit++) {
if (!(mdso_get_unit_ctx(dctx,*unit,&uctx))) {
mdso_perform_unit_actions(dctx,uctx);
@@ -87,8 +88,5 @@ int mdso_main(int argc, char ** argv, char ** envp)
}
}
- if (*dctx->units && !dctx->errv[0])
- mdso_create_implib_sources(dctx);
-
return mdso_exit(dctx,dctx->errv[0] ? MDSO_ERROR : MDSO_OK);
}
diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c
index 6c0c491..1c96911 100644
--- a/src/driver/mdso_driver_ctx.c
+++ b/src/driver/mdso_driver_ctx.c
@@ -192,6 +192,10 @@ int mdso_get_driver_ctx(
cctx.drvflags |= MDSO_DRIVER_VERSION;
break;
+ case TAG_ASM:
+ cctx.drvflags |= MDSO_DRIVER_GENERATE_ASM;
+ break;
+
case TAG_QUAD_PTR:
if (!(strcmp(entry->arg,"64")))
cctx.drvflags |= MDSO_DRIVER_QUAD_PTR;
diff --git a/src/internal/mdso_driver_impl.h b/src/internal/mdso_driver_impl.h
index 22fb893..5e260f8 100644
--- a/src/internal/mdso_driver_impl.h
+++ b/src/internal/mdso_driver_impl.h
@@ -15,6 +15,7 @@ extern const struct argv_option mdso_default_options[];
enum app_tags {
TAG_HELP,
TAG_VERSION,
+ TAG_ASM,
TAG_QUAD_PTR,
TAG_LIBPATH,
TAG_LIBNAME,
diff --git a/src/skin/mdso_skin_default.c b/src/skin/mdso_skin_default.c
index c52649d..e7ad452 100644
--- a/src/skin/mdso_skin_default.c
+++ b/src/skin/mdso_skin_default.c
@@ -8,6 +8,9 @@ const struct argv_option mdso_default_options[] = {
{"help", 'h',TAG_HELP,ARGV_OPTARG_OPTIONAL,0,"short|long",0,
"show usage information [listing %s options only]"},
+ {"asm", 'a',TAG_ASM,ARGV_OPTARG_NONE,0,0,0,
+ "generate assembly sources"},
+
{"machine", 'm',TAG_QUAD_PTR,ARGV_OPTARG_REQUIRED,0,"32|64",0,
"set machine bits to %s"},