Fix copyright notices
[deliverable/binutils-gdb.git] / gas / config / tc-mn10300.c
index 301a42bac493ed28d4bccdcf45811aea2f41c0cf..8504e84c14bea5ba6cf414a3c6119f05c4a75dfa 100644 (file)
@@ -1,5 +1,6 @@
 /* tc-mn10300.c -- Assembler code for the Matsushita 10300
-   Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation.
+   Copyright 1996, 1997, 1998, 1999, 2000, 2001
+   Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -32,8 +33,6 @@ struct reg_name
   int value;
 };
 
-struct dwarf2_line_info debug_line;
-
 /* Generic assembler global variables which must be defined by all
    targets.  */
 
@@ -1791,20 +1790,7 @@ keep_going:
        }
     }
 
-  if (debug_type == DEBUG_DWARF2)
-    {
-      bfd_vma addr;
-
-      /* First update the notion of the current source line.  */
-      dwarf2_where (&debug_line);
-
-      /* We want the offset of the start of this instruction within the
-         the current frag.  */
-      addr = frag_now->fr_address + frag_now_fix () - real_size;
-
-      /* And record the information.  */
-      dwarf2_gen_line_info (addr, &debug_line);
-    }
+  dwarf2_emit_insn (real_size);
 }
 
 /* If while processing a fixup, a reloc really needs to be created
@@ -1912,11 +1898,12 @@ md_pcrel_from (fixp)
 int
 md_apply_fix3 (fixp, valuep, seg)
      fixS *fixp;
-     valueT *valuep ATTRIBUTE_UNUSED;
+     valueT *valuep;
      segT seg;
 {
   char *fixpos = fixp->fx_where + fixp->fx_frag->fr_literal;
   int size = 0;
+  int value;
 
   assert (fixp->fx_r_type < BFD_RELOC_UNUSED);
 
@@ -1924,6 +1911,22 @@ md_apply_fix3 (fixp, valuep, seg)
   if (seg->flags & SEC_ALLOC)
       abort ();
 
+  /* The value we are passed in *valuep includes the symbol values.
+     Since we are using BFD_ASSEMBLER, if we are doing this relocation
+     the code in write.c is going to call bfd_install_relocation, which
+     is also going to use the symbol value.  That means that if the
+     reloc is fully resolved we want to use *valuep since
+     bfd_install_relocation is not being used.
+
+     However, if the reloc is not fully resolved we do not want to use
+     *valuep, and must use fx_offset instead.  However, if the reloc
+     is PC relative, we do want to use *valuep since it includes the
+     result of md_pcrel_from.  */
+  if (fixp->fx_addsy == (symbolS *) NULL || fixp->fx_pcrel)
+    value = *valuep;
+  else
+    value = fixp->fx_offset;
+
   /* If the fix is relative to a symbol which is not defined, or not
      in the same segment as the fix, we cannot resolve it here.  */
   if (fixp->fx_addsy != NULL
@@ -1959,11 +1962,13 @@ md_apply_fix3 (fixp, valuep, seg)
                    _("Bad relocation fixup type (%d)"), fixp->fx_r_type);
     }
 
-  md_number_to_chars (fixpos, fixp->fx_offset, size);
+  md_number_to_chars (fixpos, value, size);
 
-  fixp->fx_done = 1;
-  return 0;
+  /* If a symbol remains, pass the fixup, as a reloc, onto the linker.  */
+  if (fixp->fx_addsy == NULL)
+    fixp->fx_done = 1;
 
+  return 0;
 }
 
 /* Return nonzero if the fixup in FIXP will require a relocation,
@@ -2132,10 +2137,3 @@ set_arch_mach (mach)
 
   current_machine = mach;
 }
-
-void
-mn10300_finalize ()
-{
-  if (debug_type == DEBUG_DWARF2)
-    dwarf2_finish ();
-}
This page took 0.025442 seconds and 4 git commands to generate.