From 313f34ae264eaf73988d16b66d963ef771e96e36 Mon Sep 17 00:00:00 2001 From: midipix Date: Jun 04 2018 12:00:56 +0000 Subject: mdso flags: added MDSO_FLAG_LDSO_LIB as a reference to the loader lib. itself. --- 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,"", "save generated assembly files under %s"},