[2/5,ARC] Add Tag_ARC_ATR_version.

Message ID 20180724142641.2678-2-claziss@gmail.com
State New
Headers show
Series
  • [1/5,ARC] Update handling AUX-registers.
Related show

Commit Message

Claudiu Zissulescu July 24, 2018, 2:26 p.m.
From: claziss <claziss@synopsys.com>


Add a new tag (Tag_ARC_ATR_version) used to indicate if current
attributes are interpreted in GNU way. This attribute is used by
Synopsys custom compiler to correctly identify and interpret the
object attributes section as generated by GNU tools.

Ok to apply?
Claudiu

gas/
2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

	* config/tc-arc.c (arc_set_public_attributes): Add
	Tag_ARC_ATR_version.
	(arc_convert_symbolic_attribute): Likewise.
	* testsuite/gas/arc/attr-arc600.d: Update test.
	* testsuite/gas/arc/attr-arc600_mul32x16.d: Likewise.
	* testsuite/gas/arc/attr-arc600_norm.d: Likewise.
	* testsuite/gas/arc/attr-arc601.d: Likewise.
	* testsuite/gas/arc/attr-arc601_mul32x16.d: Likewise.
	* testsuite/gas/arc/attr-arc601_mul64.d: Likewise.
	* testsuite/gas/arc/attr-arc601_norm.d: Likewise.
	* testsuite/gas/arc/attr-arc700.d: Likewise.
	* testsuite/gas/arc/attr-arcem.d: Likewise.
	* testsuite/gas/arc/attr-archs.d: Likewise.
	* testsuite/gas/arc/attr-autodetect-1.d: Likewise.
	* testsuite/gas/arc/attr-cpu-a601.d: Likewise.
	* testsuite/gas/arc/attr-cpu-a700.d: Likewise.
	* testsuite/gas/arc/attr-cpu-em.d: Likewise.
	* testsuite/gas/arc/attr-cpu-hs.d: Likewise.
	* testsuite/gas/arc/attr-em.d: Likewise.
	* testsuite/gas/arc/attr-em4.d: Likewise.
	* testsuite/gas/arc/attr-em4_dmips.d: Likewise.
	* testsuite/gas/arc/attr-em4_fpuda.d: Likewise.
	* testsuite/gas/arc/attr-em4_fpus.d: Likewise.
	* testsuite/gas/arc/attr-hs.d: Likewise.
	* testsuite/gas/arc/attr-hs34.d: Likewise.
	* testsuite/gas/arc/attr-hs38.d: Likewise.
	* testsuite/gas/arc/attr-hs38_linux.d: Likewise.
	* testsuite/gas/arc/attr-mul64.d: Likewise.
	* testsuite/gas/arc/attr-name.d: Likewise.
	* testsuite/gas/arc/attr-nps400.d: Likewise.
	* testsuite/gas/arc/attr-override-mcpu.d: Likewise.
	* testsuite/gas/arc/attr-quarkse_em.d: Likewise.

bfd/
2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

	* elf32-arc.c (arc_elf_merge_attributes): Handle
	Tag_ARC_ATR_version.

binutils/
2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

	* readelf.c (display_arc_attribute): Print Tag_ARC_ATR_version.

include/
2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

	* elf/arc.h (Tag_ARC_ATR_version): New tag.

ld/
2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

	* testsuite/ld-arc/attr-merge-0.d: Update test.
	* testsuite/ld-arc/attr-merge-1.d: Likewise.
	* testsuite/ld-arc/attr-merge-2.d: Likewise.
	* testsuite/ld-arc/attr-merge-3.d: Likewise.
	* testsuite/ld-arc/attr-merge-5.d: Likewise.
