summaryrefslogtreecommitdiff
path: root/gas/write.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2012-07-02 07:35:05 +0000
committerNick Clifton <nickc@redhat.com>2012-07-02 07:35:05 +0000
commitb045de1d608eef807a50b8a6de1674f1476f2baa (patch)
tree9ab7946fac4996aa23fd8e3ec7557ec5243ec455 /gas/write.c
parent246a220dd6b64b33c3933b2d8240499877e11c62 (diff)
downloadbinutils-redhat-b045de1d608eef807a50b8a6de1674f1476f2baa.tar.gz
* write.c (fixup_segment): Only perform the subtraction of an
fx_subsy symbol if MD_APPLY_SYM_VALUE allows it and the symbol is properly defined. * config/tc-msp430.h (MD_APPLY_SYM_VALUE): Define.
Diffstat (limited to 'gas/write.c')
-rw-r--r--gas/write.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gas/write.c b/gas/write.c
index 7fb2e8bb3b..a4671475af 100644
--- a/gas/write.c
+++ b/gas/write.c
@@ -1004,12 +1004,7 @@ fixup_segment (fixS *fixP, segT this_segment)
fixP->fx_subsy = NULL;
fixP->fx_pcrel = 1;
}
- else if (TC_VALIDATE_FIX_SUB (fixP, add_symbol_segment))
- /* If the fix is valid, subtract fx_subsy here. The addition of
- fx_addsy will be performed below. Doing this prevents bogus
- warnings from the range check below. */
- add_number -= S_GET_VALUE (fixP->fx_subsy);
- else
+ else if (!TC_VALIDATE_FIX_SUB (fixP, add_symbol_segment))
{
if (!md_register_arithmetic
&& (add_symbol_segment == reg_section
@@ -1024,6 +1019,10 @@ fixup_segment (fixS *fixP, segT this_segment)
S_GET_NAME (fixP->fx_subsy),
segment_name (sub_symbol_segment));
}
+ else if (sub_symbol_segment != undefined_section
+ && ! bfd_is_com_section (sub_symbol_segment)
+ && MD_APPLY_SYM_VALUE (fixP))
+ add_number -= S_GET_VALUE (fixP->fx_subsy);
}
if (fixP->fx_addsy)