summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-06-04 08:00:56 -0400
committermidipix <writeonce@midipix.org>2018-06-04 08:00:56 -0400
commit313f34ae264eaf73988d16b66d963ef771e96e36 (patch)
tree79bc3b35fae09ce79747b09fc260e2d6e4c9abd7
parent9bfad0da72fbc4e30bbe48e5a2a88c811ac2a375 (diff)
downloadmdso-313f34ae264eaf73988d16b66d963ef771e96e36.tar.bz2
mdso-313f34ae264eaf73988d16b66d963ef771e96e36.tar.xz
mdso flags: added MDSO_FLAG_LDSO_LIB as a reference to the loader lib. itself.
-rw-r--r--include/mdso/mdso_specs.h5
-rw-r--r--src/driver/mdso_driver_ctx.c10
-rw-r--r--src/skin/mdso_skin_default.c17
3 files changed, 22 insertions, 10 deletions
diff --git a/include/mdso/mdso_specs.h b/include/mdso/mdso_specs.h
index 50a5c8e..a17308d 100644
--- a/include/mdso/mdso_specs.h
+++ b/include/mdso/mdso_specs.h
@@ -10,8 +10,9 @@
#define MDSO_DATA_SECTION ".dsodata"
#define MDSO_FLAG_LOADER_PATH 0x0001
-#define MDSO_FLAG_PEB_PATH 0x0002
-#define MDSO_FLAG_SYSTEM32 0x0004
+#define MDSO_FLAG_LDSO_LIB 0x0002
+#define MDSO_FLAG_PEB_PATH 0x0004
+#define MDSO_FLAG_SYSTEM32 0x0008
struct mdso_arg;
struct mdso_meta_table;
diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c
index ef08600..c7950d5 100644
--- a/src/driver/mdso_driver_ctx.c
+++ b/src/driver/mdso_driver_ctx.c
@@ -21,6 +21,7 @@
#include "argv/argv.h"
#define MDSO_LOADER_FLAGS_MASK (MDSO_FLAG_LOADER_PATH \
+ | MDSO_FLAG_LDSO_LIB \
| MDSO_FLAG_PEB_PATH \
| MDSO_FLAG_SYSTEM32)
@@ -234,9 +235,14 @@ int mdso_get_driver_ctx(
if (!(strcmp(entry->arg,"loader")))
cctx.dsoflags |= MDSO_FLAG_LOADER_PATH;
- if (!(strcmp(entry->arg,"peb")))
+
+ else if (!(strcmp(entry->arg,"ldso")))
+ cctx.dsoflags |= MDSO_FLAG_LDSO_LIB;
+
+ else if (!(strcmp(entry->arg,"peb")))
cctx.dsoflags |= MDSO_FLAG_PEB_PATH;
- if (!(strcmp(entry->arg,"system32")))
+
+ else if (!(strcmp(entry->arg,"system32")))
cctx.dsoflags |= MDSO_FLAG_SYSTEM32;
break;
diff --git a/src/skin/mdso_skin_default.c b/src/skin/mdso_skin_default.c
index 4145696..0c3fd85 100644
--- a/src/skin/mdso_skin_default.c
+++ b/src/skin/mdso_skin_default.c
@@ -23,12 +23,17 @@ const struct argv_option mdso_default_options[] = {
{"machine", 'm',TAG_QUAD_PTR,ARGV_OPTARG_REQUIRED,0,"32|64",0,
"set machine bits to %s"},
- {"libpath", 'l',TAG_LIBPATH,ARGV_OPTARG_REQUIRED,0,"loader|peb|system32",0,
- "runtime loader should search for the library either "
- "according to its internal/inherited path (loader), "
- "or according to the library path in the process PEB block (peb); "
- "alternatively, the loader may only search for the library "
- "in the system library directory (system32)."},
+ {"libpath", 'l',TAG_LIBPATH,ARGV_OPTARG_REQUIRED,0,
+ "loader|ldso|peb|system32",0,
+ "indicate that this is the runtime loader "
+ "itself (ldso); otherwise, specify that the "
+ "runtime loader should search for the library "
+ "either according to its internal/inherited "
+ "path (loader), or according to the library "
+ "path in the process PEB block (peb); "
+ "alternatively, the loader may only search "
+ "for the library in the system library "
+ "directory (system32)."},
{"dstdir", 'd',TAG_DSTDIR,ARGV_OPTARG_REQUIRED,0,0,"<dstdir>",
"save generated assembly files under %s"},