diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 10 | ||||
-rw-r--r-- | gas/frags.c | 36 |
2 files changed, 31 insertions, 15 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index a85ec0c..62e0987 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2003-07-15 Alan Modra <amodra@bigpond.net.au> + + * frags.c (frag_more): Move segment checks to.. + (frag_alloc_check): ..here. New function. + (frag_append_1_char): Call frag_alloc_check. + 2003-07-14 Nick Clifton <nickc@redhat.com> * po/tr.po: Update with latest version. @@ -216,7 +222,7 @@ (relax_and_size_all_segments): Likewise. (relax_frag): Likewise. (relax_segment): Likewise. - + 2003-06-23 Mark Mitchell <mark@codesourcery.com> * config/tc-ppc.c (ppc_cleanup): Use bytes to count APUinfo slots. @@ -258,7 +264,7 @@ (get_operand): For CLASS_IR remember register size in mode struct. (get_specific): Handle new CLASS_IRO type. Add register size checks for CLASS_IR and CLASS_IRO. - (md_apply_fix3): Fix undefined usage of buf. + (md_apply_fix3): Fix undefined usage of buf. 2003-06-19 Alan Modra <amodra@bigpond.net.au> diff --git a/gas/frags.c b/gas/frags.c index 8d7ed2f..47f828a 100644 --- a/gas/frags.c +++ b/gas/frags.c @@ -1,6 +1,6 @@ /* frags.c - manage frags - Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000 + 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -36,6 +36,26 @@ frag_init () bss_address_frag.fr_type = rs_fill; } +/* Check that we're not trying to assemble into a section that can't + allocate frags (currently, this is only possible in the absolute + section), or into an mri common. */ + +static void +frag_alloc_check (const struct obstack *ob) +{ + if (ob->chunk_size == 0) + { + as_bad (_("attempt to allocate data in absolute section")); + subseg_set (text_section, 0); + } + + if (mri_common_symbol != NULL) + { + as_bad (_("attempt to allocate data in common section")); + mri_common_symbol = NULL; + } +} + /* Allocate a frag on the specified obstack. Call this routine from everywhere else, so that all the weird alignment hackery can be done in just one place. */ @@ -163,18 +183,7 @@ frag_more (nchars) { register char *retval; - if (now_seg == absolute_section) - { - as_bad (_("attempt to allocate data in absolute section")); - subseg_set (text_section, 0); - } - - if (mri_common_symbol != NULL) - { - as_bad (_("attempt to allocate data in common section")); - mri_common_symbol = NULL; - } - + frag_alloc_check (&frchain_now->frch_obstack); frag_grow (nchars); retval = obstack_next_free (&frchain_now->frch_obstack); obstack_blank_fast (&frchain_now->frch_obstack, nchars); @@ -376,6 +385,7 @@ void frag_append_1_char (datum) int datum; { + frag_alloc_check (&frchain_now->frch_obstack); if (obstack_room (&frchain_now->frch_obstack) <= 1) { frag_wane (frag_now); |