diff --git a/include/mdso/mdso.h b/include/mdso/mdso.h
index 88159fc..6f2796c 100644
--- a/include/mdso/mdso.h
+++ b/include/mdso/mdso.h
@@ -48,6 +48,7 @@ struct mdso_common_ctx {
 	uint64_t			drvflags;
 	uint64_t			actflags;
 	uint64_t			fmtflags;
+	uint32_t			dsoflags;
 	const char *			libname;
 	const char *			asmbase;
 	const char *			dstdir;
diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c
index 44eb61b..61cd77f 100644
--- a/src/driver/mdso_driver_ctx.c
+++ b/src/driver/mdso_driver_ctx.c
@@ -15,6 +15,7 @@
 
 #include <mdso/mdso.h>
 #include <mdso/mdso_output.h>
+#include <mdso/mdso_specs.h>
 #include "mdso_driver_impl.h"
 #include "argv/argv.h"
 
@@ -177,6 +178,15 @@ int mdso_get_driver_ctx(
 					cctx.drvflags |= MDSO_DRIVER_QUAD_PTR;
 					break;
 
+				case TAG_LIBPATH:
+					if (!(strcmp(entry->arg,"loader")))
+						cctx.dsoflags |= MDSO_FLAG_LOADER_PATH;
+					if (!(strcmp(entry->arg,"peb")))
+						cctx.dsoflags |= MDSO_FLAG_PEB_PATH;
+					if (!(strcmp(entry->arg,"system32")))
+						cctx.dsoflags |= MDSO_FLAG_SYSTEM32;
+					break;
+
 				case TAG_LIBNAME:
 					cctx.libname = entry->arg;
 					break;
diff --git a/src/internal/mdso_driver_impl.h b/src/internal/mdso_driver_impl.h
index 440ff1e..a3dd410 100644
--- a/src/internal/mdso_driver_impl.h
+++ b/src/internal/mdso_driver_impl.h
@@ -11,6 +11,7 @@ enum app_tags {
 	TAG_HELP,
 	TAG_VERSION,
 	TAG_QUAD_PTR,
+	TAG_LIBPATH,
 	TAG_LIBNAME,
 	TAG_DSTDIR,
 	TAG_PRETTY,
diff --git a/src/skin/mdso_skin_default.c b/src/skin/mdso_skin_default.c
index 8969023..3206e4f 100644
--- a/src/skin/mdso_skin_default.c
+++ b/src/skin/mdso_skin_default.c
@@ -11,6 +11,13 @@ const struct argv_option mdso_default_options[] = {
 	{"machine",		'm',TAG_QUAD_PTR,ARGV_OPTARG_REQUIRED,"32|64",0,
 				"set machine bits to %s"},
 
+	{"libpath",		'l',TAG_LIBPATH,ARGV_OPTARG_REQUIRED,"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)."},
+
 	{"libname",		'n',TAG_LIBNAME,ARGV_OPTARG_REQUIRED,0,"<libname>",
 				"set dependency library name to %s"},