This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Commit: RL78: Fix handling of RELOC_RL78_DIFF fixups


Hi Guys,

  I am applying the patch below to fix the processing of
  BFD_RELOC_RL78_DIFF fixups when the size is less than 4.  This affects
  DWARF debug info generation in particular.

Cheers
  Nick

gas/ChangeLog
2014-08-18  Nick Clifton  <nickc@redhat.com>

	* config/tc-rl78.c (md_apply_fix): Correct handling of small sized
	RELOC_RL78_DIFF fixups.
  
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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]