aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-avr.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2015-01-04 00:03:16 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2015-01-10 00:04:35 +0000
commit491793b5cbcc9f42662a2da8427c0022d7b03f9c (patch)
tree634079837ab2ecd6c164308cc851986692d6557d /gas/config/tc-avr.c
parente321dd9a810dd92c5f739e0e4e35ceec2a3e951a (diff)
downloadgdb-491793b5cbcc9f42662a2da8427c0022d7b03f9c.zip
gdb-491793b5cbcc9f42662a2da8427c0022d7b03f9c.tar.gz
gdb-491793b5cbcc9f42662a2da8427c0022d7b03f9c.tar.bz2
gas/avr: Prevent incorrect overflow errors for diff fixups.
When fixups are converted to a difference type within md_apply_fix, we previously left the contents of VALP (the value that was initially computed within write.c:fixup_segment) unchanged. This is harmless, except that this value is used within write.c:fixup_segment once we return from md_apply_fix to perform an overflow check. In some cases, the value computed in write.c:fixup_segment is so wrong that an overflow error can be triggered. These errors are incorrect. This patch avoids the overflow errors by adjusting the value in write.c:fixup_segment using the VALP pointer in md_apply_fix. A test for this issue is included. gas/ChangeLog: * config/tc-avr.c (md_apply_fix): Update the contents of VALP for diff fixups. gas/testsuite/ChangeLog: * gas/avr/large-debug-line-table.d: New file. * gas/avr/large-debug-line-table.s: New file.
Diffstat (limited to 'gas/config/tc-avr.c')
-rw-r--r--gas/config/tc-avr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gas/config/tc-avr.c b/gas/config/tc-avr.c
index 19326a1..5a0b405 100644
--- a/gas/config/tc-avr.c
+++ b/gas/config/tc-avr.c
@@ -1344,6 +1344,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
value = S_GET_VALUE (fixP->fx_addsy) +
fixP->fx_offset - S_GET_VALUE (fixP->fx_subsy);
+ *valP = value;
fixP->fx_subsy = NULL;
}