This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add NT_GNU_PROPERTY_TYPE_0 macros
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 18 Aug 2017 08:26:40 -0700
- Subject: Re: [PATCH] Add NT_GNU_PROPERTY_TYPE_0 macros
- Authentication-results: sourceware.org; auth=none
- References: <20170815120453.GA10491@gmail.com>
On Tue, Aug 15, 2017 at 5:04 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
> Add macros used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0).
>
> Any comments or objections?
I will check it today.
> H.J.
> --
> * elf/elf.h (NT_GNU_PROPERTY_TYPE_0): New.
> (NOTE_GNU_PROPERTY_SECTION_NAME): Likewise.
> (GNU_PROPERTY_STACK_SIZE): Likewie.
> (GNU_PROPERTY_NO_COPY_ON_PROTECTED): Likewie.
> (GNU_PROPERTY_LOPROC): Likewise.
> (GNU_PROPERTY_HIPROC): Likewise.
> (GNU_PROPERTY_LOUSER): Likewise.
> (GNU_PROPERTY_HIUSER): Likewise.
> (GNU_PROPERTY_X86_ISA_1_USED): Likwise.
> (GNU_PROPERTY_X86_ISA_1_NEEDED): Likwise.
> (GNU_PROPERTY_X86_FEATURE_1_AND): Likwise.
> (GNU_PROPERTY_X86_ISA_1_486): Likwise.
> (GNU_PROPERTY_X86_ISA_1_586): Likwise.
> (GNU_PROPERTY_X86_ISA_1_686): Likwise.
> (GNU_PROPERTY_X86_ISA_1_SSE): Likwise.
> (GNU_PROPERTY_X86_ISA_1_SSE2): Likwise.
> (GNU_PROPERTY_X86_ISA_1_SSE3): Likwise.
> (GNU_PROPERTY_X86_ISA_1_SSSE3): Likwise.
> (GNU_PROPERTY_X86_ISA_1_SSE4_1): Likwise.
> (GNU_PROPERTY_X86_ISA_1_SSE4_2): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX2): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX512F): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX512CD): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX512ER): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX512PF): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX512VL): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX512DQ): Likwise.
> (GNU_PROPERTY_X86_ISA_1_AVX512BW): Likwise.
> (GNU_PROPERTY_X86_FEATURE_1_IBT): Likwise.
> (GNU_PROPERTY_X86_FEATURE_1_SHSTK): Likwise.
> ---
> elf/elf.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 56 insertions(+)
>
> diff --git a/elf/elf.h b/elf/elf.h
> index 3900b4c9f0..237e35c096 100644
> --- a/elf/elf.h
> +++ b/elf/elf.h
> @@ -1247,6 +1247,62 @@ typedef struct
> /* Version note generated by GNU gold containing a version string. */
> #define NT_GNU_GOLD_VERSION 4
>
> +/* Program property. */
> +#define NT_GNU_PROPERTY_TYPE_0 5
> +
> +/* Note section name of program property. */
> +#define NOTE_GNU_PROPERTY_SECTION_NAME ".note.gnu.property"
> +
> +/* Values used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0). */
> +
> +/* Stack size. */
> +#define GNU_PROPERTY_STACK_SIZE 1
> +/* No copy relocation on protected data symbol. */
> +#define GNU_PROPERTY_NO_COPY_ON_PROTECTED 2
> +
> +/* Processor-specific semantics, lo */
> +#define GNU_PROPERTY_LOPROC 0xc0000000
> +/* Processor-specific semantics, hi */
> +#define GNU_PROPERTY_HIPROC 0xdfffffff
> +/* Application-specific semantics, lo */
> +#define GNU_PROPERTY_LOUSER 0xe0000000
> +/* Application-specific semantics, hi */
> +#define GNU_PROPERTY_HIUSER 0xffffffff
> +
> +/* The x86 instruction sets indicated by the corresponding bits are
> + used in program. Their support in the hardware is optional. */
> +#define GNU_PROPERTY_X86_ISA_1_USED 0xc0000000
> +/* The x86 instruction sets indicated by the corresponding bits are
> + used in program and they must be supported by the hardware. */
> +#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001
> +/* X86 processor-specific features used in program. */
> +#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
> +
> +#define GNU_PROPERTY_X86_ISA_1_486 (1U << 0)
> +#define GNU_PROPERTY_X86_ISA_1_586 (1U << 1)
> +#define GNU_PROPERTY_X86_ISA_1_686 (1U << 2)
> +#define GNU_PROPERTY_X86_ISA_1_SSE (1U << 3)
> +#define GNU_PROPERTY_X86_ISA_1_SSE2 (1U << 4)
> +#define GNU_PROPERTY_X86_ISA_1_SSE3 (1U << 5)
> +#define GNU_PROPERTY_X86_ISA_1_SSSE3 (1U << 6)
> +#define GNU_PROPERTY_X86_ISA_1_SSE4_1 (1U << 7)
> +#define GNU_PROPERTY_X86_ISA_1_SSE4_2 (1U << 8)
> +#define GNU_PROPERTY_X86_ISA_1_AVX (1U << 9)
> +#define GNU_PROPERTY_X86_ISA_1_AVX2 (1U << 10)
> +#define GNU_PROPERTY_X86_ISA_1_AVX512F (1U << 11)
> +#define GNU_PROPERTY_X86_ISA_1_AVX512CD (1U << 12)
> +#define GNU_PROPERTY_X86_ISA_1_AVX512ER (1U << 13)
> +#define GNU_PROPERTY_X86_ISA_1_AVX512PF (1U << 14)
> +#define GNU_PROPERTY_X86_ISA_1_AVX512VL (1U << 15)
> +#define GNU_PROPERTY_X86_ISA_1_AVX512DQ (1U << 16)
> +#define GNU_PROPERTY_X86_ISA_1_AVX512BW (1U << 17)
> +
> +/* This indicates that all executable sections are compatible with
> + IBT. */
> +#define GNU_PROPERTY_X86_FEATURE_1_IBT (1U << 0)
> +/* This indicates that all executable sections are compatible with
> + SHSTK. */
> +#define GNU_PROPERTY_X86_FEATURE_1_SHSTK (1U << 1)
>
> /* Move records. */
> typedef struct
> --
> 2.13.5
>
--
H.J.