From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95882 invoked by alias); 27 Feb 2018 04:11: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 95832 invoked by uid 89); 27 Feb 2018 04:11:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mail-yw0-f170.google.com Received: from mail-yw0-f170.google.com (HELO mail-yw0-f170.google.com) (209.85.161.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Feb 2018 04:11:47 +0000 Received: by mail-yw0-f170.google.com with SMTP id s199so5885106ywg.12 for ; Mon, 26 Feb 2018 20:11:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=G6J7r2ffTEjn/b2R5zNSTIpTGEhn8HPkfCeU1exy5Bo=; b=MvMinFBCvsVrfVb3XeTF/qrjD1VNilf35LSdZ1jwIlf6sgKvIIYEupUt41dRzIbJZ/ rbeWLv+X3xCFpfkeGqMEV+o1xQTZRAq+S/u3oonDPStSRNfCVAcimUarJTyrtXjav76N owIDrHbWhXVtYSp7/y0slSq4YeIGT934Q33KVbBmxYwGN0H0WB4jTUdH8I75ReWTdypb vZxm30cuJACS7ky++YKkjTa0jqfTP9ZcVA5tlBD+WJytv4tTRU6aZ8VfhkbvfoeRkzKf pyeqQeN170fpkaMF2N5jtGLJA/vlVfD/qw9RDS1hPrHzad336ernvAfYM+XgVPYPXPcz 4jPQ== X-Gm-Message-State: APf1xPBxx2SNt2Gu2kAR8iJaXxhDJFqeTChRJrEZRkGO4mSlvJGkl5Qz ApiXEy+122YO9vCaxxUl0N2Pv8kexHav9b2RSwUMBg== X-Google-Smtp-Source: AH8x226q4FndBagBEBiQ7EnjyIvLEDoP77JG2XfocRfFjNmgdqX7r/m3QkWL+tQ3mDpuqPvzQHCJMshXDmj68xQ7qPE= X-Received: by 10.129.67.23 with SMTP id q23mr8617457ywa.111.1519704704880; Mon, 26 Feb 2018 20:11:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.122.23 with HTTP; Mon, 26 Feb 2018 20:11:44 -0800 (PST) In-Reply-To: References: From: "Ian Lance Taylor via gcc-patches" Reply-To: Ian Lance Taylor Date: Tue, 27 Feb 2018 04:11:00 -0000 Message-ID: Subject: Re: [PATCH PR other/77609] Let the assembler choose ELF section types for miscellaneous named sections To: Roland McGrath Cc: "gcc-patches@gcc.gnu.org" , rguenth@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg01478.txt.bz2 On Sat, Feb 24, 2018 at 1:54 AM, Roland McGrath via gcc-patches wrote: > Anybody want to look at this? > > It rebases identically on today's trunk. I'd like to commit it to > trunk and gcc-7-branch and gcc-6-branch ideally. You are recreating the conditions used in default_elf_asm_named_section, so I think you ought to have comments referring back and forth between them. This is OK with the two additional comments. Ian > On Thu, Sep 22, 2016 at 1:15 PM, Roland McGrath wrote: >> ping? >> >> On Thu, Sep 15, 2016 at 4:09 PM, Roland McGrath wrote: >>> This fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77609 (which I've >>> just filed). >>> >>> OK for trunk? >>> >>> I'm not sure if this kind of fix is appropriate for gcc-6-branch or not, >>> but I'd like to backport it there too if it is acceptable. >>> >>> >>> Thanks, >>> Roland >>> >>> >>> gcc/ >>> 2016-09-15 Roland McGrath < >>> >>> PR other/77609 >>> * varasm.c (default_section_type_flags): Set SECTION_NOTYPE for >>> any section for which we don't know a specific type it should have, >>> regardless of name. Previously this was done only for the exact >>> names ".init_array", ".fini_array", and ".preinit_array". >>> >>> diff --git a/gcc/varasm.c b/gcc/varasm.c >>> index 00a9b30..0d7ea38 100644 >>> --- a/gcc/varasm.c >>> +++ b/gcc/varasm.c >>> @@ -6210,15 +6210,20 @@ default_section_type_flags (tree decl, const >>> char *name, int reloc) >>> || strncmp (name, ".gnu.linkonce.tb.", 17) == 0) >>> flags |= SECTION_TLS | SECTION_BSS; >>> >>> - /* These three sections have special ELF types. They are neither >>> - SHT_PROGBITS nor SHT_NOBITS, so when changing sections we don't >>> - want to print a section type (@progbits or @nobits). If someone >>> - is silly enough to emit code or TLS variables to one of these >>> - sections, then don't handle them specially. */ >>> - if (!(flags & (SECTION_CODE | SECTION_BSS | SECTION_TLS)) >>> - && (strcmp (name, ".init_array") == 0 >>> - || strcmp (name, ".fini_array") == 0 >>> - || strcmp (name, ".preinit_array") == 0)) >>> + /* Various sections have special ELF types that the assembler will >>> + assign by default based on the name. They are neither SHT_PROGBITS >>> + nor SHT_NOBITS, so when changing sections we don't want to print a >>> + section type (@progbits or @nobits). Rather than duplicating the >>> + assembler's knowledge of what those special name patterns are, just >>> + let the assembler choose the type if we don't know a specific >>> + reason to set it to something other than the default. SHT_PROGBITS >>> + is the default for sections whose name is not specially known to >>> + the assembler, so it does no harm to leave the choice to the >>> + assembler when @progbits is the best thing we know to use. If >>> + someone is silly enough to emit code or TLS variables to one of >>> + these sections, then don't handle them specially. */ >>> + if (!(flags & (SECTION_CODE | SECTION_BSS | SECTION_TLS | SECTION_ENTSIZE)) >>> + && !(HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE))) >>> flags |= SECTION_NOTYPE; >>> >>> return flags;