From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24668 invoked by alias); 22 Nov 2012 20:17:54 -0000 Received: (qmail 24656 invoked by uid 22791); 22 Nov 2012 20:17:52 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Nov 2012 20:17:42 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAMKHgAf011326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 22 Nov 2012 15:17:42 -0500 Received: from host2.jankratochvil.net (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAMKHbZj009175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Thu, 22 Nov 2012 15:17:40 -0500 Date: Thu, 22 Nov 2012 20:17:00 -0000 From: Jan Kratochvil To: gdb-patches@sourceware.org Subject: [patch+7.5.1] Work around PR libc/13097 "linux-vdso.so.1" #3 Message-ID: <20121122201737.GA32172@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00604.txt.bz2 Hi, this is an updated version of [RFC] Work around PR libc/13097 "linux-vdso.so.1" #2 http://sourceware.org/ml/gdb-patches/2011-08/msg00331.html according to the Tom's comment http://sourceware.org/bugzilla/show_bug.cgi?id=14466#c3 I remembered it when Joel plans 7.5.1 release, the patch is safe enough and it is a FAQ at least on IRC. Fedora does not have this issue with its Fedora glibc but I have it reproducible with FSF glibc build: ./gdb -ex r --args $HOME/glibc-root/lib/ld-linux-x86-64.so.2 --library-path $HOME/glibc-root/lib /bin/true Starting program: /home/.../glibc-root/lib/ld-linux-x86-64.so.2 --library-path /home/.../glibc-root/lib /bin/true warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Inferior 1 (process 31807) exited normally] So there is no testcase as I do not know a real OS where it fails (it probably fails on Ubuntu AFAIK). No regressions on {x86_64,x86_64-m32,i686}-fedora18-linux-gnu. Thanks, Jan gdb/ 2012-11-22 Jan Kratochvil * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (solib_file_not_found_is_ok): New. Include solib.h. * linux-tdep.c (linux_solib_file_not_found_is_ok): New function. (linux_init_abi): Install it. * solib.c (default_solib_file_not_found_is_ok): New function. (update_solib_list): New variable gdbarch. Substitute it for variable ops. Call gdbarch_solib_file_not_found_is_ok. * solib.h (default_solib_file_not_found_is_ok): New declaration. diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 81a70b0..76f0ec9 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -955,6 +955,10 @@ M:void:info_proc:char *args, enum info_proc_what what:args, what # inspected when the symbol search was requested. m:void:iterate_over_objfiles_in_search_order:iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile:cb, cb_data, current_objfile:0:default_iterate_over_objfiles_in_search_order::0 +# Return non-zero if it is OK we failed to locate shared library file. +# For example these libraries may exist only in memory (vDSO). +f:int:solib_file_not_found_is_ok:const char *so_name:so_name:0:default_solib_file_not_found_is_ok::0 + EOF } @@ -1411,6 +1415,7 @@ cat <current_sos(); struct so_list *gdb, **gdb_link; @@ -798,7 +808,9 @@ update_solib_list (int from_tty, struct target_ops *target) TRY_CATCH (e, RETURN_MASK_ERROR) { /* Fill in the rest of the `struct so_list' node. */ - if (!solib_map_sections (i)) + if (!solib_map_sections (i) + && !gdbarch_solib_file_not_found_is_ok (gdbarch, + i->so_original_name)) { not_found++; if (not_found_filename == NULL) diff --git a/gdb/solib.h b/gdb/solib.h index 7a2ff84..04510b8 100644 --- a/gdb/solib.h +++ b/gdb/solib.h @@ -91,4 +91,6 @@ extern CORE_ADDR gdb_bfd_lookup_symbol_from_symtab (bfd *abfd, void *), void *data); +extern int default_solib_file_not_found_is_ok (const char *so_name); + #endif /* SOLIB_H */