* config/tc-mn10300.c (md_assemble): Correctly determine the
authorJeff Law <law@redhat.com>
Mon, 25 Nov 1996 15:54:43 +0000 (15:54 +0000)
committerJeff Law <law@redhat.com>
Mon, 25 Nov 1996 15:54:43 +0000 (15:54 +0000)
        correct location and type for each relocation.
        (md_pcrel_from): Simplify.
Last week's reloc work.

gas/ChangeLog
gas/config/tc-mn10300.c

index 7fd44a0..b7d515b 100644 (file)
@@ -1,3 +1,9 @@
+Mon Nov 25 08:49:36 1996  Jeffrey A Law  (law@cygnus.com)
+
+       * config/tc-mn10300.c (md_assemble): Correctly determine the
+       correct location and type for each relocation.
+       (md_pcrel_from): Simplify.
+
 Fri Nov 22 15:42:26 1996  Ian Lance Taylor  <ian@cygnus.com>
 
        * config/tc-sh.c (md_convert_frag): Improve warning when branch is
index 5e0e901..bc6a746 100644 (file)
@@ -846,15 +846,16 @@ keep_going:
                  || ((insn >> 16) & 0xffff) == 0xfe02))
            size -= 1;
        
-         /* Determine offset from start of this insn to insert the
-            reloc.  Except for a few exceptions we insert the reloc
-            at the tail of the instruction.  */
          offset = size - reloc_size / 8;
 
          /* Choose a proper BFD relocation type.  */
          if (pcrel)
            {
-             if (reloc_size == 32)
+             if (size == 6)
+               reloc = BFD_RELOC_MN10300_32_PCREL;
+             else if (size == 4)
+               reloc = BFD_RELOC_MN10300_16_PCREL;
+             else if (reloc_size == 32)
                reloc = BFD_RELOC_32_PCREL;
              else if (reloc_size == 16)
                reloc = BFD_RELOC_16_PCREL;
@@ -866,9 +867,9 @@ keep_going:
          else
            {
              if (reloc_size == 32)
-               reloc = BFD_RELOC_32;
+               reloc = BFD_RELOC_MN10300_32B;
              else if (reloc_size == 16)
-               reloc = BFD_RELOC_16;
+               reloc = BFD_RELOC_MN10300_16B;
              else if (reloc_size == 8)
                reloc = BFD_RELOC_8;
              else
@@ -928,12 +929,15 @@ long
 md_pcrel_from (fixp)
      fixS *fixp;
 {
+  return fixp->fx_frag->fr_address;
+#if 0
   if (fixp->fx_addsy != (symbolS *) NULL && ! S_IS_DEFINED (fixp->fx_addsy))
     {
       /* The symbol is undefined.  Let the linker figure it out.  */
       return 0;
     }
   return fixp->fx_frag->fr_address + fixp->fx_where;
+#endif
 }
 
 int