---
 bfd/elf32-arc.c                              | 6 ++++++
 binutils/readelf.c                           | 6 ++++++
 gas/config/tc-arc.c                          | 6 +++++-
 gas/testsuite/gas/arc/attr-arc600.d          | 1 +
 gas/testsuite/gas/arc/attr-arc600_mul32x16.d | 1 +
 gas/testsuite/gas/arc/attr-arc600_norm.d     | 1 +
 gas/testsuite/gas/arc/attr-arc601.d          | 1 +
 gas/testsuite/gas/arc/attr-arc601_mul32x16.d | 1 +
 gas/testsuite/gas/arc/attr-arc601_mul64.d    | 1 +
 gas/testsuite/gas/arc/attr-arc601_norm.d     | 1 +
 gas/testsuite/gas/arc/attr-arc700.d          | 1 +
 gas/testsuite/gas/arc/attr-arcem.d           | 1 +
 gas/testsuite/gas/arc/attr-archs.d           | 1 +
 gas/testsuite/gas/arc/attr-autodetect-1.d    | 1 +
 gas/testsuite/gas/arc/attr-cpu-a601.d        | 1 +
 gas/testsuite/gas/arc/attr-cpu-a700.d        | 1 +
 gas/testsuite/gas/arc/attr-cpu-em.d          | 1 +
 gas/testsuite/gas/arc/attr-cpu-hs.d          | 1 +
 gas/testsuite/gas/arc/attr-em.d              | 1 +
 gas/testsuite/gas/arc/attr-em4.d             | 1 +
 gas/testsuite/gas/arc/attr-em4_dmips.d       | 1 +
 gas/testsuite/gas/arc/attr-em4_fpuda.d       | 1 +
 gas/testsuite/gas/arc/attr-em4_fpus.d        | 1 +
 gas/testsuite/gas/arc/attr-hs.d              | 1 +
 gas/testsuite/gas/arc/attr-hs34.d            | 1 +
 gas/testsuite/gas/arc/attr-hs38.d            | 1 +
 gas/testsuite/gas/arc/attr-hs38_linux.d      | 1 +
 gas/testsuite/gas/arc/attr-mul64.d           | 1 +
 gas/testsuite/gas/arc/attr-name.d            | 1 +
 gas/testsuite/gas/arc/attr-nps400.d          | 1 +
 gas/testsuite/gas/arc/attr-override-mcpu.d   | 1 +
 gas/testsuite/gas/arc/attr-quarkse_em.d      | 1 +
 include/elf/arc.h                            | 3 ++-
 ld/testsuite/ld-arc/attr-merge-0.d           | 1 +
 ld/testsuite/ld-arc/attr-merge-1.d           | 1 +
 ld/testsuite/ld-arc/attr-merge-2.d           | 1 +
 ld/testsuite/ld-arc/attr-merge-3.d           | 1 +
 ld/testsuite/ld-arc/attr-merge-5.d           | 1 +
 38 files changed, 53 insertions(+), 2 deletions(-)

-- 
2.17.1

Comments

Nick Clifton July 31, 2018, 4:03 p.m. | #1
Hi Claudiu,

> gas/

> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

> 

> 	* config/tc-arc.c (arc_set_public_attributes): Add

> 	Tag_ARC_ATR_version.

> 	(arc_convert_symbolic_attribute): Likewise.

> 	* testsuite/gas/arc/attr-arc600.d: Update test.

> 	* testsuite/gas/arc/attr-arc600_mul32x16.d: Likewise.

> 	* testsuite/gas/arc/attr-arc600_norm.d: Likewise.

> 	* testsuite/gas/arc/attr-arc601.d: Likewise.

> 	* testsuite/gas/arc/attr-arc601_mul32x16.d: Likewise.

> 	* testsuite/gas/arc/attr-arc601_mul64.d: Likewise.

> 	* testsuite/gas/arc/attr-arc601_norm.d: Likewise.

> 	* testsuite/gas/arc/attr-arc700.d: Likewise.

> 	* testsuite/gas/arc/attr-arcem.d: Likewise.

> 	* testsuite/gas/arc/attr-archs.d: Likewise.

> 	* testsuite/gas/arc/attr-autodetect-1.d: Likewise.

> 	* testsuite/gas/arc/attr-cpu-a601.d: Likewise.

> 	* testsuite/gas/arc/attr-cpu-a700.d: Likewise.

> 	* testsuite/gas/arc/attr-cpu-em.d: Likewise.

> 	* testsuite/gas/arc/attr-cpu-hs.d: Likewise.

> 	* testsuite/gas/arc/attr-em.d: Likewise.

> 	* testsuite/gas/arc/attr-em4.d: Likewise.

> 	* testsuite/gas/arc/attr-em4_dmips.d: Likewise.

> 	* testsuite/gas/arc/attr-em4_fpuda.d: Likewise.

> 	* testsuite/gas/arc/attr-em4_fpus.d: Likewise.

> 	* testsuite/gas/arc/attr-hs.d: Likewise.

> 	* testsuite/gas/arc/attr-hs34.d: Likewise.

