This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC Adding a section group flag of 0
- From: Florian Weimer <fweimer at redhat dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: "binutils\@sourceware.org" <binutils at sourceware dot org>, ruiu at google dot com, peter dot smith at linaro dot org, sguelton at redhat dot com, generic-abi at googlegroups dot com
- Date: Wed, 09 Jan 2019 16:00:39 +0100
- Subject: Re: RFC Adding a section group flag of 0
- References: <24c0c8d8-44e6-ab81-bdfb-43af8b53323b@redhat.com>
* Nick Clifton:
> Hi Guys,
>
> Currently the ELF standard for section groups requires that the first word
> of data in the group section be a flag, with only certain values recognised:
>
> The following flags are currently defined:
> Figure 4-13: Section Group Flags
>
> Name Value
> GRP_COMDAT 0x1
> GRP_MASKOS 0x0ff00000
> GRP_MASKPROC 0xf0000000
>
> [...]
>
> I would like to propose adding a new value to this list. A value of 0.
> This value would indicate that the section group has no special processing
> semantics, and that the contents of the group, unless discarded via garbage
> collection, should be linked as normal.
>
> This matches the current behaviour of the bfd and gold linkers, and it would
> also help to resolve a problem for the lld linker:
>
> https://reviews.llvm.org/D56437
>
> This is not a theoretical problem, as binaries containing section groups with
> a flag value of zero already exist:
>
> https://bugzilla.redhat.com/show_bug.cgi?id=1658942
>
> The maintainers of lld have stated, quite reasonably, that they do not want to
> add support for an unofficial flag value. Hence I would like to make the value
> official.
According to my reading of the specification, the behavior of flag 0 is
already specified. Setting GRP_COMDAT merely enables deduplication of
the section group based on its name. With flag 0, the name is not used
and no deduplication happens.
Thanks,
Florian