From patchwork Thu Jul 26 00:06:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cary Coutant X-Patchwork-Id: 173308 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 CC5B72C0095 for ; Thu, 26 Jul 2012 10:06:23 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343865985; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:To:Subject:Message-Id:Date: From:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=4y5+xqs IMV2uq/amJGhPQee4fKU=; b=NRTAA2M8xSVf17Z6tlsE8YyPcKz79rG+banTBwf 91aSE1rCSc2/ln5NKbss+opjxfB7Oefr+74yShpcfqZvDby/eSdIPrmmqEVfVLk1 +f9Jvqry8QNXuo3X0ym0r6hYHVDdTwgebfS9weILuK+PlIMrCEhA63CwPCX00RRs s62U= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:Received:Received:To:Subject:Message-Id:Date:From:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=qvlI1ZYuT9uoTnqVw+Dfuus5clFz14ZMC+frnX9bvcCNCHinTd7ebOcftWGk6s HCJBcf5hGXKWd1s+frhWELKTVUOCIia/kor/vHB9ErLyxcV/gZquJvD4PqF9RCMb 1Mv+NfC1qen2/mvt4lAAHZ7h4jMnSiYkBmXg4xVBdJvDU=; Received: (qmail 32246 invoked by alias); 26 Jul 2012 00:06:20 -0000 Received: (qmail 32233 invoked by uid 22791); 26 Jul 2012 00:06:19 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, T_RP_MATCHES_RCVD, URIBL_DBL_REDIR X-Spam-Check-By: sourceware.org Received: from mail-lpp01m010-f73.google.com (HELO mail-lpp01m010-f73.google.com) (209.85.215.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Jul 2012 00:06:05 +0000 Received: by lahe6 with SMTP id e6so56495lah.2 for ; Wed, 25 Jul 2012 17:06:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:message-id:date:from:x-gm-message-state; bh=3d9GHm2ABFXudzJxeKXZNbVCtb4umdU2snHH7+GF+f8=; b=KBrZPqLTT9PLq8QVFK1pwFg71XPe0+KOYUY3UqEb3xZ64xu0I1iMTTk5990PIzEtOZ l9ShCa1PV7tXkhZNphI7aqKiyiSRI6FckyAcYf40RjniXcgj07Q+gYbWj7CQJ20Q9z2r 2ROmFJ92rIgnpR+jizXhlEMy/trdx8XliwfHxK7f0oyyI0Sl4hGT8GJy9wIQaPLqKXrR EhBzP5Cf36ZPOcGlTaGqS6l1/AsAwdpuGz0qTt39CkzcN3/DQA7taNPl3w2lMry2TghR 5TzCpirpvR2a4hMNOsqMIU684bkhuOzuRLd5ud6KVpNB7KvQ9g63O7DGgJGVIPsbZSOp b70g== Received: by 10.14.225.71 with SMTP id y47mr1131830eep.4.1343261163846; Wed, 25 Jul 2012 17:06:03 -0700 (PDT) Received: by 10.14.225.71 with SMTP id y47mr1131826eep.4.1343261163793; Wed, 25 Jul 2012 17:06:03 -0700 (PDT) Received: from hpza10.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id 46si1217936eed.1.2012.07.25.17.06.03 (version=TLSv1/SSLv3 cipher=AES128-SHA); Wed, 25 Jul 2012 17:06:03 -0700 (PDT) Received: from ccoutant.mtv.corp.google.com (ccoutant.mtv.corp.google.com [172.18.110.42]) by hpza10.eem.corp.google.com (Postfix) with ESMTP id 9724D20004E; Wed, 25 Jul 2012 17:06:03 -0700 (PDT) Received: by ccoutant.mtv.corp.google.com (Postfix, from userid 62097) id E3FC4E0657; Wed, 25 Jul 2012 17:06:02 -0700 (PDT) To: reply@codereview.appspotmail.com, saugustine@google.com, gcc-patches@gcc.gnu.org Subject: [google/gcc-4_7] Compute dwo_id for Fission (issue6442047) Message-Id: <20120726000602.E3FC4E0657@ccoutant.mtv.corp.google.com> Date: Wed, 25 Jul 2012 17:06:02 -0700 (PDT) From: ccoutant@google.com (Cary Coutant) X-Gm-Message-State: ALoCoQmo1n/g+0a6zu7YmlOvqdj0rj8Vzk7/KARdfq4HmN2goKb8javZMFnWYVqLDxl60TN7+mVmfi3XbVknKwBEo3ztX7dfLBW4HyDdE976Efo54hsnMVWmQWPEcWWP0bnKvJVV28Ft0Eu7K6KGwyDt1q2xZBsD/xD6Gnxn70yEk0sXDjW0OhSa0zVTHMrC0Fyh1M5SnYUo X-IsSubscribed: yes 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 patch is for the google/gcc-4_7 branch. Compute a dwo_id and write the DW_AT_GNU_dwo_id attribute to both the skeleton compile unit DIE and the DWO compile unit DIE. Tested: passed regression tests. 2012-07-25 Cary Coutant * gcc/dwarf2out.c (dwo_id_placeholder): Delete. (output_skeleton_debug_sections): Don't write dwo_id here. (dwarf2out_finish): Compute dwo_id and write it to both comp units. --- This patch is available for review at http://codereview.appspot.com/6442047 Index: gcc/dwarf2out.c =================================================================== --- gcc/dwarf2out.c (revision 189868) +++ gcc/dwarf2out.c (working copy) @@ -9132,10 +9132,6 @@ get_skeleton_type_unit (void) return skeleton_type_unit; } -/* The splitter will fill in this value. */ - -unsigned char dwo_id_placeholder[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; - /* Output skeleton debug sections that point to the dwo file. */ static void @@ -9148,9 +9144,6 @@ output_skeleton_debug_sections (dw_die_r /* Add attributes common to skeleton compile_units and type_units. */ add_top_level_skeleton_die_attrs (comp_unit); - /* The dwo_id is only for compile_units. */ - add_AT_data8 (comp_unit, DW_AT_GNU_dwo_id, dwo_id_placeholder); - switch_to_section (debug_skeleton_info_section); ASM_OUTPUT_LABEL (asm_out_file, debug_skeleton_info_section_label); @@ -23684,8 +23677,24 @@ dwarf2out_finish (const char *filename) if (dwarf_split_debug_info) { - /* Add a place-holder for the dwo_id to the comp-unit die. */ - add_AT_data8 (comp_unit_die (), DW_AT_GNU_dwo_id, dwo_id_placeholder); + int mark; + unsigned char checksum[16]; + struct md5_ctx ctx; + + /* Compute a checksum of the comp_unit to use as the dwo_id. */ + md5_init_ctx (&ctx); + mark = 0; + die_checksum (comp_unit_die (), &ctx, &mark); + unmark_all_dies (comp_unit_die ()); + md5_finish_ctx (&ctx, checksum); + + /* Use the first 8 bytes of the checksum as the dwo_id, + and add it to both comp-unit DIEs. */ + add_AT_data8 (main_comp_unit_die, DW_AT_GNU_dwo_id, checksum); + add_AT_data8 (comp_unit_die (), DW_AT_GNU_dwo_id, checksum); + + /* Add the base offset of the ranges table to the skeleton + comp-unit DIE. */ if (ranges_table_in_use) add_AT_lineptr (main_comp_unit_die, DW_AT_GNU_ranges_base, ranges_section_label);