> 	* testsuite/gas/arc/attr-hs38.d: Likewise.

> 	* testsuite/gas/arc/attr-hs38_linux.d: Likewise.

> 	* testsuite/gas/arc/attr-mul64.d: Likewise.

> 	* testsuite/gas/arc/attr-name.d: Likewise.

> 	* testsuite/gas/arc/attr-nps400.d: Likewise.

> 	* testsuite/gas/arc/attr-override-mcpu.d: Likewise.

> 	* testsuite/gas/arc/attr-quarkse_em.d: Likewise.

> 

> bfd/

> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

> 

> 	* elf32-arc.c (arc_elf_merge_attributes): Handle

> 	Tag_ARC_ATR_version.

> 

> binutils/

> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

> 

> 	* readelf.c (display_arc_attribute): Print Tag_ARC_ATR_version.

> 

> include/

> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

> 

> 	* elf/arc.h (Tag_ARC_ATR_version): New tag.

> 

> ld/

> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

> 

> 	* testsuite/ld-arc/attr-merge-0.d: Update test.

> 	* testsuite/ld-arc/attr-merge-1.d: Likewise.

> 	* testsuite/ld-arc/attr-merge-2.d: Likewise.

> 	* testsuite/ld-arc/attr-merge-3.d: Likewise.

> 	* testsuite/ld-arc/attr-merge-5.d: Likewise.

 
Approved - please apply.

Cheers
  Nick
Sergio Durigan Junior Aug. 6, 2018, 4:21 p.m. | #2
On Tuesday, July 31 2018, Nick Clifton wrote:

> Hi Claudiu,

>

>> gas/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>> 

>> 	* config/tc-arc.c (arc_set_public_attributes): Add

>> 	Tag_ARC_ATR_version.

>> 	(arc_convert_symbolic_attribute): Likewise.

>> 	* testsuite/gas/arc/attr-arc600.d: Update test.

>> 	* testsuite/gas/arc/attr-arc600_mul32x16.d: Likewise.

>> 	* testsuite/gas/arc/attr-arc600_norm.d: Likewise.

>> 	* testsuite/gas/arc/attr-arc601.d: Likewise.

>> 	* testsuite/gas/arc/attr-arc601_mul32x16.d: Likewise.

>> 	* testsuite/gas/arc/attr-arc601_mul64.d: Likewise.

>> 	* testsuite/gas/arc/attr-arc601_norm.d: Likewise.

>> 	* testsuite/gas/arc/attr-arc700.d: Likewise.

>> 	* testsuite/gas/arc/attr-arcem.d: Likewise.

>> 	* testsuite/gas/arc/attr-archs.d: Likewise.

>> 	* testsuite/gas/arc/attr-autodetect-1.d: Likewise.

>> 	* testsuite/gas/arc/attr-cpu-a601.d: Likewise.

>> 	* testsuite/gas/arc/attr-cpu-a700.d: Likewise.

>> 	* testsuite/gas/arc/attr-cpu-em.d: Likewise.

>> 	* testsuite/gas/arc/attr-cpu-hs.d: Likewise.

>> 	* testsuite/gas/arc/attr-em.d: Likewise.

>> 	* testsuite/gas/arc/attr-em4.d: Likewise.

>> 	* testsuite/gas/arc/attr-em4_dmips.d: Likewise.

>> 	* testsuite/gas/arc/attr-em4_fpuda.d: Likewise.

>> 	* testsuite/gas/arc/attr-em4_fpus.d: Likewise.

>> 	* testsuite/gas/arc/attr-hs.d: Likewise.

>> 	* testsuite/gas/arc/attr-hs34.d: Likewise.

>> 	* testsuite/gas/arc/attr-hs38.d: Likewise.

>> 	* testsuite/gas/arc/attr-hs38_linux.d: Likewise.

>> 	* testsuite/gas/arc/attr-mul64.d: Likewise.

>> 	* testsuite/gas/arc/attr-name.d: Likewise.

>> 	* testsuite/gas/arc/attr-nps400.d: Likewise.

>> 	* testsuite/gas/arc/attr-override-mcpu.d: Likewise.

>> 	* testsuite/gas/arc/attr-quarkse_em.d: Likewise.

>> 

>> bfd/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>> 

>> 	* elf32-arc.c (arc_elf_merge_attributes): Handle

>> 	Tag_ARC_ATR_version.

