aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2016-03-31 12:40:13 +0200
committerClaudiu Zissulescu <claziss@synopsys.com>2016-04-12 09:57:03 +0200
commit37ab977937f89c6601e616085ff9702d6e727ec8 (patch)
tree0101fe3c002d30fa37f70f43f6680dd203dc8c29 /gas/config
parent2df3368d851b653880c2e3312c99eb8adf89f3db (diff)
downloadgdb-37ab977937f89c6601e616085ff9702d6e727ec8.zip
gdb-37ab977937f89c6601e616085ff9702d6e727ec8.tar.gz
gdb-37ab977937f89c6601e616085ff9702d6e727ec8.tar.bz2
Remove unneeded AUX register symbols.
gas/ 2016-03-31 Claudiu Zissulescu <claziss@synopsys.com> * config/tc-arc.c (preprocess_operands): Mark AUX symbol. (arc_adjust_symtab): New function. * config/tc-arc.h (ARC_FLAG_AUX): Define. (obj_adjust_symtab): Likewise. * testsuite/gas/arc/taux.d: New file. * testsuite/gas/arc/taux.s: Likewise. Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-arc.c20
-rw-r--r--gas/config/tc-arc.h6
2 files changed, 26 insertions, 0 deletions
diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 1b70e03..98cac6a 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -1611,6 +1611,7 @@ find_opcode_match (const struct arc_opcode_hash_entry *entry,
from BKTOK. */
tok[tokidx].X_op = O_constant;
tok[tokidx].X_add_number = auxr->address;
+ ARC_SET_FLAG (tok[i].X_add_symbol, ARC_FLAG_AUX);
break;
}
@@ -3857,3 +3858,22 @@ tc_arc_regname_to_dw2regnum (char *regname)
return -1;
}
+
+/* Adjust the symbol table. Delete found AUX register symbols. */
+
+void
+arc_adjust_symtab (void)
+{
+ symbolS * sym;
+
+ for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym))
+ {
+ /* I've created a symbol during parsing process. Now, remove
+ the symbol as it is found to be an AUX register. */
+ if (ARC_GET_FLAG (sym) & ARC_FLAG_AUX)
+ symbol_remove (sym, &symbol_rootP, &symbol_lastP);
+ }
+
+ /* Now do generic ELF adjustments. */
+ elf_adjust_symtab ();
+}
diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h
index 076afea..54fa601 100644
--- a/gas/config/tc-arc.h
+++ b/gas/config/tc-arc.h
@@ -163,6 +163,8 @@ extern long md_pcrel_from_section (struct fix *, segT);
/* The symbol is a ZOL's end loop label. */
#define ARC_FLAG_ZOL (1 << 0)
+/* The symbol is an AUX register. */
+#define ARC_FLAG_AUX (1 << 1)
/* We use this hook to check the validity of the last to instructions
of a ZOL. */
@@ -185,6 +187,10 @@ extern long md_pcrel_from_section (struct fix *, segT);
/* Adjust non PC-rel values at relaxation time. */
#define TC_PCREL_ADJUST(F) arc_pcrel_adjust (F)
+/* Adjust symbol table. */
+#define obj_adjust_symtab() arc_adjust_symtab ()
+
+extern void arc_adjust_symtab (void);
extern int arc_pcrel_adjust (fragS *);
extern bfd_boolean arc_parse_name (const char *, struct expressionS *);
extern int tc_arc_fix_adjustable (struct fix *);