This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Commit: Add support for displaying and merging GNU_BUILD_NOTEs


On Wed, Mar 1, 2017 at 3:09 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Guys,
>
>   I am applying the patch below to add support for displaying and
>   merging GNU_BUILD_NOTEs.  The proposal for these notes can be
>   found here:
>
>     https://fedoraproject.org/wiki/Toolchain/Watermark#Questions
>
>   The notes are designed so that they can be used without any
>   modifications to the assembler or linker.  But in order to display the
>   contents of the notes readelf needs an update.  Plus in order to
>   reduce redundancy in the notes (and thus save size in the binary
>   containing them) a merge-notes option has been added to objcopy.
>
> Cheers
>   Nick
>
> binutils/ChangeLog
> 2017-03-01  Nick Clifton  <nickc@redhat.com>
>
>         * readelf.c (get_note_type): Add support for GNU_BUILD_NOTEs.
>         (get_gnu_elf_note_type): Add support for GNU_PROPERTY_NOTEs.
>         (decode_x86_isa): New function.
>         (print_gnu_property_note): New function.
>         (print_gnu_note): Handle GNU_PROPERTY_NOTEs.
>         (print_gnu_build_attribute_description): New function.
>         (print_gnu_build_attribute_name): New function.
>         (process_note): Add support for GNU_BUILD_NOTEs.
>         * objcopy.c (--merge-notes): New command line option.
>         (copy_options): Add merge-notes.
>         (copy_usage): Likewise.
>         (is_merge_note_section): New function.
>         (merge_gnu_build_notes): New function.
>         (copy_object): Merge note sections if asked to do so.
>         (skip_section): Add skip_copy parameter.  Add support for skipping
>         merged note sections.
>         (copy_relocations_in_section): Update call to skip_section.
>         (copy_section): Likewise.
>         (copy_main): Add support for merge-notes option.
>         * doc/binutils.texi: Document the new option to objcopy.
>         * NEWS: Mention the new feature.
>         * testsuite/binutils-all/note-2-32.d: New test.  Checks note
>         merging on 32-bit targets.
>         * testsuite/binutils-all/note-2-32.s: New test source file.
>         * testsuite/binutils-all/note-2-64.d: New test.  Like note-2-32.d
>         but for 64-bit targets.
>         * testsuite/binutils-all/note-2-64.s: New test source file.
>         * testsuite/binutils-all/objcopy.exp: Run the new test.
>
> include/ChangeLog
> 2017-03-01  Nick Clifton  <nickc@redhat.com>
>
>         * elf/common.h (SHF_GNU_BUILD_NOTE): Define.
>         (NT_GNU_PROPERTY_TYPE_0): Define.
>         (NT_GNU_BUILD_ATTRIBUTE_OPEN): Define.
>         (NT_GNU_BUILD_ATTRIBUTE_FUN): Define.
>         (GNU_BUILD_ATTRIBUTE_TYPE_NUMERIC): Define.
>         (GNU_BUILD_ATTRIBUTE_TYPE_STRING): Define.
>         (GNU_BUILD_ATTRIBUTE_TYPE_BOOL_TRUE): Define.
>         (GNU_BUILD_ATTRIBUTE_TYPE_BOOL_FALSE): Define.
>         (GNU_BUILD_ATTRIBUTE_VERSION): Define.
>         (GNU_BUILD_ATTRIBUTE_STACK_PROT): Define.
>         (GNU_BUILD_ATTRIBUTE_RELRO): Define.
>         (GNU_BUILD_ATTRIBUTE_STACK_SIZE): Define.
>         (GNU_BUILD_ATTRIBUTE_TOOL): Define.
>         (GNU_BUILD_ATTRIBUTE_ABI): Define.
>         (GNU_BUILD_ATTRIBUTE_PIC): Define.
>         (NOTE_GNU_PROPERTY_SECTION_NAME): Define.
>         (GNU_BUILD_ATTRS_SECTION_NAME): Define.
>         (GNU_PROPERTY_STACK_SIZE): Define.
>         (GNU_PROPERTY_NO_COPY_ON_PROTECTED): Define.
>         (GNU_PROPERTY_X86_ISA_1_USED): Define.
>         (GNU_PROPERTY_X86_ISA_1_NEEDED): Define.
>         (GNU_PROPERTY_X86_ISA_1_486): Define.
>         (GNU_PROPERTY_X86_ISA_1_586): Define.
>         (GNU_PROPERTY_X86_ISA_1_686): Define.
>         (GNU_PROPERTY_X86_ISA_1_SSE): Define.
>         (GNU_PROPERTY_X86_ISA_1_SSE2): Define.
>         (GNU_PROPERTY_X86_ISA_1_SSE3): Define.
>         (GNU_PROPERTY_X86_ISA_1_SSSE3): Define.
>         (GNU_PROPERTY_X86_ISA_1_SSE4_1): Define.
>         (GNU_PROPERTY_X86_ISA_1_SSE4_2): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX2): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX512F): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX512CD): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX512ER): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX512PF): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX512VL): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX512DQ): Define.
>         (GNU_PROPERTY_X86_ISA_1_AVX512BW): Define.
>

