/* write.c - emit .o file
Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from (FIX)
#endif
-#ifndef WORKING_DOT_WORD
-extern const int md_short_jump_size;
-extern const int md_long_jump_size;
-#endif
-
/* Used to control final evaluation of expressions. */
int finalize_syms = 0;
BAD_CASE (fragP->fr_type);
break;
}
+#ifdef md_frag_check
+ md_frag_check (fragP);
+#endif
}
#endif /* defined (BFD_ASSEMBLER) || !defined (BFD) */
continue;
}
-#if 0
- /* This test is triggered inappropriately for the SH. */
- if (fixp->fx_where + fixp->fx_size
- > fixp->fx_frag->fr_fix + fixp->fx_frag->fr_offset)
- abort ();
-#endif
+ /*
+ This test is triggered inappropriately for the SH:
+ if (fixp->fx_where + fixp->fx_size
+ > fixp->fx_frag->fr_fix + fixp->fx_frag->fr_offset)
+ abort ();
+ */
s = bfd_install_relocation (stdoutput, reloc,
fixp->fx_frag->fr_literal,
if (symbol_rootP)
{
symbolS *symp;
+ bfd_boolean skip_next_symbol = FALSE;
for (symp = symbol_rootP; symp; symp = symbol_next (symp))
{
int punt = 0;
const char *name;
+ if (skip_next_symbol)
+ {
+ /* Don't do anything besides moving the value of the
+ symbol from the GAS value-field to the BFD value-field. */
+ symbol_get_bfdsym (symp)->value = S_GET_VALUE (symp);
+ skip_next_symbol = FALSE;
+ continue;
+ }
+
if (symbol_mri_common_p (symp))
{
if (S_IS_EXTERNAL (symp))
symbols. */
if (symbol_equated_reloc_p (symp))
{
+ if (S_IS_COMMON (symp))
+ as_bad (_("`%s' can't be equated to common symbol"),
+ S_GET_NAME (symp));
symbol_remove (symp, &symbol_rootP, &symbol_lastP);
continue;
}
if (S_IS_DEFINED (symp) == 0
&& S_GET_VALUE (symp) != 0)
S_SET_SEGMENT (symp, bfd_com_section_ptr);
-#if 0
- printf ("symbol `%s'\n\t@%x: value=%d flags=%x seg=%s\n",
- S_GET_NAME (symp), symp,
- S_GET_VALUE (symp),
- symbol_get_bfdsym (symp)->flags,
- segment_name (S_GET_SEGMENT (symp)));
-#endif
#ifdef obj_frob_symbol
obj_frob_symbol (symp, punt);
/* Set the value into the BFD symbol. Up til now the value
has only been kept in the gas symbolS struct. */
symbol_get_bfdsym (symp)->value = S_GET_VALUE (symp);
+
+ /* A warning construct is a warning symbol followed by the
+ symbol warned about. Don't let anything object-format or
+ target-specific muck with it; it's ready for output. */
+ if (symbol_get_bfdsym (symp)->flags & BSF_WARNING)
+ skip_next_symbol = TRUE;
}
}
#ifdef TC_PCREL_ADJUST
/* Currently only the ns32k family needs this. */
aim += TC_PCREL_ADJUST (fragP);
-/* #else */
- /* This machine doesn't want to use pcrel_adjust.
- In that case, pcrel_adjust should be zero. */
-#if 0
- assert (fragP->fr_targ.ns32k.pcrel_adjust == 0);
#endif
-#endif
-#ifdef md_prepare_relax_scan /* formerly called M68K_AIM_KLUDGE */
+
+#ifdef md_prepare_relax_scan
+ /* Formerly called M68K_AIM_KLUDGE. */
md_prepare_relax_scan (fragP, address, aim, this_state, this_type);
#endif
fragP->fr_type = rs_align;
fragP->fr_subtype = 0;
fragP->fr_offset = 0;
- fragP->fr_fix = after - address;
+ fragP->fr_fix = after - was_address;
growth = stretch;
}