/* 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.
int value;
};
-struct dwarf2_line_info debug_line;
-
/* Generic assembler global variables which must be defined by all
targets. */
}
}
- 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
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);
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
_("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,
current_machine = mach;
}
-
-void
-mn10300_finalize ()
-{
- if (debug_type == DEBUG_DWARF2)
- dwarf2_finish ();
-}