>> 

>> binutils/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>> 

>> 	* readelf.c (display_arc_attribute): Print Tag_ARC_ATR_version.

>> 

>> include/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>> 

>> 	* elf/arc.h (Tag_ARC_ATR_version): New tag.

>> 

>> ld/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>> 

>> 	* testsuite/ld-arc/attr-merge-0.d: Update test.

>> 	* testsuite/ld-arc/attr-merge-1.d: Likewise.

>> 	* testsuite/ld-arc/attr-merge-2.d: Likewise.

>> 	* testsuite/ld-arc/attr-merge-3.d: Likewise.

>> 	* testsuite/ld-arc/attr-merge-5.d: Likewise.

>  

> Approved - please apply.


This patch has caused a breakage when building GDB with
--enable-targets=all.  Take a look at the thread at:

https://sourceware.org/ml/gdb-patches/2018-08/msg00086.html

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
Claudiu Zissulescu Aug. 7, 2018, 8:09 a.m. | #3
Hi Sergio,

The issue should be fixed by the subsequent patches.

Please let me know if you see otherwise,
Claudiu
________________________________________
From: Sergio Durigan Junior [sergiodj@redhat.com]

Sent: Monday, August 06, 2018 6:21 PM
To: Nick Clifton
Cc: Claudiu Zissulescu; binutils@sourceware.org; Francois.Bedard@synopsys.com; Claudiu Zissulescu
Subject: Re: [PATCH 2/5] [ARC] Add Tag_ARC_ATR_version.

On Tuesday, July 31 2018, Nick Clifton wrote:

> Hi Claudiu,

>

>> gas/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>>

>>      * config/tc-arc.c (arc_set_public_attributes): Add

>>      Tag_ARC_ATR_version.

>>      (arc_convert_symbolic_attribute): Likewise.

>>      * testsuite/gas/arc/attr-arc600.d: Update test.

>>      * testsuite/gas/arc/attr-arc600_mul32x16.d: Likewise.

>>      * testsuite/gas/arc/attr-arc600_norm.d: Likewise.

>>      * testsuite/gas/arc/attr-arc601.d: Likewise.

>>      * testsuite/gas/arc/attr-arc601_mul32x16.d: Likewise.

>>      * testsuite/gas/arc/attr-arc601_mul64.d: Likewise.

>>      * testsuite/gas/arc/attr-arc601_norm.d: Likewise.

>>      * testsuite/gas/arc/attr-arc700.d: Likewise.

>>      * testsuite/gas/arc/attr-arcem.d: Likewise.

>>      * testsuite/gas/arc/attr-archs.d: Likewise.

>>      * testsuite/gas/arc/attr-autodetect-1.d: Likewise.

>>      * testsuite/gas/arc/attr-cpu-a601.d: Likewise.

>>      * testsuite/gas/arc/attr-cpu-a700.d: Likewise.

>>      * testsuite/gas/arc/attr-cpu-em.d: Likewise.

>>      * testsuite/gas/arc/attr-cpu-hs.d: Likewise.

>>      * testsuite/gas/arc/attr-em.d: Likewise.

>>      * testsuite/gas/arc/attr-em4.d: Likewise.

>>      * testsuite/gas/arc/attr-em4_dmips.d: Likewise.

>>      * testsuite/gas/arc/attr-em4_fpuda.d: Likewise.

>>      * testsuite/gas/arc/attr-em4_fpus.d: Likewise.

>>      * testsuite/gas/arc/attr-hs.d: Likewise.

>>      * testsuite/gas/arc/attr-hs34.d: Likewise.

>>      * testsuite/gas/arc/attr-hs38.d: Likewise.

>>      * testsuite/gas/arc/attr-hs38_linux.d: Likewise.

>>      * testsuite/gas/arc/attr-mul64.d: Likewise.

>>      * testsuite/gas/arc/attr-name.d: Likewise.

>>      * testsuite/gas/arc/attr-nps400.d: Likewise.

>>      * testsuite/gas/arc/attr-override-mcpu.d: Likewise.

>>      * testsuite/gas/arc/attr-quarkse_em.d: Likewise.

>>

>> bfd/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>>

>>      * elf32-arc.c (arc_elf_merge_attributes): Handle

>>      Tag_ARC_ATR_version.

>>

>> binutils/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>>

>>      * readelf.c (display_arc_attribute): Print Tag_ARC_ATR_version.

