aboutsummaryrefslogtreecommitdiff
path: root/gas/symbols.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2009-12-08 03:14:29 +0000
committerH.J. Lu <hjl.tools@gmail.com>2009-12-08 03:14:29 +0000
commit087d837e042af03a607f1974d32929a129eef806 (patch)
tree485a4e264529fd2cd797e99ccf66acb04158ac97 /gas/symbols.c
parent34207b9e417f37181ff48204e4cbf06403f39329 (diff)
downloadgdb-087d837e042af03a607f1974d32929a129eef806.zip
gdb-087d837e042af03a607f1974d32929a129eef806.tar.gz
gdb-087d837e042af03a607f1974d32929a129eef806.tar.bz2
Call symbol_same_p to check to if 2 symbols are the same.
gas/ 2009-12-07 H.J. Lu <hongjiu.lu@intel.com> PR gas/11037 * expr.c (resolve_expression): Call symbol_same_p to check if 2 symbols are the same. * symbols.c (symbol_same_p): New. * symbols.h (symbol_same_p): Likewise. gas/testsuite/ 2009-12-07 H.J. Lu <hongjiu.lu@intel.com> PR gas/11037 * gas/i386/intelpic.s: Add testcases. * gas/i386/intelpic.d: Updated.
Diffstat (limited to 'gas/symbols.c')
-rw-r--r--gas/symbols.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 4cfa85b..5eda2cb 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -2385,6 +2385,20 @@ symbol_set_value_expression (symbolS *s, const expressionS *exp)
S_CLEAR_WEAKREFR (s);
}
+/* Return whether 2 symbols are the same. */
+
+int
+symbol_same_p (symbolS *s1, symbolS *s2)
+{
+ if (s1->bsym == NULL
+ && local_symbol_converted_p ((struct local_symbol *) s1))
+ s1 = local_symbol_get_real_symbol ((struct local_symbol *) s1);
+ if (s2->bsym == NULL
+ && local_symbol_converted_p ((struct local_symbol *) s2))
+ s2 = local_symbol_get_real_symbol ((struct local_symbol *) s2);
+ return s1 == s2;
+}
+
/* Return a pointer to the X_add_number component of a symbol. */
offsetT *