From patchwork Wed Jul 1 12:20:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 7440 Received: (qmail 87662 invoked by alias); 1 Jul 2015 12:20:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 87648 invoked by uid 89); 1 Jul 2015 12:20:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 01 Jul 2015 12:20:53 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 6835919CF25 for ; Wed, 1 Jul 2015 12:20:52 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-41.ams2.redhat.com [10.36.116.41]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t61CKmvu020698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 1 Jul 2015 08:20:51 -0400 Date: Wed, 1 Jul 2015 14:20:48 +0200 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Phil Muldoon Subject: [patch] debug compile: Replace confusing debug message Message-ID: <20150701122048.GA7170@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi, It was found that (gdb) set debug compile 1 (gdb) compile code 1 [...] allocated 0x7f bytes at 0x7ffff7ff9000 prot 5 allocated 0x38 bytes at 0x7ffff7ff8000 prot 1 lookup undefined ELF symbol "_GLOBAL_OFFSET_TABLE_" allocated 0x10 bytes at 0x7ffff7ff7000 for registers (gdb) _ the message 'lookup undefined ELF symbol' looks as an error to people, including to myself once. -> allocated 0x7f bytes at 0x7ffff7ff9000 prot 5 allocated 0x38 bytes at 0x7ffff7ff8000 prot 1 ELF symbol "_GLOBAL_OFFSET_TABLE_" relocated to zero allocated 0x10 bytes at 0x7ffff7ff7000 for registers (gdb) _ Jan 2015-07-01 Jan Kratochvil * compile/compile-object-load.c (compile_object_load): Replace debug message "lookup undefined ELF symbol" by 3 more specific messages. --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -731,14 +731,14 @@ compile_object_load (const char *object_file, const char *source_file, if (sym->flags != 0) continue; - if (compile_debug) - fprintf_unfiltered (gdb_stdlog, - "lookup undefined ELF symbol \"%s\"\n", - sym->name); sym->flags = BSF_GLOBAL; sym->section = bfd_abs_section_ptr; if (strcmp (sym->name, "_GLOBAL_OFFSET_TABLE_") == 0) { + if (compile_debug) + fprintf_unfiltered (gdb_stdlog, + "ELF symbol \"%s\" relocated to zero\n", + sym->name); sym->value = 0; continue; } @@ -748,10 +748,21 @@ compile_object_load (const char *object_file, const char *source_file, { case mst_text: sym->value = BMSYMBOL_VALUE_ADDRESS (bmsym); + if (compile_debug) + fprintf_unfiltered (gdb_stdlog, + "ELF mst_text symbol \"%s\" relocated to %s\n", + sym->name, + paddress (target_gdbarch (), sym->value)); break; case mst_text_gnu_ifunc: sym->value = gnu_ifunc_resolve_addr (target_gdbarch (), BMSYMBOL_VALUE_ADDRESS (bmsym)); + if (compile_debug) + fprintf_unfiltered (gdb_stdlog, + "ELF mst_text_gnu_ifunc symbol \"%s\" " + "relocated to %s\n", + sym->name, + paddress (target_gdbarch (), sym->value)); break; default: warning (_("Could not find symbol \"%s\" "