>>

>> include/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>>

>>      * elf/arc.h (Tag_ARC_ATR_version): New tag.

>>

>> ld/

>> 2017-08-02  Claudiu Zissulescu <claziss@synopsys.com>

>>

>>      * testsuite/ld-arc/attr-merge-0.d: Update test.

>>      * testsuite/ld-arc/attr-merge-1.d: Likewise.

>>      * testsuite/ld-arc/attr-merge-2.d: Likewise.

>>      * testsuite/ld-arc/attr-merge-3.d: Likewise.

>>      * testsuite/ld-arc/attr-merge-5.d: Likewise.

>

> Approved - please apply.


This patch has caused a breakage when building GDB with
--enable-targets=all.  Take a look at the thread at:

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceware.org_ml_gdb-2Dpatches_2018-2D08_msg00086.html&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=b2VHJoEjhKNyJsq83CfdaxxygdKCK0wyHCxOiY76Jo4&m=Hmhg44jEuBy4By6ETZdxMckJpYYBH--8_F-aqn0qnMI&s=KyCkyHZjl614_1P6XuENPjlEFelMoGNYEPl_j6rGtj0&e=

Thanks,

--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
https://urldefense.proofpoint.com/v2/url?u=http-3A__sergiodj.net_&d=DwIBAg&c=DPL6_X_6JkXFx7AXWqB0tg&r=b2VHJoEjhKNyJsq83CfdaxxygdKCK0wyHCxOiY76Jo4&m=Hmhg44jEuBy4By6ETZdxMckJpYYBH--8_F-aqn0qnMI&s=M2h09PU_4dDjU4qPoOEGQ_PTWkG98sP-lSkPR67f9e8&e=
Sergio Durigan Junior Aug. 7, 2018, 3:27 p.m. | #4
On Tuesday, August 07 2018, Claudiu Zissulescu wrote:

> Hi Sergio,

>

> The issue should be fixed by the subsequent patches.


Thanks, Claudiu.  It's apparently fixed, indeed.

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

Patch

diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index a48ef0ca15..aaa2c3b990 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -578,6 +578,7 @@  arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
   bfd_boolean result = TRUE;
   const char *sec_name = get_elf_backend_data (ibfd)->obj_attrs_section;
   char *tagname = NULL;
+  int offset = 0;
 
   /* Skip the linker stubs file.  This preserves previous behavior
      of accepting unknown attributes in the first input file - but
@@ -805,6 +806,11 @@  arc_elf_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
 	  /* It is handled in Tag_ARC_CPU_base.  */
 	  break;
 
+	case Tag_ARC_ATR_version:
+	  if (out_attr[i].i == 0)
+	    out_attr[i].i = in_attr[i].i;
+	  break;
+
 	default:
 	  result
 	    = result && _bfd_elf_merge_unknown_attribute_low (ibfd, obfd, i);
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 7c5a0266bd..d55ffeced8 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -14212,6 +14212,12 @@  display_arc_attribute (unsigned char * p,
       printf ("  Tag_ARC_ISA_mpy_option: %d\n", val);
       break;
 
+    case Tag_ARC_ATR_version:
+      val = read_uleb128 (p, &len, end);
+      p += len;
+      printf ("  Tag_ARC_ATR_version: %d\n", val);
+      break;
+
     default:
       return display_tag_value (tag & 1, p, end);
     }
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 7c8f7b357c..ddc5de8363 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -5013,6 +5013,9 @@  arc_set_public_attributes (void)
 
   /* Tag_ARC_ABI_tls.  */
   arc_set_attribute_int (Tag_ARC_ABI_tls, tls_option);
+
+  /* Tag_ARC_ATR_version.  */
+  arc_set_attribute_int (Tag_ARC_ATR_version, 1);
 }
 
 /* Add the default contents for the .ARC.attributes section.  */
@@ -5057,7 +5060,8 @@  int arc_convert_symbolic_attribute (const char *name)
   T (Tag_ARC_ABI_double_size),
   T (Tag_ARC_ISA_config),
   T (Tag_ARC_ISA_apex),
-  T (Tag_ARC_ISA_mpy_option)
+  T (Tag_ARC_ISA_mpy_option),
+  T (Tag_ARC_ATR_version)
 #undef T
     };
   unsigned int i;
