From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13094 invoked by alias); 18 May 2017 10:00:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 12332 invoked by uid 89); 18 May 2017 10:00:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=party X-HELO: mail-qk0-f175.google.com Received: from mail-qk0-f175.google.com (HELO mail-qk0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 May 2017 10:00:51 +0000 Received: by mail-qk0-f175.google.com with SMTP id u75so31269940qka.3 for ; Thu, 18 May 2017 03:00:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4O5MevwB3D/7Gn0/MoFdFOg4WWBkD68rJ7JCMcn6vyM=; b=Hq1BHYpifEH9bQG0XpUbsfBZO0zS7zESA+cM+FAYzGBd1+sC9CU+YFtQMT4x9CERIW rPYZMCnIGywZzxR89nOGqXS5FJ50FETSIxWGU39fk85vnbyuRz9iaebsmH7d89//NP1J 6eDlqbG6iL4m+zWVF7lrVhSq+9TwG4Agf690NEnny327rw3Q9WZWws35Y+o48x+IEs5S MmbYiL4ORd3igERaZIT6Gg++fT902iGSVpFLsGYq12M583xx8Tl59hScXL+QsjybEyej 9kjzG/P/VC8VfOvHDGxoOpIjKezt/X7eQvWif8UxdkBIFAzrgwieFPct9H1chrgH7t4J f2FA== X-Gm-Message-State: AODbwcBsRScwxVBxYNfyr4VVW59Glv8lsfH0Gp7fTnkMRCn761hYLn/f LWf6MeHlBO2VHBx7Phb5/QhpMzWZO+FK X-Received: by 10.55.187.196 with SMTP id l187mr3058830qkf.185.1495101653414; Thu, 18 May 2017 03:00:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.172 with HTTP; Thu, 18 May 2017 03:00:52 -0700 (PDT) From: David Edelsohn Date: Thu, 18 May 2017 10:09:00 -0000 Message-ID: Subject: [PATCH,DWARF,v2] AIX dwarf2out label fix To: GCC Patches Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2017-05/txt/msg01441.txt.bz2 This version adds a macro DWARF_INITIAL_LENGTH_SIZE_STR based on DWARF_OFFSET_SIZE to define the string expression to append to the label to correct the offset. Because AIX Assembler inserts the section length, the section label generated by GCC points to the wrong location and must be adjusted when referenced in DW_AT_stmt_list. Okay? Thanks, David * dwarf2out.c (DWARF_INITIAL_LENGTH_SIZE_STR): New. (dwarf2out_finish): Use a local copy of debug_line_section_label. On AIX, append an expression to subtract the size of the section length. Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 248185) +++ dwarf2out.c (working copy) @@ -189,6 +189,10 @@ #define DWARF_INITIAL_LENGTH_SIZE (DWARF_OFFSET_SIZE == 4 ? 4 : 12) #endif +#ifndef DWARF_INITIAL_LENGTH_SIZE_STR +#define DWARF_INITIAL_LENGTH_SIZE_STR (DWARF_OFFSET_SIZE == 4 ? "-4" : "-12") +#endif + /* Round SIZE up to the nearest BOUNDARY. */ #define DWARF_ROUND(SIZE,BOUNDARY) \ ((((SIZE) + (BOUNDARY) - 1) / (BOUNDARY)) * (BOUNDARY)) @@ -29650,6 +29654,7 @@ comdat_type_node *ctnode; dw_die_ref main_comp_unit_die; unsigned char checksum[16]; + char dl_section_label[MAX_ARTIFICIAL_LABEL_BYTES]; /* Flush out any latecomers to the limbo party. */ flush_limbo_die_list (); @@ -29767,9 +29772,13 @@ } } + strcpy (dl_section_label, debug_line_section_label); + if (XCOFF_DEBUGGING_INFO) + strcat (dl_section_label, DWARF_INITIAL_LENGTH_SIZE_STR); + if (debug_info_level >= DINFO_LEVEL_TERSE) add_AT_lineptr (main_comp_unit_die, DW_AT_stmt_list, - debug_line_section_label); + dl_section_label); if (have_macinfo) add_AT_macptr (comp_unit_die (), @@ -29845,7 +29854,7 @@ if (debug_info_level >= DINFO_LEVEL_TERSE) add_AT_lineptr (ctnode->root_die, DW_AT_stmt_list, (!dwarf_split_debug_info - ? debug_line_section_label + ? dl_section_label : debug_skeleton_line_section_label)); output_comdat_type_unit (ctnode);