This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Empty section flags
- From: Fangrui Song <i at maskray dot me>
- To: Alan Modra <amodra at gmail dot com>
- Cc: bd1976 llvm <bd1976llvm at gmail dot com>, binutils at sourceware dot org
- Date: Tue, 3 Mar 2020 13:20:31 -0800
- Subject: Empty section flags
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=maskray.me; dmarc=pass action=none header.from=maskray.me; dkim=pass header.d=maskray.me; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9BfudE5S0oLWs4RS0+6B6tI4j3sgYOeMXs38M0UCpTk=; b=PSTBUPuehyuro45k9FtADvv2VqzRQW0vRIpWVt58kAbydjZWh64QKM66U/9jcmDr7nTNSIHf3M3CjPvPuZJ1PUIHd6FOEftJ1ws9HJFyf8SRIZ5U/vKe+P7yYgoMEV5Q5RHDL+OiMo3wqWtRZj8WTFw+DJ4p5mLpAubee75J7xTU/UFFk4ZtPHv49Xj2b0AAqpN0OADKAcG2YwH62yt0ppqoWGvmKzd3/gm6JDmoCTTyaqRGPTqnMHOxsYfOgTOxRwXYyGU9n7YDq6cQ/v0dneM/giI0bD8uHnIQyYwks3Eb992wXlR6S3SC9W+sdTHef6ctNK8tpQ59bWBvD9lqhA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QCXVtXiEQullIBnxWnEdgwXJ/skz+1CBRepxIR8Cwcz7U8hvLZCv5YtjLsHyzm7DjeO+ELYw4QiviymNtBOqphLABIyPEMPMhC48wWpFyivet2gSG+fXmru/OvnLkf1U8+mlLPR8nVmUoY39ztftGOeC98TPe8Wmp4WEzCZVH7ebHP7mwolaJikx1QH5XQuccu5tEKRXgGxyaSY1bVjfRdimM5MBCwSyuhwWXpHzYTLmUZ5CQdPaNSbFPpZIxl+Vjw4lJ3sJtoVqfy9tKBWsvwLptCSuSKUNfZ3eWZaHVSSE/NwWfPYkzf5bjFYPP+26uy8rUbCYfEHUa8+6ncOexg==
- References: <20200206073837.j4biw4rsbdy2siip@gmail.com> <20200206083347.GC5669@bubble.grove.modra.org> <20200206091914.5docw46nvgx7om6o@google.com> <20200206140912.GE5669@bubble.grove.modra.org> <CAHYgJu+LHP86sCDGEyDcCAQxDi7NqdHOigBJpWxsM1C1OBJtcQ@mail.gmail.com> <20200210052104.GQ5669@bubble.grove.modra.org>
On Sun, Feb 9, 2020 at 9:21 PM Alan Modra <amodra@gmail.com> wrote:
>
> On Thu, Feb 06, 2020 at 05:25:33PM +0000, bd1976 llvm wrote:
> > Hi Alan, thanks for the input here. I wonder if it wouldn't be more
> > consistent to error in all cases - even in the case of different group
> > signatures. The only exception would need to be for the special section
> > names (.text, .debug_str, etc...) that the assembler has special knowledge
> > of (as you explained).
>
> Yes, let's see how that goes.
> https://sourceware.org/ml/binutils/2020-02/msg00129.html
>
> > I wonder why creating multiple sections with the
> > same name for section directives with different group signatures was
> > implemented - why not just require the use of a distinct section name for
> > these?
>
> I think plain ".text" for a group's text section is fine. Distict
> names would just be yet another thing to track for a group.
>
> > Or, now that GNU has the ",unique,N" assembly extension (
> > https://sourceware.org/ml/binutils/2020-02/msg00028.html) that could be
> > used if the section name is fixed - it would then be explicit in the source
> > code that another section with the same name will be created.
>
> Perhaps, but we aren't designing a new toolchain. Backwards
> compatibility can't be discarded without compelling reasons.
>
> --
> Alan Modra
> Australia Development Lab, IBM
For empty flags, should there be an error as well?
.section .foo,"ax",@progbits; .byte 1
.section .foo,"",@progbits; .byte 2 # no diagnostic
.section .foo,"a",@progbits; .byte 3 # Error: changed section
attributes for .foo
Context: https://github.com/ClangBuiltLinux/linux/issues/913
I lean toward an error for consistency, and I will try making the LLVM
MC side rule stick.