From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 707 invoked by alias); 23 Nov 2012 11:30:42 -0000 Received: (qmail 692 invoked by uid 22791); 23 Nov 2012 11:30:39 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_BJ X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Nov 2012 11:30:33 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1TbrSq-0006lF-N6 from Luis_Gustavo@mentor.com ; Fri, 23 Nov 2012 03:30:32 -0800 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 23 Nov 2012 03:30:32 -0800 Received: from [0.0.0.0] ([172.16.63.104]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 23 Nov 2012 03:30:31 -0800 Message-ID: <50AF5E5C.5030205@mentor.com> Date: Fri, 23 Nov 2012 11:30:00 -0000 From: Luis Gustavo Reply-To: "Gustavo, Luis" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.28) Gecko/20120313 Lightning/1.0b2 Thunderbird/3.1.20 MIME-Version: 1.0 To: Jan Kratochvil CC: gdb-patches@sourceware.org Subject: Re: [patch+7.5.1] Work around PR libc/13097 "linux-vdso.so.1" #3 References: <20121122201737.GA32172@host2.jankratochvil.net> In-Reply-To: <20121122201737.GA32172@host2.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00610.txt.bz2 On 11/22/2012 06:17 PM, Jan Kratochvil wrote: > 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< #include "observer.h" > #include "regcache.h" > #include "objfiles.h" > +#include "solib.h" > > /* Static function declarations */ > > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index dbeed36..c4f7bdd 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -941,6 +941,17 @@ linux_make_corefile_notes_1 (struct gdbarch *gdbarch, bfd *obfd, int *note_size) > linux_collect_thread_registers); > } > > +/* Newer glibc no longer clears the Linux vDSO name to "" empty string. */ > + > +static int > +linux_solib_file_not_found_is_ok (const char *so_name) > +{ > + return (strcmp (so_name, "linux-gate.so.1") == 0 > + || strcmp (so_name, "linux-vdso.so.1") == 0 > + || strcmp (so_name, "linux-vdso32.so.1") == 0 > + || strcmp (so_name, "linux-vdso64.so.1") == 0); > +} > + > /* To be called from the various GDB_OSABI_LINUX handlers for the > various GNU/Linux architectures and machine types. */ > > @@ -953,6 +964,8 @@ linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) > set_gdbarch_make_corefile_notes (gdbarch, linux_make_corefile_notes_1); > set_gdbarch_has_shared_address_space (gdbarch, > linux_has_shared_address_space); > + set_gdbarch_solib_file_not_found_is_ok (gdbarch, > + linux_solib_file_not_found_is_ok); > } > > /* Provide a prototype to silence -Wmissing-prototypes. */ > diff --git a/gdb/solib.c b/gdb/solib.c > index db3842a..7976679 100644 > --- a/gdb/solib.c > +++ b/gdb/solib.c > @@ -642,6 +642,15 @@ solib_used (const struct so_list *const known) > return 0; > } > > +/* By default GDB complains on any missing shared library file via > + gdbarch_solib_file_not_found_is_ok. */ > + > +int > +default_solib_file_not_found_is_ok (const char *so_name) > +{ > + return 0; > +} > + > /* Synchronize GDB's shared object list with inferior's. > > Extract the list of currently loaded shared objects from the > @@ -668,7 +677,8 @@ solib_used (const struct so_list *const known) > static void > update_solib_list (int from_tty, struct target_ops *target) > { > - struct target_so_ops *ops = solib_ops (target_gdbarch ()); > + struct gdbarch *gdbarch = target_gdbarch (); > + struct target_so_ops *ops = solib_ops (gdbarch); > struct so_list *inferior = ops->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 */ > Thansk for the patch. I don't know about the others, but i find the name "solib_not_found_is_ok" a little odd. What about "is_ignored_dso", or "ignored_solib_p" or something in those veins? What about linux-gate(32|64).so? Regards, Luis