NT_GNU_PROPERTY_TYPE_0 isn't dumped properly:

https://sourceware.org/bugzilla/show_bug.cgi?id=21231

This patch fixes it.   OK for master?

-- 
H.J.
From d771a0ad7a8abc524c9f5dcc6aa99a39eccea821 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 15 Apr 2016 11:35:52 -0700
Subject: [PATCH] Properly dump NT_GNU_PROPERTY_TYPE_0

Property type and datasz are always 4 bytes for both 32-bit and 64-bit
objects.  Property values for GNU_PROPERTY_X86_ISA_1_USED and
GNU_PROPERTY_X86_ISA_1_NEEDED are 4 bytes for both i386 and x86-64
objects.  We should also check GNU_PROPERTY_LOPROC and
GNU_PROPERTY_LOUSER.

binutils/

	PR binutils/21231
	* readelf.c (decode_x86_isa): Change argument to unsigned int.
	(print_gnu_property_note): Retrieve property type and datasz as
	4-byte integer.  Consolidate property datasz check.  Check
	GNU_PROPERTY_LOPROC and GNU_PROPERTY_LOUSER.
	* testsuite/binutils-all/i386/pr21231a.d: New file.
	* testsuite/binutils-all/i386/pr21231a.s: Likewise.
	* testsuite/binutils-all/i386/pr21231b.d: Likewise.
	* testsuite/binutils-all/i386/pr21231b.s: Likewise.
	* testsuite/binutils-all/x86-64/pr21231a.d: Likewise.
	* testsuite/binutils-all/x86-64/pr21231a.s: Likewise.
	* testsuite/binutils-all/x86-64/pr21231b.d: Likewise.
	* testsuite/binutils-all/x86-64/pr21231b.s: Likewise.

include/

	PR binutils/21231
	* elf/common.h (GNU_PROPERTY_LOPROC): New.
	(GNU_PROPERTY_HIPROC): Likewise.
	(GNU_PROPERTY_LOUSER): Likewise.
	(GNU_PROPERTY_HIUSER): Likewise.
---
 binutils/readelf.c                                | 123 ++++++++++++++--------
 binutils/testsuite/binutils-all/i386/pr21231a.d   |   9 ++
 binutils/testsuite/binutils-all/i386/pr21231a.s   |  14 +++
 binutils/testsuite/binutils-all/i386/pr21231b.d   |  12 +++
 binutils/testsuite/binutils-all/i386/pr21231b.s   |  35 ++++++
 binutils/testsuite/binutils-all/x86-64/pr21231a.d |   9 ++
 binutils/testsuite/binutils-all/x86-64/pr21231a.s |  14 +++
 binutils/testsuite/binutils-all/x86-64/pr21231b.d |  12 +++
 binutils/testsuite/binutils-all/x86-64/pr21231b.s |  35 ++++++
 include/elf/common.h                              |  10 ++
 10 files changed, 228 insertions(+), 45 deletions(-)
 create mode 100644 binutils/testsuite/binutils-all/i386/pr21231a.d
 create mode 100644 binutils/testsuite/binutils-all/i386/pr21231a.s
 create mode 100644 binutils/testsuite/binutils-all/i386/pr21231b.d
 create mode 100644 binutils/testsuite/binutils-all/i386/pr21231b.s
 create mode 100644 binutils/testsuite/binutils-all/x86-64/pr21231a.d
 create mode 100644 binutils/testsuite/binutils-all/x86-64/pr21231a.s
 create mode 100644 binutils/testsuite/binutils-all/x86-64/pr21231b.d
 create mode 100644 binutils/testsuite/binutils-all/x86-64/pr21231b.s

diff --git a/binutils/readelf.c b/binutils/readelf.c
index 9ed8d41..bf5185a 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -15926,11 +15926,11 @@ get_gnu_elf_note_type (unsigned e_type)
 }
 
 static void
