aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog13
-rw-r--r--binutils/NEWS2
-rw-r--r--binutils/doc/binutils.texi3
-rw-r--r--binutils/elfedit.c8
-rw-r--r--binutils/readelf.c6
-rw-r--r--binutils/testsuite/binutils-all/x86-64/lam-u48.d12
-rw-r--r--binutils/testsuite/binutils-all/x86-64/lam-u48.s27
-rw-r--r--binutils/testsuite/binutils-all/x86-64/lam-u57.d12
-rw-r--r--binutils/testsuite/binutils-all/x86-64/lam-u57.s27
9 files changed, 107 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 885b470..298c28c 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,16 @@
+2020-12-23 H.J. Lu <hongjiu.lu@intel.com>
+
+ * NEWS: Mention LAM_U48 and LAM_U57 support.
+ * elfedit.c (elf_x86_feature): Support lam_u48 and lam_u57.
+ (usage): Add lam_u48 and lam_u57.
+ * readelf.c (decode_x86_feature_1): Support LAM_U48 and LAM_U57.
+ * doc/binutils.texi: Update elfedit with lam_u48 and lam_u57
+ support.
+ * testsuite/binutils-all/x86-64/lam-u48.d: New file.
+ * testsuite/binutils-all/x86-64/lam-u48.s: Likewise.
+ * testsuite/binutils-all/x86-64/lam-u57.d: Likewise.
+ * testsuite/binutils-all/x86-64/lam-u57.s: Likewise.
+
2020-12-15 Vivek Das Mohapatra <vivek@collabora.com>
* readelf.c (get_dynamic_type): Handle DT_GNU_FLAGS_1.
diff --git a/binutils/NEWS b/binutils/NEWS
index a5a3195..20b73f5 100644
--- a/binutils/NEWS
+++ b/binutils/NEWS
@@ -1,5 +1,7 @@
-*- text -*-
+* Update elfedit and readelf with LAM_U48 and LAM_U57 support.
+
* Nm has a new command line option: --ifunc-chars=CHARS. This specifies a
string of one or two characters. The first character is used as the type
character when displaying global ifunc symbols. The second character, if
diff --git a/binutils/doc/binutils.texi b/binutils/doc/binutils.texi
index 671694f..0ed3548 100644
--- a/binutils/doc/binutils.texi
+++ b/binutils/doc/binutils.texi
@@ -5117,7 +5117,8 @@ supported ELF OSABI are the same as @option{--input-osabi}.
@item --enable-x86-feature=@var{feature}
Set the @var{feature} bit in program property in @var{exec} or @var{dyn}
ELF files with machine types of @var{i386} or @var{x86-64}. The
-supported features are, @var{ibt} and @var{shstk}.
+supported features are, @var{ibt}, @var{shstk}, @var{lam_u48} and
+@var{lam_u57}.
@item --disable-x86-feature=@var{feature}
Clear the @var{feature} bit in program property in @var{exec} or
diff --git a/binutils/elfedit.c b/binutils/elfedit.c
index 55474ff..dc2f722 100644
--- a/binutils/elfedit.c
+++ b/binutils/elfedit.c
@@ -260,6 +260,10 @@ elf_x86_feature (const char *feature, int enable)
x86_feature = GNU_PROPERTY_X86_FEATURE_1_IBT;
else if (strcasecmp (feature, "shstk") == 0)
x86_feature = GNU_PROPERTY_X86_FEATURE_1_SHSTK;
+ else if (strcasecmp (feature, "lam_u48") == 0)
+ x86_feature = GNU_PROPERTY_X86_FEATURE_1_LAM_U48;
+ else if (strcasecmp (feature, "lam_u57") == 0)
+ x86_feature = GNU_PROPERTY_X86_FEATURE_1_LAM_U57;
else
{
error (_("Unknown x86 feature: %s\n"), feature);
@@ -920,9 +924,9 @@ usage (FILE *stream, int exit_status)
osabi, osabi);
#ifdef HAVE_MMAP
fprintf (stream, _("\
- --enable-x86-feature [ibt|shstk]\n\
+ --enable-x86-feature [ibt|shstk|lam_u48|lam_u57]\n\
Enable x86 feature\n\
- --disable-x86-feature [ibt|shstk]\n\
+ --disable-x86-feature [ibt|shstk|lam_u48|lam_u57]\n\
Disable x86 feature\n"));
#endif
fprintf (stream, _("\
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 22354ba..46fd87a 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -18748,6 +18748,12 @@ decode_x86_feature_1 (unsigned int bitmask)
case GNU_PROPERTY_X86_FEATURE_1_SHSTK:
printf ("SHSTK");
break;
+ case GNU_PROPERTY_X86_FEATURE_1_LAM_U48:
+ printf ("LAM_U48");
+ break;
+ case GNU_PROPERTY_X86_FEATURE_1_LAM_U57:
+ printf ("LAM_U57");
+ break;
default:
printf (_("<unknown: %x>"), bit);
break;
diff --git a/binutils/testsuite/binutils-all/x86-64/lam-u48.d b/binutils/testsuite/binutils-all/x86-64/lam-u48.d
new file mode 100644
index 0000000..92d7d81
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/lam-u48.d
@@ -0,0 +1,12 @@
+#PROG: objcopy
+#as: --64 -defsym __64_bit__=1 -mx86-used-note=yes
+#objcopy:
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: x86 feature: LAM_U48
+ GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0
+ Properties: x86 ISA used:
+ x86 feature used: x86
diff --git a/binutils/testsuite/binutils-all/x86-64/lam-u48.s b/binutils/testsuite/binutils-all/x86-64/lam-u48.s
new file mode 100644
index 0000000..52db75f
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/lam-u48.s
@@ -0,0 +1,27 @@
+ .section ".note.gnu.property", "a"
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long 5 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+2: .long 0xc0000002 /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long 0x4
+4:
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+5:
diff --git a/binutils/testsuite/binutils-all/x86-64/lam-u57.d b/binutils/testsuite/binutils-all/x86-64/lam-u57.d
new file mode 100644
index 0000000..c922075
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/lam-u57.d
@@ -0,0 +1,12 @@
+#PROG: objcopy
+#as: --64 -defsym __64_bit__=1 -mx86-used-note=yes
+#objcopy:
+#readelf: -n
+
+Displaying notes found in: .note.gnu.property
+[ ]+Owner[ ]+Data size[ ]+Description
+ GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
+ Properties: x86 feature: LAM_U57
+ GNU 0x00000020 NT_GNU_PROPERTY_TYPE_0
+ Properties: x86 ISA used:
+ x86 feature used: x86
diff --git a/binutils/testsuite/binutils-all/x86-64/lam-u57.s b/binutils/testsuite/binutils-all/x86-64/lam-u57.s
new file mode 100644
index 0000000..d53098d
--- /dev/null
+++ b/binutils/testsuite/binutils-all/x86-64/lam-u57.s
@@ -0,0 +1,27 @@
+ .section ".note.gnu.property", "a"
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+ .long 1f - 0f /* name length */
+ .long 5f - 2f /* data length */
+ .long 5 /* note type */
+0: .asciz "GNU" /* vendor name */
+1:
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+2: .long 0xc0000002 /* pr_type. */
+ .long 4f - 3f /* pr_datasz. */
+3:
+ .long 0x8
+4:
+.ifdef __64_bit__
+ .p2align 3
+.else
+ .p2align 2
+.endif
+5: