[ Context backport. ]
---- a/gdb/solib-svr4.c
-+++ b/gdb/solib-svr4.c
-@@ -1097,8 +1097,18 @@ svr4_current_sos (void)
+Index: gdb-7.1.90.20100711/gdb/solib-svr4.c
+===================================================================
+--- gdb-7.1.90.20100711.orig/gdb/solib-svr4.c 2010-07-12 23:07:35.000000000 +0200
++++ gdb-7.1.90.20100711/gdb/solib-svr4.c 2010-07-13 00:19:03.000000000 +0200
+@@ -1177,8 +1177,18 @@ svr4_current_sos (void)
target_read_string (LM_NAME (new), &buffer,
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
else
{
struct build_id *build_id;
---- a/gdb/solib.c
-+++ b/gdb/solib.c
-@@ -538,6 +538,7 @@ update_solib_list (int from_tty, struct target_ops *target)
+Index: gdb-7.1.90.20100711/gdb/solib.c
+===================================================================
+--- gdb-7.1.90.20100711.orig/gdb/solib.c 2010-05-17 01:49:58.000000000 +0200
++++ gdb-7.1.90.20100711/gdb/solib.c 2010-07-13 00:21:01.000000000 +0200
+@@ -705,6 +705,7 @@ update_solib_list (int from_tty, struct
struct target_so_ops *ops = solib_ops (target_gdbarch);
struct so_list *inferior = ops->current_sos();
struct so_list *gdb, **gdb_link;
/* We can reach here due to changing solib-search-path or the
sysroot, before having any inferior. */
-@@ -668,6 +669,12 @@ update_solib_list (int from_tty, struct target_ops *target)
+@@ -844,6 +845,12 @@ Error while mapping shared library secti
observer_notify_solib_loaded (i);
}
- }
+
++ /* If this was the very first DSO list scan and we possibly read in ld.so
++ recheck all the formerly unreadable DSO names strings. */
+
-+ /* If this was the very first DSO list scan and we possibly read in ld.so
-+ recheck all the formerly unreadable DSO names strings. */
++ if (saved_so_list_head == NULL && so_list_head != NULL)
++ return update_solib_list (from_tty, target);
+
-+ if (saved_so_list_head == NULL && so_list_head != NULL)
-+ update_solib_list (from_tty, target);
- }
-
-
-
+ /* If a library was not found, issue an appropriate warning
+ message. We have to use a single call to warning in case the
+ front end does something special with warnings, e.g., pop up