aboutsummaryrefslogtreecommitdiff
path: root/gas/symbols.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-05-17 11:56:13 +0000
committerNick Clifton <nickc@redhat.com>2005-05-17 11:56:13 +0000
commit2d034539b1365c8d25be0be70c16c84c9288a088 (patch)
tree10737f73c49a538017c9dc13e3eca58af13d5514 /gas/symbols.c
parent641bd09305df4cd893788b2b10b3aa5bced813ac (diff)
downloadgdb-2d034539b1365c8d25be0be70c16c84c9288a088.zip
gdb-2d034539b1365c8d25be0be70c16c84c9288a088.tar.gz
gdb-2d034539b1365c8d25be0be70c16c84c9288a088.tar.bz2
* config/tc-v850,h (TC_FIX_TYPE): Define. (TC_INIT_FIX_TYPE): Define.
* config/tc-v850.c (md_assemble): When creating a fix record the operand in the tc_fix_data field. (md_apply_fix3): When applying a resolved fix use the operand's insertion procedure to store the value, if the operand has been recorded. * gas/v850/split-lo16.s: Add test for a lo() pseudo reloc corrupting an ld.w instruction. * gas/v850/split-lo16.d: Add expected, correct (ie not corrupt) output.
Diffstat (limited to 'gas/symbols.c')
-rw-r--r--gas/symbols.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 5341c6a..ebcad5b 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -906,6 +906,7 @@ resolve_symbol_value (symbolS *symp)
offsetT left, right;
segT seg_left, seg_right;
operatorT op;
+ int move_seg_ok;
symp->sy_resolving = 1;
@@ -1091,18 +1092,15 @@ resolve_symbol_value (symbolS *symp)
}
}
+ move_seg_ok = 1;
/* Equality and non-equality tests are permitted on anything.
Subtraction, and other comparison operators are permitted if
both operands are in the same section. Otherwise, both
operands must be absolute. We already handled the case of
addition or subtraction of a constant above. This will
probably need to be changed for an object file format which
- supports arbitrary expressions, such as IEEE-695.
-
- Don't emit messages unless we're finalizing the symbol value,
- otherwise we may get the same message multiple times. */
- if (finalize_syms
- && !(seg_left == absolute_section
+ supports arbitrary expressions, such as IEEE-695. */
+ if (!(seg_left == absolute_section
&& seg_right == absolute_section)
&& !(op == O_eq || op == O_ne)
&& !((op == O_subtract
@@ -1110,9 +1108,21 @@ resolve_symbol_value (symbolS *symp)
&& seg_left == seg_right
&& (seg_left != undefined_section
|| add_symbol == op_symbol)))
- report_op_error (symp, add_symbol, op_symbol);
+ {
+ /* Don't emit messages unless we're finalizing the symbol value,
+ otherwise we may get the same message multiple times. */
+ if (finalize_syms)
+ report_op_error (symp, add_symbol, op_symbol);
+ /* However do not move the symbol into the absolute section
+ if it cannot currently be resolved - this would confuse
+ other parts of the assembler into believing that the
+ expression had been evaluated to zero. */
+ else
+ move_seg_ok = 0;
+ }
- if (final_seg == expr_section || final_seg == undefined_section)
+ if (move_seg_ok
+ && (final_seg == expr_section || final_seg == undefined_section))
final_seg = absolute_section;
/* Check for division by zero. */