From patchwork Thu Jan 6 23:34:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 77820 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9079DB7145 for ; Fri, 7 Jan 2011 10:36:50 +1100 (EST) Received: (qmail 8629 invoked by alias); 6 Jan 2011 23:36:48 -0000 Received: (qmail 8589 invoked by uid 22791); 6 Jan 2011 23:36:47 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Jan 2011 23:36:43 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 25D0ECB02F3 for ; Fri, 7 Jan 2011 00:36:41 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qNuXsV5UlYjv for ; Fri, 7 Jan 2011 00:36:41 +0100 (CET) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 04372CB02E5 for ; Fri, 7 Jan 2011 00:36:41 +0100 (CET) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix PR debug/46704 Date: Fri, 7 Jan 2011 00:34:31 +0100 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201101070034.31774.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This is the failure of the Ada compiler to re-build itself, a regression present on the mainline. The error message is: ada/a-charac.o:(.debug_aranges+0x6): undefined reference to `.Ldebug_info0' ada/ada.o:(.debug_aranges+0x6): undefined reference to `.Ldebug_info0' ada/alloc.o:(.debug_aranges+0x6): undefined reference to `.Ldebug_info0' ada/g-htable.o:(.debug_aranges+0x6): undefined reference to `.Ldebug_info0' ada/g-spchge.o:(.debug_aranges+0x6): undefined reference to `.Ldebug_info0' ada/get_scos.o:(.debug_aranges+0x6): more undefined references to `.Ldebug_info0' follow The problem is that, when a spec file (*.ads) is essentially empty, some size functions may nevertheless be generated and, when -fkeep-inline-functions is in effect, emitted in the assembly code. No debug info is generated for them but FDEs are (on x86-64) so a debug_aranges section will be generated but no debug_info section; now the former references a label in the latter. Fixed by conditionalizing the generation of the debug_aranges section on it being not empty (arange_table_in_use) instead of on the presence of FDEs. Bootstrapped/regtested on x86_64-suse-linux, applied on mainline as obvious. 2011-01-06 Eric Botcazou PR debug/46704 * dwarf2out.c (dwarf2out_finish): Output the debug_aranges section only when it is not empty. Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 168508) +++ dwarf2out.c (working copy) @@ -23324,7 +23324,7 @@ dwarf2out_finish (const char *filename) /* Output the address range information. We only put functions in the arange table, so don't write it out if we don't have any. */ - if (fde_table_in_use) + if (arange_table_in_use) { switch_to_section (debug_aranges_section); output_aranges ();