From patchwork Fri Oct 2 10:08:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramana Radhakrishnan X-Patchwork-Id: 54419 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 8806E23009 for ; Fri, 2 Oct 2015 10:08:37 +0000 (UTC) Received: by wicmn1 with SMTP id mn1sf6301637wic.1 for ; Fri, 02 Oct 2015 03:08:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:date:from:to:subject:message-id:mime-version :content-type:content-disposition:user-agent:x-original-sender :x-original-authentication-results; bh=A1oDuKW9hDjvziDKhpWEWBEB25yS4NJQFXfCF2gWlZ8=; b=YfwERzWrJi+lSiNci2DUeoq4sIrI3WhaaEnxQZut31aXqTwGAt4NR8+KB2ktRhPQEZ k5oz0/2glG2spFRHl2L1dF/e73jKqiGyFkmFJu96lxl9vtNRcf/s/9GYwX9K5Nzaxj4X gRDZ6P3jcpiu98DJZtq+TRYLtu0gPB3uyDtb7xmGMYA842a6gujP5nDXlyypgSTwuqSs SJJlMS3uqpHsniAfPQvqhAG2rSUK0aIn4/GrZN2TJjG5CubWBRkMwvICTvnnydnT20nm CBfSkhM2VrVTjSsDxo+nqO+/bBAZV5yOPuni7DlGXqcc3Z7WArG4CjuNQI/N9lP1LlxK W09g== X-Gm-Message-State: ALoCoQk//qYa95f2FeJl4dUtZDcra59dgCa29UkHUoeUipVof20tzBB2NmQGM0hOfBftmWXnMvCB X-Received: by 10.112.145.3 with SMTP id sq3mr1731894lbb.7.1443780516719; Fri, 02 Oct 2015 03:08:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.87.139 with SMTP id l133ls206158lfb.34.gmail; Fri, 02 Oct 2015 03:08:36 -0700 (PDT) X-Received: by 10.25.157.15 with SMTP id g15mr3368645lfe.113.1443780516564; Fri, 02 Oct 2015 03:08:36 -0700 (PDT) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com. [2a00:1450:4010:c03::233]) by mx.google.com with ESMTPS id iy9si5726034lbc.60.2015.10.02.03.08.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Oct 2015 03:08:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::233 as permitted sender) client-ip=2a00:1450:4010:c03::233; Received: by laer8 with SMTP id r8so89645261lae.2 for ; Fri, 02 Oct 2015 03:08:36 -0700 (PDT) X-Received: by 10.112.64.72 with SMTP id m8mr5029096lbs.41.1443780516389; Fri, 02 Oct 2015 03:08:36 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1126416lbq; Fri, 2 Oct 2015 03:08:34 -0700 (PDT) X-Received: by 10.107.34.207 with SMTP id i198mr15448288ioi.2.1443780514779; Fri, 02 Oct 2015 03:08:34 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 66si8002536iom.125.2015.10.02.03.08.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Oct 2015 03:08:34 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-408966-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 46658 invoked by alias); 2 Oct 2015 10:08:19 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 46636 invoked by uid 89); 2 Oct 2015 10:08:18 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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, 02 Oct 2015 10:08:17 +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 2EC2549 for ; Fri, 2 Oct 2015 03:08:17 -0700 (PDT) Received: from e105545-lin (e105545-lin.cambridge.arm.com [10.2.206.27]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4606C3F50D for ; Fri, 2 Oct 2015 03:08:15 -0700 (PDT) Date: Fri, 2 Oct 2015 11:08:11 +0100 From: Ramana Radhakrishnan To: gcc-patches@gcc.gnu.org Subject: [Patch AArch64] Use default_elf_asm_named_section instead of special cased hook Message-ID: <20151002100806.GA18049@e105545-lin> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Original-Sender: ramana.radhakrishnan@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::233 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Hi, The hook for TARGET_ASM_NAMED_SECTION was defined separately in the backend around the time frame for GCC 4.7 under the assumption that '@' would be used as a comment character in the binutils port. This was indeed true in versions of the AArch64 port that never made it into the FSF tree. However this practice was killed before the binutils port made it upstream. Doing archaeology into various revisions including the first commit of upstream binutils, talking to Marcus about the history of this and actually testing the first commit of binutils, I can confidently say that the upstream binutils port never had any use of '@' as a comment character for AArch64 However we never got rid of the special cased handling in GCC and the duplication of code in the AArch64 backend. This was found when I was playing with Virtual Table verification on ARM and AArch64 and discovered ICEs which were similar but manifested in different places begging the obvious question. Tested on aarch64-none-elf with no regressions. Ok to apply ? Ramana * config/aarch64/aarch64-elf.h (TARGET_ASM_NAMED_SECTION): Use default_elf_asm_named_section. * config/aarch64/aarch64.c (aarch64_elf_asm_named_section): Delete. --- gcc/config/aarch64/aarch64-elf.h | 2 +- gcc/config/aarch64/aarch64.c | 74 ---------------------------------------- 2 files changed, 1 insertion(+), 75 deletions(-) diff --git a/gcc/config/aarch64/aarch64-elf.h b/gcc/config/aarch64/aarch64-elf.h index 1ce6343..70aa845 100644 --- a/gcc/config/aarch64/aarch64-elf.h +++ b/gcc/config/aarch64/aarch64-elf.h @@ -154,7 +154,7 @@ ASM_MABI_SPEC #define TYPE_OPERAND_FMT "%%%s" #undef TARGET_ASM_NAMED_SECTION -#define TARGET_ASM_NAMED_SECTION aarch64_elf_asm_named_section +#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section /* Stabs debug not required. */ #undef DBX_DEBUGGING_INFO diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 4d2126b..0ead7c0 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -10784,80 +10784,6 @@ aarch64_shift_truncation_mask (machine_mode mode) || aarch64_vect_struct_mode_p (mode)) ? 0 : (GET_MODE_BITSIZE (mode) - 1); } -#ifndef TLS_SECTION_ASM_FLAG -#define TLS_SECTION_ASM_FLAG 'T' -#endif - -void -aarch64_elf_asm_named_section (const char *name, unsigned int flags, - tree decl ATTRIBUTE_UNUSED) -{ - char flagchars[10], *f = flagchars; - - /* If we have already declared this section, we can use an - abbreviated form to switch back to it -- unless this section is - part of a COMDAT groups, in which case GAS requires the full - declaration every time. */ - if (!(HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE)) - && (flags & SECTION_DECLARED)) - { - fprintf (asm_out_file, "\t.section\t%s\n", name); - return; - } - - if (!(flags & SECTION_DEBUG)) - *f++ = 'a'; - if (flags & SECTION_WRITE) - *f++ = 'w'; - if (flags & SECTION_CODE) - *f++ = 'x'; - if (flags & SECTION_SMALL) - *f++ = 's'; - if (flags & SECTION_MERGE) - *f++ = 'M'; - if (flags & SECTION_STRINGS) - *f++ = 'S'; - if (flags & SECTION_TLS) - *f++ = TLS_SECTION_ASM_FLAG; - if (HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE)) - *f++ = 'G'; - *f = '\0'; - - fprintf (asm_out_file, "\t.section\t%s,\"%s\"", name, flagchars); - - if (!(flags & SECTION_NOTYPE)) - { - const char *type; - const char *format; - - if (flags & SECTION_BSS) - type = "nobits"; - else - type = "progbits"; - -#ifdef TYPE_OPERAND_FMT - format = "," TYPE_OPERAND_FMT; -#else - format = ",@%s"; -#endif - - fprintf (asm_out_file, format, type); - - if (flags & SECTION_ENTSIZE) - fprintf (asm_out_file, ",%d", flags & SECTION_ENTSIZE); - if (HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE)) - { - if (TREE_CODE (decl) == IDENTIFIER_NODE) - fprintf (asm_out_file, ",%s,comdat", IDENTIFIER_POINTER (decl)); - else - fprintf (asm_out_file, ",%s,comdat", - IDENTIFIER_POINTER (DECL_COMDAT_GROUP (decl))); - } - } - - putc ('\n', asm_out_file); -} - /* Select a format to encode pointers in exception handling data. */ int aarch64_asm_preferred_eh_data_format (int code ATTRIBUTE_UNUSED, int global)