From patchwork Mon Dec 5 17:53:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiong Wang X-Patchwork-Id: 86603 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1611591qgi; Mon, 5 Dec 2016 09:55:08 -0800 (PST) X-Received: by 10.84.205.69 with SMTP id o5mr125043477plh.70.1480960508836; Mon, 05 Dec 2016 09:55:08 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id q15si15412308pgn.206.2016.12.05.09.55.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Dec 2016 09:55:08 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-return-94730-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of binutils-return-94730-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=binutils-return-94730-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:subject:references:to:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=kLMU 386rcrWSAIZIekKT5MaMeRzivBC5SDEpOrjwa8DRdO7rSmGC8RNy+VAnHF7V76wS PGHZjiXI3khSXmWJRHXEahNgLB3CH9xemNmwyDdcsNXMXySgEdIMjBKHJtS7TfLI iqpvd5kYDa8PzVrHD7odIGU1T5pxNAeqTv07kVM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:subject:references:to:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=5W6S3G9Kf5 JykCcsdUQoaaw4iNY=; b=EAD0Eo5VaMnnAzHY/wmJaXk2OHPcbgI7ethMOciZjW kGrQqaifhs3OQUEcwWVhfxIJMQ/XTG0DWH5dh7axwf2ljLTtPecMdD23gD3thWK5 zcTlJtll6R2uRmnVG0Wq4K8mW1EEBO+EVPTS8IE7etr8UTGCLm/mCDkARNwyuIHK k= Received: (qmail 124197 invoked by alias); 5 Dec 2016 17:53:49 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Delivered-To: mailing list binutils@sourceware.org Received: (qmail 124137 invoked by uid 89); 5 Dec 2016 17:53:48 -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=investigate, Hx-languages-length:1504 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; Mon, 05 Dec 2016 17:53:38 +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 E8E2A707; Mon, 5 Dec 2016 09:53:36 -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 9AD7E3F483 for ; Mon, 5 Dec 2016 09:53:36 -0800 (PST) From: Jiong Wang Subject: [AArch64][4/4] Define TC_ADDRESS_BYTES for GAS References: <2217462f-42bd-83e0-6141-acd62e8becb8@foss.arm.com> <4a2dc012-d289-319a-3557-14266fe3510b@foss.arm.com> <2eaf8fdb-6e7d-1f9b-8ef3-fe0c1d5577c9@foss.arm.com> To: Binutils Message-ID: <06d11737-ef5a-05e7-24d1-8541bfc94e09@foss.arm.com> Date: Mon, 5 Dec 2016 17:53:35 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <2eaf8fdb-6e7d-1f9b-8ef3-fe0c1d5577c9@foss.arm.com> X-IsSubscribed: yes Address bytes should be 4 under ILP32, otherwise ".dc.a" will generate 64bit relocation. The default address_per_bytes is define in cpu-aarch64.c, current it's 8 for both LP64 and ILP32, whether we should change it to 4 as well as word_per_bytes looks to me is another issue we need to investigate. gas/ 2016-12-05 Jiong Wang * config/tc-aarch64.h (TC_ADDRESS_BYTES): New define. (aarch64_address_bytes): New declaration. * config/tc-aarch64.c (aarch64_address_bytes): New function. diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 1d25422..af2b5ee 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -8925,3 +8925,14 @@ aarch64_copy_symbol_attributes (symbolS * dest, symbolS * src) { AARCH64_GET_FLAG (dest) = AARCH64_GET_FLAG (src); } + +/* Export the ABI address size for use by TC_ADDRESS_BYTES for the + purpose of the `.dc.a' internal pseudo-op. */ + +int +aarch64_address_bytes (void) +{ + if ((stdoutput->arch_info->mach & bfd_mach_aarch64_ilp32)) + return 4; + return stdoutput->arch_info->bits_per_address / 8; +} diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h index e1bc3a6..f2c5936 100644 --- a/gas/config/tc-aarch64.h +++ b/gas/config/tc-aarch64.h @@ -237,4 +237,7 @@ void tc_pe_dwarf2_emit_offset (symbolS *, unsigned int); #endif /* TE_PE */ +#define TC_ADDRESS_BYTES aarch64_address_bytes +extern int aarch64_address_bytes (void); + #endif /* TC_AARCH64 */