aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2017-05-10 14:42:22 +0200
committerclaziss <claziss@synopsys.com>2017-05-10 14:42:22 +0200
commit53a346d8236aec06f1d3c767716d3340fb0aa013 (patch)
tree4de962aabfa44a9640583f64e8af3e032be12947 /binutils
parent21d1fbeed4b7c4d006e399437445519e6505088f (diff)
downloadgdb-53a346d8236aec06f1d3c767716d3340fb0aa013.zip
gdb-53a346d8236aec06f1d3c767716d3340fb0aa013.tar.gz
gdb-53a346d8236aec06f1d3c767716d3340fb0aa013.tar.bz2
[ARC] Object attributes.
gas/ 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/gas/arc/attr-arc600.d: New file. * 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-autodetect-1.s: Likewise. * testsuite/gas/arc/attr-cpu-a601.d: Likewise. * testsuite/gas/arc/attr-cpu-a601.s: Likewise. * testsuite/gas/arc/attr-cpu-a700.d: Likewise. * testsuite/gas/arc/attr-cpu-a700.s: Likewise. * testsuite/gas/arc/attr-cpu-em.d: Likewise. * testsuite/gas/arc/attr-cpu-em.s: Likewise. * testsuite/gas/arc/attr-cpu-hs.d: Likewise. * testsuite/gas/arc/attr-cpu-hs.s: 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-name.s: Likewise. * testsuite/gas/arc/attr-nps400.d: Likewise. * testsuite/gas/arc/attr-override-mcpu.d: Likewise. * testsuite/gas/arc/attr-override-mcpu.s * testsuite/gas/arc/attr-quarkse_em.d: Likewise. * testsuite/gas/arc/blank.s: Likewise. * testsuite/gas/elf/section2.e-arc: Likewise. * testsuite/gas/arc/cpu-pseudop-1.d: Update test. * testsuite/gas/arc/cpu-pseudop-2.d: Likewise. * testsuite/gas/arc/nps400-0.d: Likewise. * testsuite/gas/elf/elf.exp: Set target_machine for ARC. * config/tc-arc.c (opcode/arc-attrs.h): Include. (ARC_GET_FLAG, ARC_SET_FLAG, streq): Define. (arc_attribute): Declare new function. (md_pseudo_table): Add arc_attribute. (cpu_types): Rename default cpu features. (selected_cpu): Set the default OSABI flag. (mpy_option): New variable. (pic_option): Likewise. (sda_option): Likewise. (tls_option): Likewise. (feature_type, feature_list): Remove. (arc_initial_eflag): Likewise. (attributes_set_explicitly): New variable. (arc_check_feature): Check also for the conflicting features. (arc_select_cpu): Refactor assignment of selected_cpu.eflags. (arc_option): Remove setting of private flags and architecture. (check_cpu_feature): Refactor feature names. (autodetect_attributes): New function. (assemble_tokens): Use above function. (md_parse_option): Refactor feature names. (arc_attribute): New function. (arc_set_attribute_int): Likewise. (arc_set_attribute_string): Likewise. (arc_stralloc): Likewise. (arc_set_public_attributes): Likewise. (arc_md_end): Likewise. (arc_copy_symbol_attributes): Likewise. (rc_convert_symbolic_attribute): Likewise. * config/tc-arc.h (md_end): Define. (CONVERT_SYMBOLIC_ATTRIBUTE): Likewise. (TC_COPY_SYMBOL_ATTRIBUTES): Likewise. * doc/c-arc.texi: Document ARC object attributes. binutils/ 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com> * readelf.c (decode_ARC_machine_flags): Recognize OSABI v4. (get_arc_section_type_name): New function. (get_section_type_name): Use the above function. (display_arc_attribute): New function. (process_arc_specific): Likewise. (process_arch_specific): Handle ARC specific information. * testsuite/binutils-all/strip-3.d: Consider ARC.attributes section. include/ 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com> * elf/arc.h (SHT_ARC_ATTRIBUTES): Define. (Tag_ARC_*): Define. (E_ARC_OSABI_V4): Define. (E_ARC_OSABI_CURRENT): Reassign it. (TAG_CPU_*): Define. * opcode/arc-attrs.h: New file. * opcode/arc.h (insn_subclass_t): Assign enum values. (insn_subclass_t): Update enum with QUARKSE1, QUARKSE2, and LL64. (ARC_EA, ARC_CD, ARC_LLOCK, ARC_ATOMIC, ARC_MPY, ARC_MULT) (ARC_NPS400, ARC_DPFP, ARC_SPFP, ARC_FPU, ARC_FPUDA, ARC_SWAP) (ARC_NORM, ARC_BSCAN, ARC_UIX, ARC_TSTAMP, ARC_VBFDW) (ARC_BARREL, ARC_DSPA, ARC_SHIFT, ARC_INTR, ARC_DIV, ARC_XMAC) (ARC_CRC): Delete. bfd/ 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com> * elf32-arc.c (FEATURE_LIST_NAME): Define. (CONFLICT_LIST): Likewise. (opcode/arc-attrs.h): Include. (arc_elf_print_private_bfd_data): Print OSABI v4 flag. (arc_extract_features): New file. (arc_stralloc): Likewise. (arc_elf_merge_attributes): Likewise. (arc_elf_merge_private_bfd_data): Use object attributes. (bfd_arc_get_mach_from_attributes): New function. (arc_elf_object_p): Use object attributes. (arc_elf_final_write_processing): Likewise. (elf32_arc_obj_attrs_arg_type): New function. (elf32_arc_obj_attrs_handle_unknown): Likewise. (elf32_arc_section_from_shdr): Likewise. (elf_backend_obj_attrs_vendor): Define. (elf_backend_obj_attrs_section): Likewise. (elf_backend_obj_attrs_arg_type): Likewise. (elf_backend_obj_attrs_section_type): Likewise. (elf_backend_obj_attrs_handle_unknown): Likewise. (elf_backend_section_from_shdr): Likewise. ld/ 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com> * testsuite/ld-arc/attr-merge-0.d: New file. * testsuite/ld-arc/attr-merge-0.s: Likewise. * testsuite/ld-arc/attr-merge-0e.s: Likewise. * testsuite/ld-arc/attr-merge-1.d: Likewise. * testsuite/ld-arc/attr-merge-1.s: Likewise. * testsuite/ld-arc/attr-merge-1e.s: Likewise. * testsuite/ld-arc/attr-merge-2.d: Likewise. * testsuite/ld-arc/attr-merge-2.s: Likewise. * testsuite/ld-arc/attr-merge-3.d: Likewise. * testsuite/ld-arc/attr-merge-3.s: Likewise. * testsuite/ld-arc/attr-merge-3e.s: Likewise. * testsuite/ld-arc/attr-merge-4.s: Likewise. * testsuite/ld-arc/attr-merge-5.d: Likewise. * testsuite/ld-arc/attr-merge-5a.s: Likewise. * testsuite/ld-arc/attr-merge-5b.s: Likewise. * testsuite/ld-arc/attr-merge-conflict-isa.d: Likewise. * testsuite/ld-arc/attr-merge-err-isa.d: Likewise. * testsuite/ld-arc/attr-merge-incompatible-cpu.d: Likewise. * testsuite/ld-arc/got-01.d: Update test. * testsuite/ld-arc/attr-merge-err-quarkse.d: New file. * testsuite/ld-arc/attr-quarkse.s: Likewise. * testsuite/ld-arc/attr-quarkse2.s: Likewise. opcodes/ 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com> * arc-dis.c (parse_option): Update quarkse_em option.. * arc-ext-tbl.h (dsp_fp_flt2i, dsp_fp_i2flt): Change subclass to QUARKSE1. (dsp_fp_div, dsp_fp_cmp): Change subclass to QUARKSE2.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog9
-rw-r--r--binutils/readelf.c200
-rw-r--r--binutils/testsuite/binutils-all/strip-3.d2
3 files changed, 210 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index bdbfbfe..4bf26f8 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,12 @@
+2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
+
+ * readelf.c (decode_ARC_machine_flags): Recognize OSABI v4.
+ (get_arc_section_type_name): New function.
+ (get_section_type_name): Use the above function.
+ (display_arc_attribute): New function.
+ (process_arc_specific): Likewise.
+ (process_arch_specific): Handle ARC specific information.
+
2017-05-09 Kaz Kojima <kkojima@rr.iij4u.or.jp>
* MAINTAINERS (SH): Remove myself as SH maintainer.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index fba6516..16eb866 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -2508,6 +2508,9 @@ decode_ARC_machine_flags (unsigned e_flags, unsigned e_machine, char buf[])
case E_ARC_OSABI_V3:
strcat (buf, ", v3 no-legacy-syscalls ABI");
break;
+ case E_ARC_OSABI_V4:
+ strcat (buf, ", v4 ABI");
+ break;
default:
strcat (buf, ", unrecognised ARC OSABI flag");
break;
@@ -3898,6 +3901,18 @@ get_segment_type (unsigned long p_type)
}
static const char *
+get_arc_section_type_name (unsigned int sh_type)
+{
+ switch (sh_type)
+ {
+ case SHT_ARC_ATTRIBUTES: return "ARC_ATTRIBUTES";
+ default:
+ break;
+ }
+ return NULL;
+}
+
+static const char *
get_mips_section_type_name (unsigned int sh_type)
{
switch (sh_type)
@@ -4106,6 +4121,11 @@ get_section_type_name (unsigned int sh_type)
{
switch (elf_header.e_machine)
{
+ case EM_ARC:
+ case EM_ARC_COMPACT:
+ case EM_ARC_COMPACT2:
+ result = get_arc_section_type_name (sh_type);
+ break;
case EM_MIPS:
case EM_MIPS_RS3_LE:
result = get_mips_section_type_name (sh_type);
@@ -13491,6 +13511,180 @@ display_tag_value (signed int tag,
return p;
}
+/* ARC ABI attributes section. */
+
+static unsigned char *
+display_arc_attribute (unsigned char * p,
+ const unsigned char * const end)
+{
+ unsigned int tag;
+ unsigned int len;
+ unsigned int val;
+
+ tag = read_uleb128 (p, &len, end);
+ p += len;
+
+ switch (tag)
+ {
+ case Tag_ARC_PCS_config:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_PCS_config: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("Absent/Non standard\n"));
+ break;
+ case 1:
+ printf (_("Bare metal/mwdt\n"));
+ break;
+ case 2:
+ printf (_("Bare metal/newlib\n"));
+ break;
+ case 3:
+ printf (_("Linux/uclibc\n"));
+ break;
+ case 4:
+ printf (_("Linux/glibc\n"));
+ break;
+ default:
+ printf (_("Unknown\n"));
+ break;
+ }
+ break;
+
+ case Tag_ARC_CPU_base:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_CPU_base: ");
+ switch (val)
+ {
+ default:
+ case TAG_CPU_NONE:
+ printf (_("Absent\n"));
+ break;
+ case TAG_CPU_ARC6xx:
+ printf ("ARC6xx\n");
+ break;
+ case TAG_CPU_ARC7xx:
+ printf ("ARC7xx\n");
+ break;
+ case TAG_CPU_ARCEM:
+ printf ("ARCEM\n");
+ break;
+ case TAG_CPU_ARCHS:
+ printf ("ARCHS\n");
+ break;
+ }
+ break;
+
+ case Tag_ARC_CPU_variation:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_CPU_variation: ");
+ switch (val)
+ {
+ default:
+ if (val > 0 && val < 16)
+ {
+ printf ("Core%d\n", val);
+ break;
+ }
+ case 0:
+ printf (_("Absent\n"));
+ break;
+ }
+ break;
+
+ case Tag_ARC_CPU_name:
+ printf (" Tag_ARC_CPU_name: ");
+ p = display_tag_value (-1, p, end);
+ break;
+
+ case Tag_ARC_ABI_rf16:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_ABI_rf16: %s\n", val ? _("yes") : _("no"));
+ break;
+
+ case Tag_ARC_ABI_osver:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_ABI_osver: v%d\n", val);
+ break;
+
+ case Tag_ARC_ABI_pic:
+ case Tag_ARC_ABI_sda:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (tag == Tag_ARC_ABI_sda ? " Tag_ARC_ABI_sda: "
+ : " Tag_ARC_ABI_pic: ");
+ switch (val)
+ {
+ case 0:
+ printf (_("Absent\n"));
+ break;
+ case 1:
+ printf ("MWDT\n");
+ break;
+ case 2:
+ printf ("GNU\n");
+ break;
+ default:
+ printf (_("Unknown\n"));
+ break;
+ }
+ break;
+
+ case Tag_ARC_ABI_tls:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_ABI_tls: %s\n", val ? "r25": "none");
+ break;
+
+ case Tag_ARC_ABI_enumsize:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_ABI_enumsize: %s\n", val ? _("default") :
+ _("smallest"));
+ break;
+
+ case Tag_ARC_ABI_exceptions:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_ABI_exceptions: %s\n", val ? _("OPTFP")
+ : _("default"));
+ break;
+
+ case Tag_ARC_ABI_double_size:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_ABI_double_size: %d\n", val);
+ break;
+
+ case Tag_ARC_ISA_config:
+ printf (" Tag_ARC_ISA_config: ");
+ p = display_tag_value (-1, p, end);
+ break;
+
+ case Tag_ARC_ISA_apex:
+ printf (" Tag_ARC_ISA_apex: ");
+ p = display_tag_value (-1, p, end);
+ break;
+
+ case Tag_ARC_ISA_mpy_option:
+ val = read_uleb128 (p, &len, end);
+ p += len;
+ printf (" Tag_ARC_ISA_mpy_option: %d\n", val);
+ break;
+
+ default:
+ return display_tag_value (tag & 1, p, end);
+ }
+
+ return p;
+}
+
/* ARM EABI attributes section. */
typedef struct
{
@@ -17573,6 +17767,12 @@ process_arch_specific (FILE * file)
switch (elf_header.e_machine)
{
+ case EM_ARC:
+ case EM_ARC_COMPACT:
+ case EM_ARC_COMPACT2:
+ return process_attributes (file, "ARC", SHT_ARC_ATTRIBUTES,
+ display_arc_attribute,
+ display_generic_attribute);
case EM_ARM:
return process_attributes (file, "aeabi", SHT_ARM_ATTRIBUTES,
display_arm_attribute,
diff --git a/binutils/testsuite/binutils-all/strip-3.d b/binutils/testsuite/binutils-all/strip-3.d
index ee2708e..0b4cded 100644
--- a/binutils/testsuite/binutils-all/strip-3.d
+++ b/binutils/testsuite/binutils-all/strip-3.d
@@ -1,6 +1,6 @@
#PROG: strip
#source: empty.s
-#strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .gnu.attributes -R .MIPS.abiflags -R .pdr -R .xtensa.info
+#strip: -R .text -R .data -R .bss -R .ARM.attributes -R .reginfo -R .gnu.attributes -R .MIPS.abiflags -R .pdr -R .xtensa.info -R .ARC.attributes
#readelf: -S --wide
#name: strip empty file
#target: *-*-linux* *-*-gnu*