diff options
author | claziss <claziss@synopsys.com> | 2018-08-06 16:41:32 +0300 |
---|---|---|
committer | Claudiu Zissulescu <claziss@gmail.com> | 2018-08-06 16:41:32 +0300 |
commit | 63741043bde141c20f0a08dada84ed7bdf333d99 (patch) | |
tree | 9a0e24befeefd79f24b411eb80e54af928934e83 /gas/config | |
parent | 6af0448446f9212df4dc62e7618174d5d3f5e43e (diff) | |
download | gdb-63741043bde141c20f0a08dada84ed7bdf333d99.zip gdb-63741043bde141c20f0a08dada84ed7bdf333d99.tar.gz gdb-63741043bde141c20f0a08dada84ed7bdf333d99.tar.bz2 |
[ARC] Check if an input asm file is rf16 compliant
Check if an input asm file is rf16 compliant; if not, and the tag says
otherwise, fix the tag and emit a warning.
gas/
2017-09-20 Claudiu Zissulescu <claziss@synopsys.com>
* config/tc-arc.c (rf16_only): New static variable.
(autodetect_attributes): Check if we are rf16 compliant.
(arc_set_public_attributes): Fix and emit the warning is required.
* testsuite/gas/arc/attr-rf16.d: New file.
* testsuite/gas/arc/attr-rf16.err: Likewise.
* testsuite/gas/arc/attr-rf16.s: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-arc.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c index 7bf3081..6f0407b 100644 --- a/gas/config/tc-arc.c +++ b/gas/config/tc-arc.c @@ -475,6 +475,9 @@ static const struct cpu_type /* Information about the cpu/variant we're assembling for. */ static struct cpu_type selected_cpu = { 0, 0, 0, E_ARC_OSABI_CURRENT, 0 }; +/* TRUE if current assembly code uses RF16 only registers. */ +static bfd_boolean rf16_only = TRUE; + /* MPY option. */ static unsigned mpy_option = 0; @@ -2383,6 +2386,17 @@ autodetect_attributes (const struct arc_opcode *opcode, default: break; } + + switch (tok[i].X_op) + { + case O_register: + if ((tok[i].X_add_number >= 4 && tok[i].X_add_number <= 9) + || (tok[i].X_add_number >= 16 && tok[i].X_add_number <= 25)) + rf16_only = FALSE; + break; + default: + break; + } } } @@ -5017,6 +5031,17 @@ arc_set_public_attributes (void) /* Tag_ARC_ATR_version. */ arc_set_attribute_int (Tag_ARC_ATR_version, 1); + + /* Tag_ARC_ABI_rf16. */ + if (attributes_set_explicitly[Tag_ARC_ABI_rf16] + && bfd_elf_get_obj_attr_int (stdoutput, OBJ_ATTR_PROC, + Tag_ARC_ABI_rf16) + && !rf16_only) + { + as_warn (_("Overwrite explicitly set Tag_ARC_ABI_rf16 to full " + "register file")); + bfd_elf_add_proc_attr_int (stdoutput, Tag_ARC_ABI_rf16, 0); + } } /* Add the default contents for the .ARC.attributes section. */ |