diff --git a/gas/ChangeLog b/gas/ChangeLog index 13843f054e8..1dd992b8212 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2004-06-15 Alan Modra + + * config/obj-coff.c (coff_adjust_section_syms): Use + bfd_get_section_size instead of bfd_get_section_size_before_reloc. + (coff_frob_section): Likewise. + * config/tc-mips.c (md_apply_fix3): Likewise. + * config/obj-elf.c (elf_frob_file): Use bfd_set_section_size. + (elf_frob_file_after_relocs): Likewise. + 2004-06-10 John David Anglin * config/tc-hppa.c (log2): Rename to exact_log2. diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index bd08c2b5f8b..8ead485253e 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -1,6 +1,6 @@ /* coff object file format Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GAS. @@ -1379,7 +1379,7 @@ coff_adjust_section_syms (abfd, sec, x) fixp = fixp->fx_next; } } - if (bfd_get_section_size_before_reloc (sec) == 0 + if (bfd_get_section_size (sec) == 0 && nrelocs == 0 && nlnno == 0 && sec != text_section @@ -1554,7 +1554,7 @@ coff_frob_section (sec) supposedly because standard COFF has no other way of encoding alignment for sections. If your COFF flavor has a different way of encoding section alignment, then skip this step, as TICOFF does. */ - size = bfd_get_section_size_before_reloc (sec); + size = bfd_get_section_size (sec); mask = ((bfd_vma) 1 << align_power) - 1; #if !defined(TICOFF) if (size & mask) @@ -1607,9 +1607,9 @@ coff_frob_section (sec) strsec = sec; sec = subseg_get (STAB_SECTION_NAME, 0); /* size is already rounded up, since other section will be listed first */ - size = bfd_get_section_size_before_reloc (strsec); + size = bfd_get_section_size (strsec); - n_entries = bfd_get_section_size_before_reloc (sec) / 12 - 1; + n_entries = bfd_get_section_size (sec) / 12 - 1; /* Find first non-empty frag. It should be large enough. */ fragp = seg_info (sec)->frchainP->frch_root; diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index f970110f957..94f53b1c944 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1,6 +1,6 @@ /* ELF object file format Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -1887,6 +1887,7 @@ elf_frob_file (void) flagword flags; struct symbol *sy; int has_sym; + bfd_size_type size; flags = SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_GROUP; for (s = list.head[i]; s != NULL; s = elf_next_in_group (s)) @@ -1927,8 +1928,9 @@ elf_frob_file (void) if (has_sym) elf_group_id (s) = sy->bsym; - s->_raw_size = 4 * (list.elt_count[i] + 1); - s->contents = frag_more (s->_raw_size); + size = 4 * (list.elt_count[i] + 1); + bfd_set_section_size (stdoutput, s, size); + s->contents = frag_more (size); frag_now->fr_fix = frag_now_fix_octets (); } @@ -2037,7 +2039,8 @@ elf_frob_file_after_relocs (void) to force the ELF backend to allocate a file position, and then write out the data. FIXME: Is this really the best way to do this? */ - sec->_raw_size = bfd_ecoff_debug_size (stdoutput, &debug, debug_swap); + bfd_set_section_size + (stdoutput, sec, bfd_ecoff_debug_size (stdoutput, &debug, debug_swap)); /* Pass BUF to bfd_set_section_contents because this will eventually become a call to fwrite, and ISO C prohibits diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index c3a9e3caf6f..b7a6081230f 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -11013,7 +11013,7 @@ md_apply_fix3 (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED) && fixP->fx_done && fixP->fx_frag->fr_address >= text_section->vma && (fixP->fx_frag->fr_address - < text_section->vma + text_section->_raw_size) + < text_section->vma + bfd_get_section_size (text_section)) && ((insn & 0xffff0000) == 0x10000000 /* beq $0,$0 */ || (insn & 0xffff0000) == 0x04010000 /* bgez $0 */ || (insn & 0xffff0000) == 0x04110000)) /* bgezal $0 */