From patchwork Thu May 18 10:00:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edelsohn X-Patchwork-Id: 763888 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wT6C93TlWz9s2P for ; Thu, 18 May 2017 20:01:08 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="kbKz/Bb1"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=FAGpOQP+DQqyHRrlovTpmd6BQcyaITVXBC7w2cV519GdTg iO3GbOaiCjQuzroG2Ebf9afjuptmAy+X5gExNVoqJJQWmVJgG6NrCa1eULDb8SCe Y7FLFTmkDpKGD7Ag1sOLeNkLkOgJNL4DwXu/tM+8ZpSvr3iugVztNVDN9uEUM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=Gd73VVEG2Jhnw3MMoIsfkL/AO6I=; b=kbKz/Bb1B9L7gNgnwmih DvAwExUa+XHSuQQ4PTHDBpbcV5xd7szyHxt6gLrEHIbAeey0XvcO0TS5y4zSjaGP Z1rYj8w1oqPReEUvGL4W1lu2rRshHYlsnKg+lDj04eIlb/M+NUbjcZ24D3umJqRJ QbMU9N+9ksbUNaP/stJKIw0= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 06:00:52 -0400 Message-ID: Subject: [PATCH,DWARF,v2] AIX dwarf2out label fix To: GCC Patches 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);