This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] elf: Update GNU_PROPERTY_X86_XXX macros [BZ #23797]
On Wed, Oct 24, 2018 at 4:03 AM Mark Wielaard <mark@klomp.org> wrote:
>
> Hi,
>
> Some questions about how to interpret the new constant values vs the
> old ones. I am not sure I understand how this is fully backwards
> compatible.
Since property note is optional, tools can ignore old note values.
> On Fri, 2018-10-19 at 15:47 -0700, H.J. Lu wrote:
> > GNU_PROPERTY_X86_FEATURE_1_AND is unchanged. GNU_PROPERTY_X86_ISA_1_USED
> > and GNU_PROPERTY_X86_FEATURE_2_USED are redefined to better support
> > targeted processors since GNU_PROPERTY_X86_ISA_1_?86 aren't isn't very
> > useful. A new set of GNU_PROPERTY_X86_ISA_1_XXX bits are defined. The
> > previous GNU_PROPERTY_X86_ISA_1_XXX macros are removed.
>
> So GNU_PROPERTY_X86_FEATURE_1_AND is kept at the same constant value,
> but now falls into the GNU_PROPERTY_X86_UINT32_AND_XXX range which has
> specific semantics for how linkers combine the note data. Isn't this a
> backwards compatible issue? There is no guarantee the note data was
> constructed by a linker that knows about this, but there is no way to
> detect that?
The semantics of GNU_PROPERTY_X86_FEATURE_1_AND are extended to
the GNU_PROPERTY_X86_UINT32_AND_XXX range. Old linkers will ignore
new values. Of course, you won't get new features with old linkers.
> GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_FEATURE_2_USED are
> renumbered. And the the GNU_PROPERTY_X86_ISA_1_XXX macros are renamed,
> but some are kept the same with new constant values. Were the old
> constants/names not used at all?
If any tools are using old properties, they are ignored.
> > +/* Set by linker to indicate that the property is valid. */
> > +#define GNU_PROPERTY_X86_UINT32_VALID (1U << 31)
>
> This isn't mentioned in your commit message, nor is it mentioned in the
They just follow GNU_PROPERTY_X86_XXX macros according to the x86
program property in x86-64 psABI:
https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-property.pdf
> ChangeLog entry. Should it be added? And if so, how does it interact
> with the interpretation of GNU_PROPERTY_X86_FEATURE_1_AND generated by
> older linkers or interpreted by older loaders (does it have to be
> checked by newer loaders?)
The interpretation of GNU_PROPERTY_X86_FEATURE_1_AND is unchanged.
--
H.J.