From patchwork Fri Nov 11 18:33:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiong Wang X-Patchwork-Id: 81884 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp1404530qge; Fri, 11 Nov 2016 10:33:46 -0800 (PST) X-Received: by 10.99.54.74 with SMTP id d71mr6850568pga.34.1478889226090; Fri, 11 Nov 2016 10:33:46 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 8si11481154pge.77.2016.11.11.10.33.45 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 10:33:46 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-441175-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-441175-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-441175-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :subject:to:references:cc:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=n4L+Ey58fuZUdT+DL bRTVfwb5aDnw2pmLzPe/w7S9nwGz9sSdwrmbaHM4rEz/3438Z/674TREs7T0ZaIH ptWuTbqsMemDCMsJ1VZTHYaBToGXRqxAvzA7B9I/c6weMo6JjXGt4HNXDP5LkIk0 cvH6ng559Q/RTl39DL4MtVYx14= 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:from :subject:to:references:cc:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=VyKYG5g7zTqM16FS84eM1EM H8nw=; b=pbdI5tyhzbv0jsJuzpwcdluthPFmb/qYYAJYwVOkLGtTTsZ9JzqiWAy dqE102GrOFRQiVpB1QiLU4il/M119nh5ehNX5JIuZL8glxyEOLMChnnMYq59uS4w 2h+Ylp8LZuet1rrKs1swR+30uijJ6TfZtvfKFHlagr9p6JwzVFZY= Received: (qmail 35246 invoked by alias); 11 Nov 2016 18:33:33 -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 35231 invoked by uid 89); 11 Nov 2016 18:33:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=20161111, vendor X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Nov 2016 18:33:23 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6E70C16; Fri, 11 Nov 2016 10:33:21 -0800 (PST) Received: from [10.2.206.198] (e104437-lin.cambridge.arm.com [10.2.206.198]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ABDE23F24D; Fri, 11 Nov 2016 10:33:20 -0800 (PST) From: Jiong Wang Subject: [2/9] Encoding support for AArch64 DWARF operations To: gcc-patches References: <72418e98-a400-c503-e8ce-c3fbe1ecc4a7@foss.arm.com> Cc: Jason Merrill , "Richard Earnshaw (lists)" , "Richard Earnshaw (lists)" Message-ID: Date: Fri, 11 Nov 2016 18:33:19 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <72418e98-a400-c503-e8ce-c3fbe1ecc4a7@foss.arm.com> X-IsSubscribed: yes The encoding for new added AARCH64 DWARF operations. I am thinking DWARF specification actually allows vendor private operations overlap with each other as one can't co-exist with the other. So in theory we should introduce target hook to handle target private operations. But in GCC/binutils/LLVM scope, I only see one overlap between DW_OP_GNU_push_tls_address and and DW_OP_HP_unknown, and DW_OP_HP_unknown seems not used. So I added the support in GCC generic code directly instead of introducing target hook. Is this OK to install? gcc/ 2016-11-11 Jiong Wang * dwarf2out.c (size_of_loc_descr): Increase set for DW_OP_AARCH64_pauth and DW_OP_AARCH64_paciasp_deref. (output_loc_operands): Generate encoding for DW_OP_AARCH64_pauth and DW_OP_AARCH64_paciasp_deref. (output_loc_operands_raw): Likewise. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 4a5c602f535fa49a45ae96f356f63c955dc527c6..fd159abe3c402cc8dedb0422e7b2680aabd28f93 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -1698,6 +1698,12 @@ size_of_loc_descr (dw_loc_descr_ref loc) case DW_OP_GNU_parameter_ref: size += 4; break; + case DW_OP_AARCH64_pauth: + size += size_of_uleb128 (loc->dw_loc_oprnd1.v.val_unsigned); + break; + case DW_OP_AARCH64_paciasp_deref: + size += size_of_sleb128 (loc->dw_loc_oprnd1.v.val_int); + break; default: break; } @@ -2177,6 +2183,13 @@ output_loc_operands (dw_loc_descr_ref loc, int for_eh_or_skip) } break; + case DW_OP_AARCH64_pauth: + dw2_asm_output_data_uleb128 (val1->v.val_unsigned, NULL); + break; + case DW_OP_AARCH64_paciasp_deref: + dw2_asm_output_data_sleb128 (val1->v.val_int, NULL); + break; + default: /* Other codes have no operands. */ break; @@ -2365,6 +2378,15 @@ output_loc_operands_raw (dw_loc_descr_ref loc) gcc_unreachable (); break; + case DW_OP_AARCH64_pauth: + fputc (',', asm_out_file); + dw2_asm_output_data_uleb128_raw (val1->v.val_unsigned); + break; + case DW_OP_AARCH64_paciasp_deref: + fputc (',', asm_out_file); + dw2_asm_output_data_sleb128_raw (val1->v.val_int); + break; + default: /* Other codes have no operands. */ break;