1 http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
2 Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
6 GDB currently always prints on loading a core file:
7 warning: Can't read pathname for load map: Input/output error.
9 The patch is not nice but it was WONTFIXed on the glibc side in:
10 http://sourceware.org/ml/libc-alpha/2009-10/msg00001.html
12 The same message in GDB PR 8882 and glibc PR 387 was for ld-linux.so.2 l_name
13 but that one is now ignored thanks to IGNORE_FIRST_LINK_MAP_ENTRY.
15 This fix is intended for Linux system vDSO l_name which is a second entry in
18 Regression tested on {x86_86,x86_64-m32,i686}-fedora11-linux-gnu.
26 2009-10-06 Jan Kratochvil <jan.kratochvil@redhat.com>
28 Do not print false warning on reading core file with vDSO on GNU/Linux.
29 * solib-svr4.c (svr4_current_sos): Suppress the warning if
30 MASTER_SO_LIST is still NULL.
31 * solib.c (update_solib_list): New variable saved_so_list_head.
32 Conditionally restart the function.
36 --- a/gdb/solib-svr4.c
37 +++ b/gdb/solib-svr4.c
38 @@ -1097,8 +1097,18 @@ svr4_current_sos (void)
39 target_read_string (LM_NAME (new), &buffer,
40 SO_NAME_MAX_PATH_SIZE - 1, &errcode);
42 - warning (_("Can't read pathname for load map: %s."),
43 - safe_strerror (errcode));
45 + /* During the first ever DSO list reading some strings may be
46 + unreadable as residing in the ld.so readonly memory not being
47 + present in a dumped core file. Delay the error check after
48 + the first pass of DSO list scanning when ld.so should be
49 + already mapped in and all the DSO list l_name memory gets
52 + if (master_so_list () != NULL)
53 + warning (_("Can't read pathname for load map: %s."),
54 + safe_strerror (errcode));
58 struct build_id *build_id;
61 @@ -538,6 +538,7 @@ update_solib_list (int from_tty, struct target_ops *target)
62 struct target_so_ops *ops = solib_ops (target_gdbarch);
63 struct so_list *inferior = ops->current_sos();
64 struct so_list *gdb, **gdb_link;
65 + struct so_list *saved_so_list_head = so_list_head;
67 /* We can reach here due to changing solib-search-path or the
68 sysroot, before having any inferior. */
69 @@ -668,6 +669,12 @@ update_solib_list (int from_tty, struct target_ops *target)
70 observer_notify_solib_loaded (i);
74 + /* If this was the very first DSO list scan and we possibly read in ld.so
75 + recheck all the formerly unreadable DSO names strings. */
77 + if (saved_so_list_head == NULL && so_list_head != NULL)
78 + update_solib_list (from_tty, target);