elfedit: Report unknown x86 feature
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 25 Oct 2019 22:13:21 +0000 (15:13 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 25 Oct 2019 22:13:21 +0000 (15:13 -0700)
Report unknown x86 feature:

$ ./elfedit --disable-x86-feature foo a.out
elfedit: Error: Unknown x86 feature: foo
$

* elfedit.c (elf_x86_feature): Report unknown x86 feature.

binutils/ChangeLog
binutils/elfedit.c

index 6c5143d30e6f0ec83476960fc79b0f12334c8b2b..7a56ce4abdc974a500d71046f8c78f11f9c96e43 100644 (file)
@@ -1,3 +1,7 @@
+2019-10-25  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elfedit.c (elf_x86_feature): Report unknown x86 feature.
+
 2019-10-25  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elfedit.c (update_gnu_property): Replace BYTE_PUT with byte_put.
index 5c0d711e8b17eb80cb06d381d361e998a63b75a3..da1984e5b1d2a7a83470e1b89812bc6a5ba604bc 100644 (file)
@@ -260,7 +260,10 @@ elf_x86_feature (const char *feature, int enable)
   else if (strcasecmp (feature, "shstk") == 0)
     x86_feature = GNU_PROPERTY_X86_FEATURE_1_SHSTK;
   else
-    return -1;
+    {
+      error (_("Unknown x86 feature: %s\n"), feature);
+      return -1;
+    }
 
   if (enable)
     {
This page took 0.027709 seconds and 4 git commands to generate.