diff --git a/gas/testsuite/gas/arc/attr-arc600.d b/gas/testsuite/gas/arc/attr-arc600.d
index 07eecc6a0d..db252f81cd 100644
--- a/gas/testsuite/gas/arc/attr-arc600.d
+++ b/gas/testsuite/gas/arc/attr-arc600.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc600"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-arc600_mul32x16.d b/gas/testsuite/gas/arc/attr-arc600_mul32x16.d
index 6ca411d3ee..b88839dea6 100644
--- a/gas/testsuite/gas/arc/attr-arc600_mul32x16.d
+++ b/gas/testsuite/gas/arc/attr-arc600_mul32x16.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc600_mul32x16"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-arc600_norm.d b/gas/testsuite/gas/arc/attr-arc600_norm.d
index 2ff0a71b4f..58dd43ee5c 100644
--- a/gas/testsuite/gas/arc/attr-arc600_norm.d
+++ b/gas/testsuite/gas/arc/attr-arc600_norm.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc600_norm"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-arc601.d b/gas/testsuite/gas/arc/attr-arc601.d
index f8fb744f80..7c660569e9 100644
--- a/gas/testsuite/gas/arc/attr-arc601.d
+++ b/gas/testsuite/gas/arc/attr-arc601.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc601"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-arc601_mul32x16.d b/gas/testsuite/gas/arc/attr-arc601_mul32x16.d
index 8104276243..9fff7508e3 100644
--- a/gas/testsuite/gas/arc/attr-arc601_mul32x16.d
+++ b/gas/testsuite/gas/arc/attr-arc601_mul32x16.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc601_mul32x16"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-arc601_mul64.d b/gas/testsuite/gas/arc/attr-arc601_mul64.d
index 998547652f..96ff6961a4 100644
--- a/gas/testsuite/gas/arc/attr-arc601_mul64.d
+++ b/gas/testsuite/gas/arc/attr-arc601_mul64.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc601_mul64"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-arc601_norm.d b/gas/testsuite/gas/arc/attr-arc601_norm.d
index 18131dcb65..6019a12f84 100644
--- a/gas/testsuite/gas/arc/attr-arc601_norm.d
+++ b/gas/testsuite/gas/arc/attr-arc601_norm.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc601_norm"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-arc700.d b/gas/testsuite/gas/arc/attr-arc700.d
index cc4dc38ccc..41a5f740c6 100644
--- a/gas/testsuite/gas/arc/attr-arc700.d
+++ b/gas/testsuite/gas/arc/attr-arc700.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC7xx
   Tag_ARC_CPU_name: "arc700"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-arcem.d b/gas/testsuite/gas/arc/attr-arcem.d
index da9747387f..25a6958bd7 100644
--- a/gas/testsuite/gas/arc/attr-arcem.d
+++ b/gas/testsuite/gas/arc/attr-arcem.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARCEM
   Tag_ARC_CPU_name: "arcem"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-archs.d b/gas/testsuite/gas/arc/attr-archs.d
index c0d2e6350c..a32d76ea42 100644
--- a/gas/testsuite/gas/arc/attr-archs.d
+++ b/gas/testsuite/gas/arc/attr-archs.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "archs"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-autodetect-1.d b/gas/testsuite/gas/arc/attr-autodetect-1.d
index bbe8525498..73352c9e56 100644
--- a/gas/testsuite/gas/arc/attr-autodetect-1.d
+++ b/gas/testsuite/gas/arc/attr-autodetect-1.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_ABI_pic: GNU
   Tag_ARC_ABI_tls: r25
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-cpu-a601.d b/gas/testsuite/gas/arc/attr-cpu-a601.d
index 33a2f3147d..97c1f91d4c 100644
--- a/gas/testsuite/gas/arc/attr-cpu-a601.d
+++ b/gas/testsuite/gas/arc/attr-cpu-a601.d
@@ -6,3 +6,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc601"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-cpu-a700.d b/gas/testsuite/gas/arc/attr-cpu-a700.d
index db69adecc6..41c0c67a5a 100644
--- a/gas/testsuite/gas/arc/attr-cpu-a700.d
+++ b/gas/testsuite/gas/arc/attr-cpu-a700.d
@@ -6,3 +6,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC7xx
   Tag_ARC_CPU_name: "arc700"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-cpu-em.d b/gas/testsuite/gas/arc/attr-cpu-em.d
