RFC: Add PT_GNU_PROPERTY to cover .note.gnu.property section

H.J. Lu hjl.tools@gmail.com
Thu Dec 13 13:02:00 GMT 2018

On Wed, Dec 12, 2018 at 8:12 AM Cary Coutant <ccoutant@gmail.com> wrote:
> > > > As you might expect, I support this new program header. Ideally, I'd
> > > > have liked to replace the input SHT_NOTE sections with
> > > > SHT_GNU_PROPERTY sections and dispense with all the note section
> > > > overhead, but I'll take this as a compromise.
> > >
> > > Why can't we switch to SHT_GNU_PROPERTY? My fear with combining
> > > PT_GNU_PROPERTY with SHT_NOTE is that it will be even more confusing
> >
> > There is no requirement for PT_XXX to have SHT_XXX, like PT_GNU_RELRO.
> But it is not normal for the linker to perform such special processing
> on an SHT_NOTE section. When a section requires special processing, it
> is customary to use a new section type. Otherwise, the linker has to
> resort to string matching on the section name. Section names in ELF
> are not supposed to have special meaning to the linker.

Good point.  It is too late now.

> > > Also I thought there was still a question whether any or all
> > > newly proposed property features and flags are actually needed
> > > as loadable segments. There is a clear overlap with the GNU
> > > Attributes (which are non-loadable). I would like to see consensus
> > > first on the new property format/flags and which are and which
> > > aren't needed as loadable properties at runtime.
> >
> > Yes, they are needed in loadable segment.  That is the main motivation
> > for GNU program property,
> The only properties required in a loadable segment are those that will
> be used by the loader. From what I can tell so far, the USED bits
> can't be used by the loader, so why can't they go in the GNU
> attributes section?

There are couple reasons:

1. GNU attributes section has a very different format and isn't
designed for loader.
2. X86 needs loadable properties.
3. X86 should use a uniform format for all properties.
4. USED bits can be useful.  For example, if AVX512 isn't marked as USED, OS
loader may optimize OS for this process with this info.


More information about the Binutils mailing list