aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-08-18 17:34:03 +0100
committerNick Clifton <nickc@redhat.com>2014-08-18 17:34:03 +0100
commit3ce3a066e18b52c1b7c8da841e0416ecf687e1e5 (patch)
tree703a32e6b1078f3b56858f1e18bd66a616f38325 /gas
parent3c8c5dcc9873798483c8abd6e614edb8ae1608a4 (diff)
downloadgdb-3ce3a066e18b52c1b7c8da841e0416ecf687e1e5.zip
gdb-3ce3a066e18b52c1b7c8da841e0416ecf687e1e5.tar.gz
gdb-3ce3a066e18b52c1b7c8da841e0416ecf687e1e5.tar.bz2
This fixes the processing of BFD_RELOC_RL78_DIFF fixups when the size is less
than 4. This affects DWARF debug info generation in particular. * config/tc-rl78.c (md_apply_fix): Correct handling of small sized RELOC_RL78_DIFF fixups.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-rl78.c11
2 files changed, 15 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 909b4f4..b51d7d6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-18 Nick Clifton <nickc@redhat.com>
+
+ * config/tc-rl78.c (md_apply_fix): Correct handling of small sized
+ RELOC_RL78_DIFF fixups.
+
2014-08-18 Alan Modra <amodra@gmail.com>
* read.c (parse_mri_cons): Warning fix.
diff --git a/gas/config/tc-rl78.c b/gas/config/tc-rl78.c
index f2382b7..1627c61 100644
--- a/gas/config/tc-rl78.c
+++ b/gas/config/tc-rl78.c
@@ -1361,13 +1361,22 @@ md_apply_fix (struct fix * f ATTRIBUTE_UNUSED,
break;
case BFD_RELOC_32:
- case BFD_RELOC_RL78_DIFF:
op[0] = val;
op[1] = val >> 8;
op[2] = val >> 16;
op[3] = val >> 24;
break;
+ case BFD_RELOC_RL78_DIFF:
+ op[0] = val;
+ if (f->fx_size > 1)
+ op[1] = val >> 8;
+ if (f->fx_size > 2)
+ op[2] = val >> 16;
+ if (f->fx_size > 3)
+ op[3] = val >> 24;
+ break;
+
case BFD_RELOC_RL78_HI8:
val = val >> 16;
op[0] = val;