RFC Adding a section group flag of 0

James Henderson jh7370.2008@my.bristol.ac.uk
Wed Jan 9 15:11:00 GMT 2019


 I'm in the same camp as Florian and Peter. The first word is a _flag_
word. The gABI doesn't define a section header flag for value 0, for
example, so why should it for groups? Flags are typically additive in
nature, so a zero value would be meaningless. I agree that a clarifying
sentence would probably be beneficial though. Perhaps the sentence "The
following flags are currently defined:" could be prefixed with something
like the following sentence: "If specified, flags extend the group section
behaviour as described below..."

On Wed, 9 Jan 2019 at 15:04, Peter Smith <peter.smith@linaro.org> wrote:

> On Wed, 9 Jan 2019 at 15:00, Florian Weimer <fweimer@redhat.com> wrote:
> >
> > * 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
>
> This was my first interpretation as well. I had assumed that the flags
> specified additional properties over the default. As a possible
> alternative to adding 0 as a value, maybe a clarifying sentence in the
> paragraph above.
>
> Peter
>
> --
> You received this message because you are subscribed to the Google Groups
> "Generic System V Application Binary Interface" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to generic-abi+unsubscribe@googlegroups.com.
> To post to this group, send email to generic-abi@googlegroups.com.
> Visit this group at https://groups.google.com/group/generic-abi.
> For more options, visit https://groups.google.com/d/optout.
>



More information about the Binutils mailing list