From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by sourceware.org (Postfix) with ESMTPS id 78B8C3959E61 for ; Tue, 29 Sep 2020 16:53:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 78B8C3959E61 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=maskray.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=emacsray@gmail.com Received: by mail-pf1-f179.google.com with SMTP id f18so5109529pfa.10 for ; Tue, 29 Sep 2020 09:53:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uWQh9KG6EIhCFikXmcJVtDz2GdawbuYiVxUqYn291dg=; b=d0zxAbbiv8IOO8QZxv0tLzsaK9b+7DrrhbC2A0aIzQZBtQuIY8VNLtEftsBiq/ZyoB UHUpUzKOEuWAOoYRTdvl767XIOa+UL2AzAJTA3+ZpHc44Ec21CApp3Zhspgrja6Res/M ozQ8SonBCmOJ09q8QItUVXRQtbdgoVf9XbyiH/hVlNWK5b56hrVXrB5zPwxunogd+xcv jmgNPFmbYTcsPX9QZvnzEj38LMLSgKaZycpB8xqohk5fwtTYFq8J5SfwXEoPyvFQHVRp AYz2PpZ7Hw4GnfGzIQ/4YKvaH4V36Xr5Ny//vjO0WEAJPmHPXLx3kPV0S+Im7NewwPKv bS0w== X-Gm-Message-State: AOAM530hoCA1UoWqKcV3TBTn2ZBqyoMHuFMo/TUUNPLaq+ktrQ8EVIRS 54DF/cfDkWaV1BkyGkrnWY4= X-Google-Smtp-Source: ABdhPJzfWQMtHvbJdDtQFHKnWOMvcTX1uZ5p4SEfLLN/p66V/zRPROEjHra8qjz1lCNZDghLjPzlfw== X-Received: by 2002:a62:16cd:0:b029:13e:d13d:a13f with SMTP id 196-20020a6216cd0000b029013ed13da13fmr4917739pfw.39.1601398399594; Tue, 29 Sep 2020 09:53:19 -0700 (PDT) Received: from localhost ([2601:647:4b01:ae80::51fb]) by smtp.gmail.com with ESMTPSA id v10sm5400948pjf.34.2020.09.29.09.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 09:53:19 -0700 (PDT) Date: Tue, 29 Sep 2020 09:53:17 -0700 From: Fangrui Song To: Nick Clifton Cc: binutils@sourceware.org Subject: Re: RFC: New gas directive: .attach_to_group Message-ID: <20200929165317.2yebvny6gas4jz5f@gmail.com> References: <87pn647h1h.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <87pn647h1h.fsf@redhat.com> X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2020 16:53:21 -0000 On 2020-09-29, Nick Clifton via Binutils wrote: >Hi Guys, > > I am planning on applying the attached patch, but I wondered if anyone > had any comments or thoughts first. > > The patch adds a new gas directive: ".attach_to_group " which > can be used to attach the current section to a named group. I need > this functionality for the annobin plugin for gcc. The plugin creates > new note sections and it wants to place them into section groups with > their associated code section. (So the .annobin.text section is > grouped with the .text section, the .annobin.text.hot section is > grouped with the .text.hot section and so on). The problem is that > the compiler creates the .section directives for (most of) these code > sections, and it does not add a group section to their declaration. > So I need a way to retroactively add a section to a group. Hence the > new directive. > > Tested with a wide variety of different configurations and no > problems. > > Thoughts ? Hi Nick, Is this directive an extension to the existing feature: ? .section .text.foo,"axG",@progbits,group .section .rodata.foo,"a?" If the section group intention of .annobin.text is so that .annobin.text can be discarded if the associated .text is discarded (--gc-sections), an alternative is SHF_LINK_ORDER HJ has done much work on this. There are a few additions: https://sourceware.org/pipermail/binutils/2020-August/112732.html