Index: uspace/lib/c/generic/dlfcn.c
===================================================================
--- uspace/lib/c/generic/dlfcn.c	(revision 1558d85ed379df2444da9a5e16727816dbb0a4b8)
+++ uspace/lib/c/generic/dlfcn.c	(revision 87fa4a7132ec4ff82d50273ed736ed502cea35a3)
@@ -81,5 +81,5 @@
 
 	printf("dlsym(0x%lx, \"%s\")\n", (long)mod, sym_name);
-	sd = symbol_bfs_find(sym_name, (module_t *) mod, &sm);
+	sd = symbol_bfs_find(sym_name, (module_t *) mod, ssf_none, &sm);
 	if (sd != NULL) {
 		return symbol_get_addr(sd, sm);
Index: uspace/lib/c/generic/rtld/symbol.c
===================================================================
--- uspace/lib/c/generic/rtld/symbol.c	(revision 1558d85ed379df2444da9a5e16727816dbb0a4b8)
+++ uspace/lib/c/generic/rtld/symbol.c	(revision 87fa4a7132ec4ff82d50273ed736ed502cea35a3)
@@ -111,8 +111,11 @@
  * @param name		Name of the symbol to search for.
  * @param start		Module in which to start the search..
+ * @param flags		@c ssf_none or @c ssf_noroot to not look for the symbol
+ *			in @a start
  * @param mod		(output) Will be filled with a pointer to the module 
  *			that contains the symbol.
  */
-elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod)
+elf_symbol_t *symbol_bfs_find(const char *name, module_t *start,
+    symbol_search_flags_t flags, module_t **mod)
 {
 	module_t *m, *dm;
@@ -145,10 +148,13 @@
 		list_remove(&m->queue_link);
 
-		s = def_find_in_module(name, m);
-		if (s != NULL) {
-			/* Symbol found */
-			sym = s;
-			*mod = m;
-			break;
+		/* If ssf_noroot is specified, do not look in start module */
+		if (m != start || (flags & ssf_noroot) == 0) { 
+			s = def_find_in_module(name, m);
+			if (s != NULL) {
+				/* Symbol found */
+				sym = s;
+				*mod = m;
+				break;
+			}
 		}
 
@@ -179,5 +185,5 @@
 
 
-/** Find the definition of a symbol..
+/** Find the definition of a symbol.
  *
  * By definition in System V ABI, if module origin has the flag DT_SYMBOLIC,
@@ -188,8 +194,11 @@
  * @param name		Name of the symbol to search for.
  * @param origin	Module in which the dependency originates.
+ * @param flags		@c ssf_none or @c ssf_noroot to not look for the symbol
+ *			in the executable program.
  * @param mod		(output) Will be filled with a pointer to the module 
  *			that contains the symbol.
  */
-elf_symbol_t *symbol_def_find(const char *name, module_t *origin, module_t **mod)
+elf_symbol_t *symbol_def_find(const char *name, module_t *origin,
+    symbol_search_flags_t flags, module_t **mod)
 {
 	elf_symbol_t *s;
@@ -212,8 +221,8 @@
 	if (runtime_env->program) {
 		/* Program is dynamic -- start with program as root. */
-		return symbol_bfs_find(name, runtime_env->program, mod);
+		return symbol_bfs_find(name, runtime_env->program, flags, mod);
 	} else {
 		/* Program is static -- start with @a origin as root. */
-		return symbol_bfs_find(name, origin, mod);
+		return symbol_bfs_find(name, origin, ssf_none, mod);
 	}
 }
