From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12499 invoked by alias); 11 Feb 2010 23:16:08 -0000 Received: (qmail 12480 invoked by uid 22791); 11 Feb 2010 23:16:07 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS 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, 11 Feb 2010 23:16:01 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o1BNFxl4022082 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 11 Feb 2010 18:15:59 -0500 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o1BNFjmi021171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 11 Feb 2010 18:15:49 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id o1BNFhZc007282; Fri, 12 Feb 2010 00:15:43 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.3/Submit) id o1BMvMgo006467; Thu, 11 Feb 2010 23:57:22 +0100 Date: Thu, 11 Feb 2010 23:16:00 -0000 From: Jan Kratochvil To: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [patch] Sanity check PIE displacement (like the PIC one) Message-ID: <20100211225722.GA6179@host0.dyn.jankratochvil.net> References: <20100201012004.GA6015@host0.dyn.jankratochvil.net> <20100211200506.GA24110@caradoc.them.org> <20100211222113.GA31323@host0.dyn.jankratochvil.net> <20100211222604.GA1465@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100211222604.GA1465@caradoc.them.org> User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2010-02/txt/msg00309.txt.bz2 On Thu, 11 Feb 2010 23:26:07 +0100, Daniel Jacobowitz wrote: > On Thu, Feb 11, 2010 at 11:21:13PM +0100, Jan Kratochvil wrote: > > The life-saver message is IMO "B" but the message(s) being discussed to be > > removed is A1+A2. > > > > Is the attached patch what everone agrees upon or have I not understood it? > > Fine with me. Or you could just use verbose. OK, verbose may be more appropriate. Made some additional text content changes, therefore asking for new approval. .dynamic section for ".../gdb.base/prelink.so" at 0x38b38006c0 is not at the expected address 0x39bb6006c0, difference appears to be caused by prelink, adjusting expectations. No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu. Thanks, Jan gdb/ 2010-02-11 Jan Kratochvil * solib-svr4.c: (LM_ADDR_CHECK): Print successful prelink adjustment only if INFO_VERBOSE. Use printf_unfiltered for it. Add trailing dot. Print twice paddress for both successful and unsuccessful adjustment. Gdb/testsuite/ 2010-02-11 Jan Kratochvil * gdb.base/prelink.exp (set verbose on): New. (prelink): Remove expected "warning: " prefixes. --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -222,15 +222,21 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd) { l_addr = l_dynaddr - dynaddr; - warning (_(".dynamic section for \"%s\" " - "is not at the expected address"), so->so_name); - warning (_("difference appears to be caused by prelink, " - "adjusting expectations")); + if (info_verbose) + printf_unfiltered (_(".dynamic section for \"%s\" at %s " + "is not at the expected address %s, " + "difference appears to be caused " + "by prelink, adjusting expectations.\n"), + so->so_name, + paddress (target_gdbarch, dynaddr), + paddress (target_gdbarch, l_dynaddr)); } else - warning (_(".dynamic section for \"%s\" " - "is not at the expected address " - "(wrong library or version mismatch?)"), so->so_name); + warning (_(".dynamic section for \"%s\" at %s " + "is not at the expected address %s " + "(wrong library or version mismatch?)"), so->so_name, + paddress (target_gdbarch, dynaddr), + paddress (target_gdbarch, l_dynaddr)); } set_addr: --- a/gdb/testsuite/gdb.base/prelink.exp +++ b/gdb/testsuite/gdb.base/prelink.exp @@ -109,10 +109,13 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} +# Print the "adjusting expectations" message. +gdb_test "set verbose on" + set test "prelink" global gdb_prompt gdb_test_multiple "core-file $objdir/$subdir/prelink.core" "$test" { - -re "warning: \.dynamic section.*not at the expected address.*warning: difference.*caused by prelink, adjusting expectations.*$gdb_prompt $" { + -re "\.dynamic section.*not at the expected address.*difference.*caused by prelink, adjusting expectations.*$gdb_prompt $" { pass "$test" } }