-decode_x86_isa (unsigned long bitmask)
+decode_x86_isa (unsigned int bitmask)
 {
   while (bitmask)
     {
-      unsigned long bit = bitmask & (- bitmask);
+      unsigned int bit = bitmask & (- bitmask);
 
       bitmask &= ~ bit;
       switch (bit)
@@ -15953,7 +15953,7 @@ decode_x86_isa (unsigned long bitmask)
 	case GNU_PROPERTY_X86_ISA_1_AVX512VL: printf ("AVX512VL"); break;
 	case GNU_PROPERTY_X86_ISA_1_AVX512DQ: printf ("AVX512DQ"); break;
 	case GNU_PROPERTY_X86_ISA_1_AVX512BW: printf ("AVX512BW"); break;
-	default: printf (_("<unknown: %lx>"), bit); break;
+	default: printf (_("<unknown: %x>"), bit); break;
 	}
       if (bitmask)
 	printf (", ");
@@ -15969,73 +15969,106 @@ print_gnu_property_note (Elf_Internal_Note * pnote)
 
   printf (_("      Properties: "));
 
-  if (pnote->descsz % size)
+  if (pnote->descsz < 8 || (pnote->descsz % size) != 0)
     {
       printf (_("<corrupt GNU_PROPERTY_TYPE, size = %#lx>\n"), pnote->descsz);
       return;
     }
 
-  while (ptr < (ptr_end - (size * 2)))
+  while (1)
     {
-      unsigned long j;
-      unsigned long type = byte_get (ptr, size);
-      unsigned long datasz = byte_get (ptr + size, size);
+      unsigned int j;
+      unsigned int type = byte_get (ptr, 4);
+      unsigned int datasz = byte_get (ptr + 4, 4);
 
-      ptr += 2 * size;
+      ptr += 8;
 
-      switch (type)
+      if ((ptr + datasz) > ptr_end)
 	{
-	case GNU_PROPERTY_STACK_SIZE:
-	  printf (_("stack size: "));
-	  if (datasz != size || (ptr + size  > ptr_end))
-	    printf (_("<corrupt length: %#lx> "), datasz);
-	  else
-	    printf ("%#lx", (unsigned long) byte_get (ptr, size));
-	  break;
-
-	case GNU_PROPERTY_NO_COPY_ON_PROTECTED:
-	  printf ("no copy on protected ");
-	  if (datasz)
-	    printf (_("<corrupt length: %#lx> "), datasz);
+	  printf (_("<corrupt type (%#x) datasz: %#x>\n"),
+		  type, datasz);
 	  break;
+	}
 
-	case GNU_PROPERTY_X86_ISA_1_USED:
-	  printf ("x86 ISA used: ");
-	  if (datasz != size  || (ptr + size > ptr_end))
-	    printf (_("<corrupt length: %#lx> "), datasz);
-	  else
-	    decode_x86_isa (byte_get (ptr, size));
-	  break;
+      if (type >= GNU_PROPERTY_LOPROC && type <= GNU_PROPERTY_HIPROC)
+	{
+	  if (elf_header.e_machine == EM_X86_64
+	      || elf_header.e_machine == EM_IAMCU
+	      || elf_header.e_machine == EM_386)
+	    {
+	      switch (type)
+		{
+		case GNU_PROPERTY_X86_ISA_1_USED:
+		  printf ("x86 ISA used: ");
+		  if (datasz != 4)
+		    printf (_("<corrupt length: %#x> "), datasz);
+		  else
+		    decode_x86_isa (byte_get (ptr, 4));
+		  goto next;
 
-	case GNU_PROPERTY_X86_ISA_1_NEEDED:
-	  printf ("x86 ISA needed: ");
-	  if (datasz != size  || (ptr + size > ptr_end))
-	    printf (_("<corrupt length: %#lx> "), datasz);
-	  else
-	    decode_x86_isa (byte_get (ptr, size));
-	  break;
+		case GNU_PROPERTY_X86_ISA_1_NEEDED:
+		  printf ("x86 ISA needed: ");
+		  if (datasz != 4)
+		    printf (_("<corrupt length: %#x> "), datasz);
+		  else
+		    decode_x86_isa (byte_get (ptr, 4));
+		  goto next;
 
-	default:
-	  printf (_("<unknown type %#lx data: "), type);
-	  if (ptr + datasz > ptr_end)
+		default:
+		  break;
+		}
+	    }
+	}
+      else
+	{
+	  switch (type)
 	    {
-	      printf (_("corrupt datasz: %#lx>\n"), datasz);
+	    case GNU_PROPERTY_STACK_SIZE:
+	      printf (_("stack size: "));
+	      if (datasz != size)
+		printf (_("<corrupt length: %#x> "), datasz);
+	      else
+		printf ("%#lx", (unsigned long) byte_get (ptr, size));
+	      goto next;
+
+	    case GNU_PROPERTY_NO_COPY_ON_PROTECTED:
+	      printf ("no copy on protected ");
+	      if (datasz)
+		printf (_("<corrupt length: %#x> "), datasz);
+	      goto next;
+
+	    default:
 	      break;
 	    }
-	  for (j = 0; j < datasz; ++j)
-	    printf ("%02x ", ptr[j] & 0xff);
-	  printf (">");
-	  break;
 	}
 
+      if (type < GNU_PROPERTY_LOPROC)
+	printf (_("<unknown type %#x data: "), type);
+      else if (type < GNU_PROPERTY_LOUSER)
+	printf (_("<procesor-specific type %#x data: "), type);
+      else
+	printf (_("<application-specific type %#x data: "), type);
+      for (j = 0; j < datasz; ++j)
+	printf ("%02x ", ptr[j] & 0xff);
+      printf (">");
+
+next:
       ptr += ((datasz + (size - 1)) & ~ (size - 1));
-      if (ptr < (ptr_end - (size * 2)))
+      if (ptr == ptr_end)
+	break;
+      else
 	{
 	  if (do_wide)
 	    printf (", ");
 	  else
 	    printf ("\n\t");
 	}
+
+      if (ptr > (ptr_end - 8))
+	{
+	  printf (_("<corrupt descsz: %#lx>\n"), pnote->descsz);
+	  break;
+	}
     }
 
   printf ("\n");
diff --git a/binutils/testsuite/binutils-all/i386/pr21231a.d b/binutils/testsuite/binutils-all/i386/pr21231a.d
new file mode 100644
index 0000000..7c13b85
--- /dev/null
+++ b/binutils/testsuite/binutils-all/i386/pr21231a.d
@@ -0,0 +1,9 @@
+#PROG: objcopy
+#as: --32
+#objcopy:
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x00000008	NT_GNU_PROPERTY_TYPE_0
+      Properties: no copy on protected 
diff --git a/binutils/testsuite/binutils-all/i386/pr21231a.s b/binutils/testsuite/binutils-all/i386/pr21231a.s
new file mode 100644
index 0000000..c2510af
--- /dev/null
+++ b/binutils/testsuite/binutils-all/i386/pr21231a.s
@@ -0,0 +1,14 @@
+	.section ".note.gnu.property", "a"
+	.p2align 2
+	.long 1f - 0f		/* name length.  */
+	.long 5f - 2f		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.long 5			/* note type.  */
+0:	.asciz "GNU"		/* vendor name.  */
+1:	.p2align 2
+2:
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+	.long 2			/* pr_type.  */
+	.long 0			/* pr_datasz.  */
+	.p2align 2
+5:
diff --git a/binutils/testsuite/binutils-all/i386/pr21231b.d b/binutils/testsuite/binutils-all/i386/pr21231b.d
new file mode 100644
index 0000000..29a8f44
--- /dev/null
+++ b/binutils/testsuite/binutils-all/i386/pr21231b.d
@@ -0,0 +1,12 @@
+#PROG: objcopy
+#as: --32
+#objcopy:
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x0000002c	NT_GNU_PROPERTY_TYPE_0
+      Properties: stack size: 0x800000
+	no copy on protected 
+	x86 ISA used: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, <unknown: 40000>, <unknown: 80000>, <unknown: 100000>, <unknown: 200000>, <unknown: 400000>, <unknown: 800000>, <unknown: 1000000>, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>, <unknown: 80000000>
+	x86 ISA needed: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL
diff --git a/binutils/testsuite/binutils-all/i386/pr21231b.s b/binutils/testsuite/binutils-all/i386/pr21231b.s
new file mode 100644
index 0000000..3d54745
--- /dev/null
+++ b/binutils/testsuite/binutils-all/i386/pr21231b.s
@@ -0,0 +1,35 @@
+	.section ".note.gnu.property", "a"
+	.p2align 2
+	.long 1f - 0f		/* name length.  */
+	.long 5f - 2f		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.long 5			/* note type.  */
+0:	.asciz "GNU"		/* vendor name.  */
+1:	.p2align 2
+2:
+	/* GNU_PROPERTY_STACK_SIZE */
+	.long 1			/* pr_type.  */
+	.long 4f - 3f		/* pr_datasz.  */
+3:
+	.dc.a 0x800000		/* Stack size.  */
+4:
+	.p2align 2
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+	.long 2			/* pr_type.  */
+	.long 0			/* pr_datasz.  */
+	.p2align 2
+	/* GNU_PROPERTY_X86_ISA_1_USED */
+	.long 0xc0000000	/* pr_type.  */
+	.long 4f - 3f		/* pr_datasz.  */
+3:
+	.long -1
+4:
+	.p2align 2
+	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
+	.long 0xc0000001	/* pr_type.  */
+	.long 4f - 3f		/* pr_datasz.  */
+3:
+	.long 0xffff
+4:
+	.p2align 2
+5:
diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231a.d b/binutils/testsuite/binutils-all/x86-64/pr21231a.d
new file mode 100644
index 0000000..2a00048
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/pr21231a.d
@@ -0,0 +1,9 @@
+#PROG: objcopy
+#as: --64
+#objcopy:
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x00000008	NT_GNU_PROPERTY_TYPE_0
+      Properties: no copy on protected 
diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231a.s b/binutils/testsuite/binutils-all/x86-64/pr21231a.s
new file mode 100644
index 0000000..fef44e9
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/pr21231a.s
@@ -0,0 +1,14 @@
+	.section ".note.gnu.property", "a"
+	.p2align 3
+	.long 1f - 0f		/* name length.  */
+	.long 5f - 2f		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.long 5			/* note type.  */
+0:	.asciz "GNU"		/* vendor name.  */
+1:	.p2align 3
+2:
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+	.long 2			/* pr_type.  */
+	.long 0			/* pr_datasz.  */
+	.p2align 3
+5:
diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231b.d b/binutils/testsuite/binutils-all/x86-64/pr21231b.d
new file mode 100644
index 0000000..9d7761c
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/pr21231b.d
@@ -0,0 +1,12 @@
+#PROG: objcopy
+#as: --64
+#objcopy:
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+  Owner                 Data size	Description
+  GNU                  0x00000038	NT_GNU_PROPERTY_TYPE_0
+      Properties: stack size: 0x800000
+	no copy on protected 
+	x86 ISA used: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL, AVX512DQ, AVX512BW, <unknown: 40000>, <unknown: 80000>, <unknown: 100000>, <unknown: 200000>, <unknown: 400000>, <unknown: 800000>, <unknown: 1000000>, <unknown: 2000000>, <unknown: 4000000>, <unknown: 8000000>, <unknown: 10000000>, <unknown: 20000000>, <unknown: 40000000>, <unknown: 80000000>
+	x86 ISA needed: i486, 586, 686, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, AVX, AVX2, AVX512F, AVX512CD, AVX512ER, AVX512PF, AVX512VL
diff --git a/binutils/testsuite/binutils-all/x86-64/pr21231b.s b/binutils/testsuite/binutils-all/x86-64/pr21231b.s
new file mode 100644
index 0000000..afba4de
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/pr21231b.s
@@ -0,0 +1,35 @@
+	.section ".note.gnu.property", "a"
+	.p2align 3
+	.long 1f - 0f		/* name length.  */
+	.long 5f - 2f		/* data length.  */
+	/* NT_GNU_PROPERTY_TYPE_0 */
+	.long 5			/* note type.  */
+0:	.asciz "GNU"		/* vendor name.  */
+1:	.p2align 3
+2:
+	/* GNU_PROPERTY_STACK_SIZE */
+	.long 1			/* pr_type.  */
+	.long 4f - 3f		/* pr_datasz.  */
+3:
+	.dc.a 0x800000		/* Stack size.  */
+4:
+	.p2align 3
+	/* GNU_PROPERTY_NO_COPY_ON_PROTECTED */
+	.long 2			/* pr_type.  */
+	.long 0			/* pr_datasz.  */
+	.p2align 3
+	/* GNU_PROPERTY_X86_ISA_1_USED */
+	.long 0xc0000000	/* pr_type.  */
+	.long 4f - 3f		/* pr_datasz.  */
+3:
+	.long -1
+4:
+	.p2align 3
+	/* GNU_PROPERTY_X86_ISA_1_NEEDED */
+	.long 0xc0000001	/* pr_type.  */
+	.long 4f - 3f		/* pr_datasz.  */
+3:
+	.long 0xffff
+4:
+	.p2align 3
+5:
diff --git a/include/elf/common.h b/include/elf/common.h
index 2b9bca6..f45c256 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -695,6 +695,16 @@
 /* Values used in GNU .note.gnu.property notes (NT_GNU_PROPERTY_TYPE_0).  */
 #define GNU_PROPERTY_STACK_SIZE			1
 #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
+
 #define GNU_PROPERTY_X86_ISA_1_USED		0xc0000000
 #define GNU_PROPERTY_X86_ISA_1_NEEDED		0xc0000001
 
-- 
2.9.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]