aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-08-24 04:37:45 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-08-24 04:38:02 -0700
commitaa7bca9b2e30cf128966631382731369f7b753d8 (patch)
tree2127751d26ed050e8da1dbf984f3240534f21e23 /include
parent772758ac42a5717d2c2043cc36aa6600c2bfc120 (diff)
downloadgdb-aa7bca9b2e30cf128966631382731369f7b753d8.zip
gdb-aa7bca9b2e30cf128966631382731369f7b753d8.tar.gz
gdb-aa7bca9b2e30cf128966631382731369f7b753d8.tar.bz2
x86: Add GNU_PROPERTY_X86_UINT32_VALID
The older linker treats .note.gnu.property section as a generic note and just concatenates all .note.gnu.property sections from the input to the output. On CET-enabled OS, the output of the older linker is marked as CET enabled, but in fact, it is not CET enabled and it crashes on CET-enabled machines. This patch defines GNU_PROPERTY_X86_UINT32_VALID. Linker is updated to set the GNU_PROPERTY_X86_UINT32_VALID bit in GNU property note for non-relocatable output to differentiate outputs from the older linker. bfd/ * elfxx-x86.c (_bfd_x86_elf_parse_gnu_properties): Mask out the GNU_PROPERTY_X86_UINT32_VALID bit. (_bfd_x86_elf_link_fixup_gnu_properties): Set the GNU_PROPERTY_X86_UINT32_VALID bit for non-relocatable output. binutils/ * readelf.c (print_gnu_property_note): Check the GNU_PROPERTY_X86_UINT32_VALID bit for invalid GNU property note. include/ * elf/common.h (GNU_PROPERTY_X86_UINT32_VALID): New.
Diffstat (limited to 'include')
-rw-r--r--include/ChangeLog4
-rw-r--r--include/elf/common.h3
2 files changed, 7 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 69cc57d..4b933b1 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2018-08-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * elf/common.h (GNU_PROPERTY_X86_UINT32_VALID): New.
+
2018-08-21 John Darrington <john@darrington.wattle.id.au>
* elf/s12z.h: Rename R_S12Z_UKNWN_3 to R_S12Z_EXT18.
diff --git a/include/elf/common.h b/include/elf/common.h
index 1a940ff..55c5505 100644
--- a/include/elf/common.h
+++ b/include/elf/common.h
@@ -752,6 +752,9 @@
#define GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001
#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
+/* Set by linker to indicate that the property is valid. */
+#define GNU_PROPERTY_X86_UINT32_VALID (1U << 31)
+
#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)