index c635bd5ad7..5b26025ce0 100644
--- a/gas/testsuite/gas/arc/attr-cpu-em.d
+++ b/gas/testsuite/gas/arc/attr-cpu-em.d
@@ -6,3 +6,4 @@  File Attributes
   Tag_ARC_CPU_base: ARCEM
   Tag_ARC_CPU_name: "em"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-cpu-hs.d b/gas/testsuite/gas/arc/attr-cpu-hs.d
index 4de82ad7d7..aa8a3e66b6 100644
--- a/gas/testsuite/gas/arc/attr-cpu-hs.d
+++ b/gas/testsuite/gas/arc/attr-cpu-hs.d
@@ -7,3 +7,4 @@  File Attributes
   Tag_ARC_CPU_name: "hs"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-em.d b/gas/testsuite/gas/arc/attr-em.d
index a322ff6581..94e365ac69 100644
--- a/gas/testsuite/gas/arc/attr-em.d
+++ b/gas/testsuite/gas/arc/attr-em.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARCEM
   Tag_ARC_CPU_name: "em"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-em4.d b/gas/testsuite/gas/arc/attr-em4.d
index bbc6e676f0..32d312fdad 100644
--- a/gas/testsuite/gas/arc/attr-em4.d
+++ b/gas/testsuite/gas/arc/attr-em4.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "em4"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-em4_dmips.d b/gas/testsuite/gas/arc/attr-em4_dmips.d
index 4d923bdb98..1973db27bc 100644
--- a/gas/testsuite/gas/arc/attr-em4_dmips.d
+++ b/gas/testsuite/gas/arc/attr-em4_dmips.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "em4_dmips"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-em4_fpuda.d b/gas/testsuite/gas/arc/attr-em4_fpuda.d
index 432315a34c..2ff3f66701 100644
--- a/gas/testsuite/gas/arc/attr-em4_fpuda.d
+++ b/gas/testsuite/gas/arc/attr-em4_fpuda.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "em4_fpuda"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD,FPUDA"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-em4_fpus.d b/gas/testsuite/gas/arc/attr-em4_fpus.d
index b658e2aa57..e5cdb914d8 100644
--- a/gas/testsuite/gas/arc/attr-em4_fpus.d
+++ b/gas/testsuite/gas/arc/attr-em4_fpus.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "em4_fpus"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-hs.d b/gas/testsuite/gas/arc/attr-hs.d
index 8486214918..716635bef2 100644
--- a/gas/testsuite/gas/arc/attr-hs.d
+++ b/gas/testsuite/gas/arc/attr-hs.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "hs"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-hs34.d b/gas/testsuite/gas/arc/attr-hs34.d
index 8b92ec6a9c..2bf6a12de4 100644
--- a/gas/testsuite/gas/arc/attr-hs34.d
+++ b/gas/testsuite/gas/arc/attr-hs34.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "hs34"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-hs38.d b/gas/testsuite/gas/arc/attr-hs38.d
index 89724313a9..915ccdd4d6 100644
--- a/gas/testsuite/gas/arc/attr-hs38.d
+++ b/gas/testsuite/gas/arc/attr-hs38.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "hs38"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-hs38_linux.d b/gas/testsuite/gas/arc/attr-hs38_linux.d
index a695f29dfa..41b5eda788 100644
--- a/gas/testsuite/gas/arc/attr-hs38_linux.d
+++ b/gas/testsuite/gas/arc/attr-hs38_linux.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "hs38_linux"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-mul64.d b/gas/testsuite/gas/arc/attr-mul64.d
index 5fc75ff965..81cb72244f 100644
--- a/gas/testsuite/gas/arc/attr-mul64.d
+++ b/gas/testsuite/gas/arc/attr-mul64.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_base: ARC6xx
   Tag_ARC_CPU_name: "arc600_mul64"
   Tag_ARC_ABI_osver: v4
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-name.d b/gas/testsuite/gas/arc/attr-name.d
index ff9a34bb9b..25e3ce823b 100644
--- a/gas/testsuite/gas/arc/attr-name.d
+++ b/gas/testsuite/gas/arc/attr-name.d
@@ -20,3 +20,4 @@  File Attributes
   Tag_ARC_ISA_config: "CD,FPUDA"
   Tag_ARC_ISA_apex: "QUARKSE"
   Tag_ARC_ISA_mpy_option: 6
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-nps400.d b/gas/testsuite/gas/arc/attr-nps400.d
index 15009cedf0..403d04635b 100644
--- a/gas/testsuite/gas/arc/attr-nps400.d
+++ b/gas/testsuite/gas/arc/attr-nps400.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "nps400"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "NPS400"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-override-mcpu.d b/gas/testsuite/gas/arc/attr-override-mcpu.d
index 67241e99df..a8a88e4463 100644
--- a/gas/testsuite/gas/arc/attr-override-mcpu.d
+++ b/gas/testsuite/gas/arc/attr-override-mcpu.d
@@ -8,3 +8,4 @@  File Attributes
   Tag_ARC_CPU_name: "archs"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/gas/testsuite/gas/arc/attr-quarkse_em.d b/gas/testsuite/gas/arc/attr-quarkse_em.d
