/* write.c - emit .o file
Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
- 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
n_fixups++;
- fixP = obstack_alloc (¬es, sizeof (fixS));
+ fixP = (fixS *) obstack_alloc (¬es, sizeof (fixS));
fixP->fx_frag = frag;
fixP->fx_where = where;
{
prev_frag->fr_next = frchp->frch_root;
prev_frag = frchp->frch_last;
- assert (prev_frag->fr_type != 0);
+ gas_assert (prev_frag->fr_type != 0);
if (frchp->fix_root != (fixS *) NULL)
{
if (seg_info (section)->fix_root == (fixS *) NULL)
prev_fix = frchp->fix_tail;
}
}
- assert (prev_frag->fr_type != 0);
- assert (prev_frag != &dummy);
+ gas_assert (prev_frag->fr_type != 0);
+ gas_assert (prev_frag != &dummy);
prev_frag->fr_next = 0;
return prev_frag;
}
case rs_machine_dependent:
md_convert_frag (stdoutput, sec, fragP);
- assert (fragP->fr_next == NULL
+ gas_assert (fragP->fr_next == NULL
|| ((offsetT) (fragP->fr_next->fr_address - fragP->fr_address)
== fragP->fr_fix));
size = 0;
flags = bfd_get_section_flags (abfd, sec);
+ if (size == 0 && bfd_get_section_size (sec) != 0 &&
+ (flags & SEC_HAS_CONTENTS) != 0)
+ return;
if (size > 0 && ! seginfo->bss)
flags |= SEC_HAS_CONTENTS;
flags &= ~SEC_RELOC;
x = bfd_set_section_flags (abfd, sec, flags);
- assert (x);
+ gas_assert (x);
newsize = md_section_align (sec, size);
x = bfd_set_section_size (abfd, sec, newsize);
- assert (x);
+ gas_assert (x);
/* If the size had to be rounded up, add some padding in the last
non-empty frag. */
- assert (newsize >= size);
+ gas_assert (newsize >= size);
if (size != newsize)
{
fragS *last = seginfo->frchainP->frch_last;
rp = &r->next;
}
- relocs = xcalloc (n, sizeof (arelent *));
+ relocs = (arelent **) xcalloc (n, sizeof (arelent *));
i = 0;
for (fixp = seginfo->fix_root; fixp != (fixS *) NULL; fixp = fixp->fx_next)
char *fill_literal;
offsetT count;
- assert (f->fr_type == rs_fill);
+ gas_assert (f->fr_type == rs_fill);
if (f->fr_fix)
{
x = bfd_set_section_contents (stdoutput, sec,
fill_literal = f->fr_literal + f->fr_fix;
fill_size = f->fr_var;
count = f->fr_offset;
- assert (count >= 0);
+ gas_assert (count >= 0);
if (fill_size && count)
{
char buf[256];
int i;
bfd_size_type amt = (bfd_size_type) nsyms * sizeof (asymbol *);
- asympp = bfd_alloc (stdoutput, amt);
+ asympp = (asymbol **) bfd_alloc (stdoutput, amt);
symp = symbol_rootP;
for (i = 0; i < nsyms; i++, symp = symbol_next (symp))
{
else
asympp = 0;
result = bfd_set_symtab (stdoutput, asympp, nsyms);
- assert (result);
+ gas_assert (result);
symbol_table_frozen = 1;
}
if (symbol_equated_reloc_p (symp)
|| S_IS_WEAKREFR (symp))
{
- const char *name = S_GET_NAME (symp);
+ const char *sname = S_GET_NAME (symp);
+
if (S_IS_COMMON (symp)
- && !TC_FAKE_LABEL (name)
+ && !TC_FAKE_LABEL (sname)
&& !S_IS_WEAKREFR (symp)
&& (!S_IS_EXTERNAL (symp) || S_IS_LOCAL (symp)))
{
expressionS *e = symbol_get_value_expression (symp);
+
as_bad (_("Local symbol `%s' can't be equated to common symbol `%s'"),
- name, S_GET_NAME (e->X_add_symbol));
+ sname, S_GET_NAME (e->X_add_symbol));
}
if (S_GET_SEGMENT (symp) == reg_section)
{
/* Report error only if we know the symbol name. */
if (S_GET_NAME (symp) != reg_section->name)
as_bad (_("can't make global register symbol `%s'"),
- name);
+ sname);
}
symbol_remove (symp, &symbol_rootP, &symbol_lastP);
continue;
#ifdef obj_frob_file
obj_frob_file ();
#endif
-
+#ifdef obj_coff_generate_pdata
+ obj_coff_generate_pdata ();
+#endif
bfd_map_over_sections (stdoutput, write_relocs, (char *) 0);
#ifdef tc_frob_file_after_relocs