[v2] x86: always set ISA_1_BASELINE property for 64-bit objects

Message ID 48c85359-3f31-40df-8421-5d62f533a348@suse.com
State New
Headers
Series [v2] x86: always set ISA_1_BASELINE property for 64-bit objects |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Jan Beulich Nov. 18, 2024, 10:49 a.m. UTC
  The baseline was, afaik, specifically chosen to align with the baseline
ISA of x86-64. It therefore makes no sense to emit that property only
conditionally; if anything it confuses tools analyzing the difference
between generated object files, which may result from just
added / changed / removed (entirely ISA-independent) code, without any
change to the enabled extensions. Compilers, after all, are free to use
these baseline "extensions" when generating 64-bit code.

While changing the one testcase that needs adjustment, also correct its
misleading name (to be in sync with the filename).
---
Question is whether doing this in output_insn() is enough: In principle
one might say that all objects should have the flag set, no matter
whether they had any insn emitted.

How come use of e.g. XSAVEC causes ISA_1_BASELINE to be set? How come
arbitrary VEX-encoded insns cause ISA_1_V3 to be set? How come arbitrary
EVEX-encoded insns cause ISA_1_V4 to be set?
---
v2: Also adjust linker tests.
  

Patch

--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -12154,7 +12154,8 @@  output_insn (const struct last_insn *las
       if (is_cpu (&i.tm, CpuXSAVEC))
 	x86_feature_2_used |= GNU_PROPERTY_X86_FEATURE_2_XSAVEC;
 
-      if (x86_feature_2_used
+      if (object_64bit
+	  || x86_feature_2_used
 	  || is_cpu (&i.tm, CpuCMOV)
 	  || is_cpu (&i.tm, CpuSYSCALL)
 	  || i.tm.mnem_off == MN_cmpxchg8b)
--- a/gas/testsuite/gas/i386/x86-64-property-14.d
+++ b/gas/testsuite/gas/i386/x86-64-property-14.d
@@ -1,9 +1,9 @@ 
-#name: x86-64 property 13
+#name: x86-64 property 14
 #as: -mx86-used-note=yes --generate-missing-build-notes=no
 #readelf: -n
 
 Displaying notes found in: .note.gnu.property
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
-      Properties: x86 ISA used: x86-64-v2
+      Properties: x86 ISA used: x86-64-baseline, x86-64-v2
 	x86 feature used: x86
--- a/ld/testsuite/ld-x86-64/pr24322a.d
+++ b/ld/testsuite/ld-x86-64/pr24322a.d
@@ -9,4 +9,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: SHSTK
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24322a-x32.d
+++ b/ld/testsuite/ld-x86-64/pr24322a-x32.d
@@ -9,4 +9,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000024	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: SHSTK
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24322b.d
+++ b/ld/testsuite/ld-x86-64/pr24322b.d
@@ -9,4 +9,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: SHSTK
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24322b-x32.d
+++ b/ld/testsuite/ld-x86-64/pr24322b-x32.d
@@ -9,4 +9,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000024	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: SHSTK
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24458a.d
+++ b/ld/testsuite/ld-x86-64/pr24458a.d
@@ -7,4 +7,4 @@  Displaying notes found in: .note.gnu.pro
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24458a-x32.d
+++ b/ld/testsuite/ld-x86-64/pr24458a-x32.d
@@ -7,4 +7,4 @@  Displaying notes found in: .note.gnu.pro
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24458b.d
+++ b/ld/testsuite/ld-x86-64/pr24458b.d
@@ -7,4 +7,4 @@  Displaying notes found in: .note.gnu.pro
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24458b-x32.d
+++ b/ld/testsuite/ld-x86-64/pr24458b-x32.d
@@ -7,4 +7,4 @@  Displaying notes found in: .note.gnu.pro
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24458c.d
+++ b/ld/testsuite/ld-x86-64/pr24458c.d
@@ -7,4 +7,4 @@  Displaying notes found in: .note.gnu.pro
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/pr24458c-x32.d
+++ b/ld/testsuite/ld-x86-64/pr24458c-x32.d
@@ -7,4 +7,4 @@  Displaying notes found in: .note.gnu.pro
 [ 	]+Owner[ 	]+Data size[ 	]+Description
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/property-1a.r
+++ b/ld/testsuite/ld-x86-64/property-1a.r
@@ -4,6 +4,6 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: no copy on protected 
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
 
 #pass
--- a/ld/testsuite/ld-x86-64/property-2a.r
+++ b/ld/testsuite/ld-x86-64/property-2a.r
@@ -4,6 +4,6 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x[0-9a-f]+	NT_GNU_PROPERTY_TYPE_0
       Properties: stack size: 0x800000
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
 
 #pass
--- a/ld/testsuite/ld-x86-64/property-x86-4a.d
+++ b/ld/testsuite/ld-x86-64/property-x86-4a.d
@@ -9,4 +9,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000028	NT_GNU_PROPERTY_TYPE_0
       Properties: no copy on protected 
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/property-x86-4a-x32.d
+++ b/ld/testsuite/ld-x86-64/property-x86-4a-x32.d
@@ -9,4 +9,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000020	NT_GNU_PROPERTY_TYPE_0
       Properties: no copy on protected 
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/property-x86-ibt5.d
+++ b/ld/testsuite/ld-x86-64/property-x86-ibt5.d
@@ -8,4 +8,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: IBT
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/property-x86-ibt5-x32.d
+++ b/ld/testsuite/ld-x86-64/property-x86-ibt5-x32.d
@@ -8,4 +8,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000024	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: IBT
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/property-x86-lam-u48-5.d
+++ b/ld/testsuite/ld-x86-64/property-x86-lam-u48-5.d
@@ -8,4 +8,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: LAM_U48, LAM_U57
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/property-x86-lam-u57-5.d
+++ b/ld/testsuite/ld-x86-64/property-x86-lam-u57-5.d
@@ -8,4 +8,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: LAM_U57
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/property-x86-shstk5.d
+++ b/ld/testsuite/ld-x86-64/property-x86-shstk5.d
@@ -8,4 +8,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000030	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: SHSTK
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline
--- a/ld/testsuite/ld-x86-64/property-x86-shstk5-x32.d
+++ b/ld/testsuite/ld-x86-64/property-x86-shstk5-x32.d
@@ -8,4 +8,4 @@  Displaying notes found in: .note.gnu.pro
   GNU                  0x00000024	NT_GNU_PROPERTY_TYPE_0
       Properties: x86 feature: SHSTK
 	x86 feature used: x86
-	x86 ISA used: 
+	x86 ISA used: x86-64-baseline