index 64c85c3e68..3f433c4d55 100644
--- a/gas/testsuite/gas/arc/attr-quarkse_em.d
+++ b/gas/testsuite/gas/arc/attr-quarkse_em.d
@@ -9,3 +9,4 @@  File Attributes
   Tag_ARC_CPU_name: "quarkse_em"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD,DPFP,SPFP"
+  Tag_ARC_ATR_version: 1
diff --git a/include/elf/arc.h b/include/elf/arc.h
index 85617fc0c9..72eaf1be16 100644
--- a/include/elf/arc.h
+++ b/include/elf/arc.h
@@ -83,7 +83,8 @@  enum {
   Tag_ARC_ABI_double_size,
   Tag_ARC_ISA_config,
   Tag_ARC_ISA_apex,
-  Tag_ARC_ISA_mpy_option
+  Tag_ARC_ISA_mpy_option,
+  Tag_ARC_ATR_version = 20
 };
 
 /* Values for the Tag_ARC_cpu_base attribute.  */
diff --git a/ld/testsuite/ld-arc/attr-merge-0.d b/ld/testsuite/ld-arc/attr-merge-0.d
index 2c3a9091a9..eda47ade28 100644
--- a/ld/testsuite/ld-arc/attr-merge-0.d
+++ b/ld/testsuite/ld-arc/attr-merge-0.d
@@ -10,3 +10,4 @@  File Attributes
   Tag_ARC_CPU_name: "em"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/ld/testsuite/ld-arc/attr-merge-1.d b/ld/testsuite/ld-arc/attr-merge-1.d
index e2e804d78a..e4ef91993d 100644
--- a/ld/testsuite/ld-arc/attr-merge-1.d
+++ b/ld/testsuite/ld-arc/attr-merge-1.d
@@ -10,3 +10,4 @@  File Attributes
   Tag_ARC_CPU_name: "em"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD,DPFP,SPFP"
+  Tag_ARC_ATR_version: 1
diff --git a/ld/testsuite/ld-arc/attr-merge-2.d b/ld/testsuite/ld-arc/attr-merge-2.d
index 4c6898e3c5..9d57d4857e 100644
--- a/ld/testsuite/ld-arc/attr-merge-2.d
+++ b/ld/testsuite/ld-arc/attr-merge-2.d
@@ -10,3 +10,4 @@  File Attributes
   Tag_ARC_CPU_name: "em"
   Tag_ARC_ABI_osver: v5
   Tag_ARC_ISA_config: "CD"
+  Tag_ARC_ATR_version: 1
diff --git a/ld/testsuite/ld-arc/attr-merge-3.d b/ld/testsuite/ld-arc/attr-merge-3.d
index 00d6de08cc..bac898f1e8 100644
--- a/ld/testsuite/ld-arc/attr-merge-3.d
+++ b/ld/testsuite/ld-arc/attr-merge-3.d
@@ -10,3 +10,4 @@  File Attributes
   Tag_ARC_CPU_name: "archs"
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD,FPUS"
+  Tag_ARC_ATR_version: 1
diff --git a/ld/testsuite/ld-arc/attr-merge-5.d b/ld/testsuite/ld-arc/attr-merge-5.d
index f08b762409..3f661bec0d 100644
--- a/ld/testsuite/ld-arc/attr-merge-5.d
+++ b/ld/testsuite/ld-arc/attr-merge-5.d
@@ -11,3 +11,4 @@  File Attributes
   Tag_ARC_ABI_osver: v4
   Tag_ARC_ISA_config: "CD,FPUDA,BS"
   Tag_ARC_ISA_mpy_option: 6
+  Tag_ARC_ATR_version: 1