Index: uspace/lib/c/generic/rtld/symbol.c
===================================================================
--- uspace/lib/c/generic/rtld/symbol.c	(revision 4b63316b66af00eca1217f35809e3b1a24cb8da7)
+++ uspace/lib/c/generic/rtld/symbol.c	(revision 184b600afb3ccf3236dcbfc87929a25a1053b85d)
@@ -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);
 	}
 }
