This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

section _raw_size and _cooked_size


This is the first step in fixing some of the insanity in the linker's
use of _raw_size and _cooked_size.  Here, we get rid of a couple of
macros that should only be of interest in linker code, and hide all
references outside of bfd/ and ld/ to _raw_size and _cooked_size in
macros (except for one line in objcopy.c).

I was hoping to combine the two section size vars, but that involves
quite some hacking to linker code.  The problem being that the stabs
code needs both sizes available between the add_symbols and
relocate_section stages of linking.  So instead I'm aiming to replace
"_cooked_size" with plain "size", and set both "_raw_size" and "size"
on reading/creating sections.  Plain "size" will be used almost
everywhere, except where the linker needs the original size for some
reason.  Anyway, that change is for a follow-on patch.

Since this touches files outside of the binutils area, I need permission
to commit to gdb/, sim/, and winsup/.

bfd/
	* section.c (struct sec): Remove reloc_done.  Remove usused flags.
	(bfd_get_section_size_before_reloc): Delete.
	(bfd_get_section_size_after_reloc): Delete.
	(STD_SECTION): Update.
	(bfd_get_section_size_now): Delete.
	(bfd_set_section_contents): Don't referece reloc_done.
	(bfd_get_section_contents): Remove reloc_done comment.
	* bout.c (b_out_bfd_get_relocated_section_contents): Don't set
	reloc_done.
	* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Likewise.
	* ecoff.c (bfd_debug_section): Update initializer.
	* elf32-xtensa.c (xtensa_read_table_entries): Don't use reloc_done.
	(elf_xtensa_relocate_section): Don't set reloc_done.
	* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Ditto.
	* reloc.c (bfd_generic_get_relocated_section_contents): Likewise.
	* bfd-in.h (bfd_section_size): Expand.
	(bfd_get_section_size): New macro.
	* bfd-in2.h: Regenerate.
	* coff64-rs6000.c (xcoff64_write_object_contents): Replace
	bfd_get_section_size_before_reloc with bfd_get_section_size.
	* coffcode.h (coff_write_object_contents): Likewise.
	* coffgen.c (build_debug_section): Likewise.
	* dwarf1.c (parse_line_table): Likewise.
	(_bfd_dwarf1_find_nearest_line): Likewise.
	* ecoff.c (_bfd_ecoff_write_object_contents): Likewise.
	* i386msdos.c (msdos_write_object_contents): Likewise.
	* pdp11.c (squirt_out_relocs): Likewise.
	* elf32-sh64.c (sh64_find_section_for_address): Remove comment.
	* elf64-mmix.c (mmix_elf_final_link): Update comment.
binutils/
	* objcopy.c (copy_section): Use bfd_get_section_size instead of
	_raw_size or bfd_get_section_size_before_reloc.  Don't set reloc_done.
	(compare_section_lma): Likewise.
	* addr2line.c (find_address_in_section): Likewise.
	* coffgrok.c (do_sections_p1): Likewise.
	* dlltool.c (scan_drectve_symbols): Likewise.
	* nlmconv.c (main): Likewise.
	(copy_sections): Likewise.
	(powerpc_mangle_relocs): Likewise.
	* objdump.c (disassemble_section): Likewise.
	* prdbg.c (find_address_in_section): Likewise.
	* size.c (berkeley_sum): Likewise.
	* srconv.c (wr_ob): Likewise.
	* strings.c (strings_a_section): Likewise.
gas/
	* 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.
gdb/
	* dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of
	bfd_get_section_size_before_reloc or _raw_size.
	* dwarf2-frame.c (dwarf2_build_frame_info): Likewise.
	* dwarf2read.c (dwarf2_locate_sections): Likewise.
	(dwarf2_read_section): Likewise.
	* elfread.c (elf_locate_sections): Likewise.
	* gcore.c (derive_heap_segment): Likewise.
	* mipsread.c (read_alphacoff_dynamic_symtab): Likewise.
	* remote-e7000.c (e7000_load): Likewise.
	* remote-m32r-sdi.c (m32r_load): Likewise.
	* remote-mips.c (mips_load_srec): Likewise.
	(pmon_load_fast): Likewise.
	* remote.c (compare_sections_command): Likewise.
	* symfile.c (add_section_size_callback): Likewise.
	(load_section_callback): Likewise.
	(pc_in_unmapped_range): Likewise.
	(pc_in_mapped_range): Likewise.
	(sections_overlap): Likewise.
	(list_overlays_command): Likewise.
	(simple_overlay_update_1): Likewise.
	(simple_overlay_update): Likewise.
	* tracepoint.c (remote_set_transparent_ranges): Likewise.
	* win32-nat.c (core_section_load_dll_symbols): Likewise.
gdb/gdbtk/
	* generic/gdbtk-cmds.c (gdb_load_info): Use bfd_get_section_size
	instead of bfd_get_section_size_before_reloc.
gprof/
	* corefile.c (core_init): Use bfd_get_section_size
	instead of bfd_get_section_size_before_reloc or _raw_size.
	* symtab.c (symtab_finalize): Likewise.
ld/
	* ldwrite.c (build_link_order): Use bfd_get_section_size
	instead of bfd_get_section_size_before_reloc or _raw_size.
	* pe-dll.c (process_def_file): Likewise.
opcodes/
	* arc-ext.c (build_ARC_extmap): Use bfd_get_section_size
	instead of _raw_size.
sim/common/
	* sim-load.c (sim_load_file): Use bfd_get_section_size
	instead of bfd_get_section_size_before_reloc.
sim/m68hc11/
	* interp.c (sim_prepare_for_program): Use bfd_get_section_size
	instead of bfd_get_section_size_before_reloc.
sim/ppc/
	* hw_htab.c (htab_sum_binary(bfd): Use bfd_get_section_size
	instead of bfd_get_section_size_before_reloc.
	(htab_dma_binary(bfd): Likewise.
	* hw_init.c (update_for_binary_section(bfd): Likewise.
winsup/utils/
	* dumper.cc (dumper::prepare_core_dump): Use bfd_get_section_size
	instead of _raw_size.
	(dumper::write_core_dump): Likewise.
	* parse_pe.cc (select_data_section): Likewise.

Index: bfd/bfd-in.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in.h,v
retrieving revision 1.80
diff -u -p -r1.80 bfd-in.h
--- bfd/bfd-in.h	21 May 2004 15:38:01 -0000	1.80
+++ bfd/bfd-in.h	12 Jun 2004 10:57:49 -0000
@@ -308,7 +308,8 @@ typedef struct bfd_section *sec_ptr;
 #define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
 #define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
 #define bfd_section_name(bfd, ptr) ((ptr)->name)
-#define bfd_section_size(bfd, ptr) (bfd_get_section_size_before_reloc(ptr))
+#define bfd_section_size(bfd, ptr) ((ptr)->_raw_size)
+#define bfd_get_section_size(ptr) ((ptr)->_raw_size)
 #define bfd_section_vma(bfd, ptr) ((ptr)->vma)
 #define bfd_section_lma(bfd, ptr) ((ptr)->lma)
 #define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
Index: bfd/bout.c
===================================================================
RCS file: /cvs/src/src/bfd/bout.c,v
retrieving revision 1.19
diff -u -p -r1.19 bout.c
--- bfd/bout.c	30 Apr 2004 14:23:39 -0000	1.19
+++ bfd/bout.c	12 Jun 2004 10:57:52 -0000
@@ -1328,8 +1328,6 @@ b_out_bfd_get_relocated_section_contents
   if (reloc_vector == NULL && reloc_size != 0)
     goto error_return;
 
-  input_section->reloc_done = 1;
-
   /* Read in the section.  */
   BFD_ASSERT (bfd_get_section_contents (input_bfd,
 					input_section,
Index: bfd/coff-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-alpha.c,v
retrieving revision 1.21
diff -u -p -r1.21 coff-alpha.c
--- bfd/coff-alpha.c	11 Jun 2004 14:19:32 -0000	1.21
+++ bfd/coff-alpha.c	12 Jun 2004 10:57:56 -0000
@@ -784,7 +784,6 @@ alpha_ecoff_get_relocated_section_conten
 
   /* The section size is not going to change.  */
   input_section->_cooked_size = input_section->_raw_size;
-  input_section->reloc_done = TRUE;
 
   reloc_count = bfd_canonicalize_reloc (input_bfd, input_section,
 					reloc_vector, symbols);
Index: bfd/coff64-rs6000.c
===================================================================
RCS file: /cvs/src/src/bfd/coff64-rs6000.c,v
retrieving revision 1.51
diff -u -p -r1.51 coff64-rs6000.c
--- bfd/coff64-rs6000.c	17 May 2004 16:40:00 -0000	1.51
+++ bfd/coff64-rs6000.c	12 Jun 2004 10:57:56 -0000
@@ -965,19 +965,19 @@ xcoff64_write_object_contents (abfd)
 
   if (text_sec)
     {
-      internal_a.tsize = bfd_get_section_size_before_reloc (text_sec);
+      internal_a.tsize = bfd_get_section_size (text_sec);
       internal_a.text_start = internal_a.tsize ? text_sec->vma : 0;
     }
 
   if (data_sec)
     {
-      internal_a.dsize = bfd_get_section_size_before_reloc (data_sec);
+      internal_a.dsize = bfd_get_section_size (data_sec);
       internal_a.data_start = internal_a.dsize ? data_sec->vma : 0;
     }
 
   if (bss_sec)
     {
-      internal_a.bsize = bfd_get_section_size_before_reloc (bss_sec);
+      internal_a.bsize = bfd_get_section_size (bss_sec);
       if (internal_a.bsize && bss_sec->vma < internal_a.data_start)
 	internal_a.data_start = bss_sec->vma;
     }
Index: bfd/coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.105
diff -u -p -r1.105 coffcode.h
--- bfd/coffcode.h	17 May 2004 16:40:00 -0000	1.105
+++ bfd/coffcode.h	12 Jun 2004 10:57:58 -0000
@@ -4132,17 +4132,17 @@ coff_write_object_contents (abfd)
 
   if (text_sec)
     {
-      internal_a.tsize = bfd_get_section_size_before_reloc (text_sec);
+      internal_a.tsize = bfd_get_section_size (text_sec);
       internal_a.text_start = internal_a.tsize ? text_sec->vma : 0;
     }
   if (data_sec)
     {
-      internal_a.dsize = bfd_get_section_size_before_reloc (data_sec);
+      internal_a.dsize = bfd_get_section_size (data_sec);
       internal_a.data_start = internal_a.dsize ? data_sec->vma : 0;
     }
   if (bss_sec)
     {
-      internal_a.bsize = bfd_get_section_size_before_reloc (bss_sec);
+      internal_a.bsize = bfd_get_section_size (bss_sec);
       if (internal_a.bsize && bss_sec->vma < internal_a.data_start)
 	internal_a.data_start = bss_sec->vma;
     }
Index: bfd/coffgen.c
===================================================================
RCS file: /cvs/src/src/bfd/coffgen.c,v
retrieving revision 1.41
diff -u -p -r1.41 coffgen.c
--- bfd/coffgen.c	4 Nov 2003 11:30:54 -0000	1.41
+++ bfd/coffgen.c	12 Jun 2004 10:57:59 -0000
@@ -1537,7 +1537,7 @@ build_debug_section (abfd)
       return NULL;
     }
 
-  sec_size = bfd_get_section_size_before_reloc (sect);
+  sec_size = bfd_get_section_size (sect);
   debug_section = (PTR) bfd_alloc (abfd, sec_size);
   if (debug_section == NULL)
     return NULL;
Index: bfd/dwarf1.c
===================================================================
RCS file: /cvs/src/src/bfd/dwarf1.c,v
retrieving revision 1.11
diff -u -p -r1.11 dwarf1.c
--- bfd/dwarf1.c	30 Nov 2002 08:39:36 -0000	1.11
+++ bfd/dwarf1.c	12 Jun 2004 10:58:03 -0000
@@ -285,7 +285,7 @@ parse_line_table (stash, aUnit)
       if (! msec)
 	return FALSE;
 
-      size = bfd_get_section_size_before_reloc (msec);
+      size = bfd_get_section_size (msec);
       stash->line_section = (char *) bfd_alloc (stash->abfd, size);
 
       if (! stash->line_section)
@@ -502,7 +502,7 @@ _bfd_dwarf1_find_nearest_line (abfd, sec
 	  return FALSE;
 	}
 
-      size = bfd_get_section_size_before_reloc (msec);
+      size = bfd_get_section_size (msec);
       stash->debug_section = (char *) bfd_alloc (abfd, size);
 
       if (! stash->debug_section)
Index: bfd/ecoff.c
===================================================================
RCS file: /cvs/src/src/bfd/ecoff.c,v
retrieving revision 1.33
diff -u -p -r1.33 ecoff.c
--- bfd/ecoff.c	24 Apr 2004 06:12:24 -0000	1.33
+++ bfd/ecoff.c	12 Jun 2004 10:58:06 -0000
@@ -77,16 +77,14 @@ static unsigned int ecoff_armap_hash
 
 static asection bfd_debug_section =
 {
-  /* name,   id,  index, next, flags, user_set_vma, reloc_done,    */
-  "*DEBUG*", 0,   0,     NULL, 0,     0,            0,
+  /* name,   id,  index, next, flags, user_set_vma,                */
+  "*DEBUG*", 0,   0,     NULL, 0,     0,
   /* linker_mark, linker_has_input, gc_mark, segment_mark,         */
      0,           0,                0,       0,
   /* sec_info_type, use_rela_p, has_tls_reloc,                     */
      0,		    0,		0,
   /* need_finalize_relax, has_gp_reloc,                            */
      0,			  0,
-  /* flag13, flag14, flag15, flag16, flag20, flag24,               */
-     0,      0,      0,      0,      0,	     0,
   /* vma, lma, _cooked_size, _raw_size,                            */
      0,   0,   0,            0,
   /* output_offset, output_section, alignment_power,               */
@@ -2550,7 +2548,7 @@ _bfd_ecoff_write_object_contents (abfd)
 	section.s_vaddr = vma;
 
       section.s_paddr = current->lma;
-      section.s_size = bfd_get_section_size_before_reloc (current);
+      section.s_size = bfd_get_section_size (current);
 
       /* If this section is unloadable then the scnptr will be 0.  */
       if ((current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
@@ -2601,7 +2599,7 @@ _bfd_ecoff_write_object_contents (abfd)
 	  || (section.s_flags & STYP_ECOFF_FINI) != 0
 	  || section.s_flags == STYP_RCONST)
 	{
-	  text_size += bfd_get_section_size_before_reloc (current);
+	  text_size += bfd_get_section_size (current);
 	  if (! set_text_start || text_start > vma)
 	    {
 	      text_start = vma;
@@ -2617,7 +2615,7 @@ _bfd_ecoff_write_object_contents (abfd)
 	       || section.s_flags == STYP_XDATA
 	       || (section.s_flags & STYP_GOT) != 0)
 	{
-	  data_size += bfd_get_section_size_before_reloc (current);
+	  data_size += bfd_get_section_size (current);
 	  if (! set_data_start || data_start > vma)
 	    {
 	      data_start = vma;
@@ -2626,7 +2624,7 @@ _bfd_ecoff_write_object_contents (abfd)
 	}
       else if ((section.s_flags & STYP_BSS) != 0
 	       || (section.s_flags & STYP_SBSS) != 0)
-	bss_size += bfd_get_section_size_before_reloc (current);
+	bss_size += bfd_get_section_size (current);
       else if (section.s_flags == 0
 	       || (section.s_flags & STYP_ECOFF_LIB) != 0
 	       || section.s_flags == STYP_COMMENT)
Index: bfd/elf32-sh64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-sh64.c,v
retrieving revision 1.24
diff -u -p -r1.24 elf32-sh64.c
--- bfd/elf32-sh64.c	27 Apr 2004 16:06:07 -0000	1.24
+++ bfd/elf32-sh64.c	12 Jun 2004 10:58:09 -0000
@@ -620,8 +620,6 @@ sh64_find_section_for_address (bfd *abfd
   if (fsec_datap->addr < vma)
     return;
 
-  /* FIXME: section->reloc_done isn't set properly; a generic buglet
-     preventing us from using bfd_get_section_size_after_reloc.  */
   size
     = section->_cooked_size ? section->_cooked_size : section->_raw_size;
 
Index: bfd/elf32-xtensa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xtensa.c,v
retrieving revision 1.27
diff -u -p -r1.27 elf32-xtensa.c
--- bfd/elf32-xtensa.c	17 May 2004 20:33:33 -0000	1.27
+++ bfd/elf32-xtensa.c	12 Jun 2004 10:58:12 -0000
@@ -524,7 +524,8 @@ xtensa_read_table_entries (abfd, section
   /* If the file has not yet been relocated, process the relocations
      and sort out the table entries that apply to the specified section.  */
   internal_relocs = retrieve_internal_relocs (abfd, table_section, TRUE);
-  if (internal_relocs && !table_section->reloc_done)
+  if (internal_relocs
+      && elf_section_data (table_section)->this_hdr.contents == NULL)
     {
       unsigned i;
 
@@ -2148,8 +2149,6 @@ elf_xtensa_relocate_section (output_bfd,
   if (lit_table)
     free (lit_table);
 
-  input_section->reloc_done = TRUE;
-
   return TRUE;
 }
 
Index: bfd/elf64-mmix.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-mmix.c,v
retrieving revision 1.34
diff -u -p -r1.34 elf64-mmix.c
--- bfd/elf64-mmix.c	27 Mar 2004 10:58:07 -0000	1.34
+++ bfd/elf64-mmix.c	12 Jun 2004 10:58:13 -0000
@@ -2296,12 +2296,11 @@ mmix_elf_final_link (abfd, info)
 /* We need to include the maximum size of PUSHJ-stubs in the initial
    section size.  This is expected to shrink during linker relaxation.
 
-   You might think that we should set *only* _cooked_size, but that won't
-   work: section contents allocation will be using _raw_size in mixed
-   format linking and not enough storage will be allocated.  FIXME: That's
-   a major bug, including the name bfd_get_section_size_before_reloc; it
-   should be bfd_get_section_size_before_relax.  The relaxation functions
-   set _cooked size.  Relaxation happens before relocation.  All functions
+   You might think that we should set *only* _cooked_size, but that
+   won't work: section contents allocation will be using _raw_size in
+   mixed format linking and not enough storage will be allocated.
+   FIXME: That's a major bug.  The relaxation functions set _cooked
+   size.  Relaxation happens before relocation.  All functions
    *after relaxation* should be using _cooked size.  */
 
 static void
Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.101
diff -u -p -r1.101 elfxx-mips.c
--- bfd/elfxx-mips.c	15 May 2004 18:58:05 -0000	1.101
+++ bfd/elfxx-mips.c	12 Jun 2004 10:58:19 -0000
@@ -7914,7 +7914,6 @@ _bfd_elf_mips_get_relocated_section_cont
 
   /* We're not relaxing the section, so just copy the size info */
   input_section->_cooked_size = input_section->_raw_size;
-  input_section->reloc_done = TRUE;
 
   reloc_count = bfd_canonicalize_reloc (input_bfd,
 					input_section,
Index: bfd/i386msdos.c
===================================================================
RCS file: /cvs/src/src/bfd/i386msdos.c,v
retrieving revision 1.14
diff -u -p -r1.14 i386msdos.c
--- bfd/i386msdos.c	30 Apr 2004 14:23:39 -0000	1.14
+++ bfd/i386msdos.c	12 Jun 2004 10:58:19 -0000
@@ -83,20 +83,20 @@ msdos_write_object_contents (abfd)
   /* Find the total size of the program on disk and in memory.  */
   for (sec = abfd->sections; sec != (asection *) NULL; sec = sec->next)
     {
-      if (bfd_get_section_size_before_reloc (sec) == 0)
+      if (bfd_get_section_size (sec) == 0)
         continue;
       if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
         {
-	  bfd_vma sec_vma = bfd_get_section_vma (abfd, sec)
-	  		    + bfd_get_section_size_before_reloc (sec);
+	  bfd_vma sec_vma = (bfd_get_section_vma (abfd, sec)
+			     + bfd_get_section_size (sec));
 	  if (sec_vma > high_vma)
 	    high_vma = sec_vma;
 	}
       if (bfd_get_section_flags (abfd, sec) & SEC_LOAD)
         {
-	  file_ptr sec_end = sizeof(hdr)
-	  		     + bfd_get_section_vma (abfd, sec)
-			     + bfd_get_section_size_before_reloc (sec);
+	  file_ptr sec_end = (sizeof (hdr)
+			      + bfd_get_section_vma (abfd, sec)
+			      + bfd_get_section_size (sec));
 	  if (sec_end > outfile_size)
 	    outfile_size = sec_end;
 	}
Index: bfd/pdp11.c
===================================================================
RCS file: /cvs/src/src/bfd/pdp11.c,v
retrieving revision 1.21
diff -u -p -r1.21 pdp11.c
--- bfd/pdp11.c	15 Mar 2004 12:23:10 -0000	1.21
+++ bfd/pdp11.c	12 Jun 2004 10:58:23 -0000
@@ -2314,7 +2314,7 @@ NAME(aout,squirt_out_relocs) (abfd, sect
     return TRUE;
 #endif
 
-  natsize = bfd_get_section_size_before_reloc (section);
+  natsize = bfd_get_section_size (section);
   native = (unsigned char *) bfd_zalloc (abfd, natsize);
   if (!native)
     return FALSE;
Index: bfd/reloc.c
===================================================================
RCS file: /cvs/src/src/bfd/reloc.c,v
retrieving revision 1.102
diff -u -p -r1.102 reloc.c
--- bfd/reloc.c	29 Apr 2004 05:14:19 -0000	1.102
+++ bfd/reloc.c	12 Jun 2004 10:58:24 -0000
@@ -4292,8 +4292,6 @@ bfd_generic_get_relocated_section_conten
      this function is called.  We do not want to clobber the _cooked_size
      they computed.  */
 
-  input_section->reloc_done = TRUE;
-
   reloc_count = bfd_canonicalize_reloc (input_bfd,
 					input_section,
 					reloc_vector,
Index: bfd/section.c
===================================================================
RCS file: /cvs/src/src/bfd/section.c,v
retrieving revision 1.71
diff -u -p -r1.71 section.c
--- bfd/section.c	2 May 2004 14:36:24 -0000	1.71
+++ bfd/section.c	12 Jun 2004 10:58:25 -0000
@@ -364,9 +364,6 @@ CODE_FRAGMENT
 .  {* See the vma field.  *}
 .  unsigned int user_set_vma : 1;
 .
-.  {* Whether relocations have been processed.  *}
-.  unsigned int reloc_done : 1;
-.
 .  {* A mark flag used by some of the linker backends.  *}
 .  unsigned int linker_mark : 1;
 .
@@ -402,14 +399,6 @@ CODE_FRAGMENT
 .  {* Nonzero if this section has a gp reloc.  *}
 .  unsigned int has_gp_reloc:1;
 .
-.  {* Unused bits.  *}
-.  unsigned int flag13:1;
-.  unsigned int flag14:1;
-.  unsigned int flag15:1;
-.  unsigned int flag16:4;
-.  unsigned int flag20:4;
-.  unsigned int flag24:8;
-.
 .  {* End of internal packed boolean fields.  *}
 .
 .  {*  The virtual memory address of the section - where it will be
@@ -557,11 +546,6 @@ CODE_FRAGMENT
 .extern const struct bfd_symbol * const bfd_com_symbol;
 .extern const struct bfd_symbol * const bfd_und_symbol;
 .extern const struct bfd_symbol * const bfd_ind_symbol;
-.#define bfd_get_section_size_before_reloc(section) \
-.     ((section)->_raw_size)
-.#define bfd_get_section_size_after_reloc(section) \
-.     ((section)->reloc_done ? (section)->_cooked_size \
-.                            : (abort (), (bfd_size_type) 1))
 .
 .{* Macros to handle insertion and deletion of a bfd's sections.  These
 .   only handle the list pointers, ie. do not adjust section_count,
@@ -616,8 +600,8 @@ static const asymbol global_syms[] =
 #define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX)				\
   const asymbol * const SYM = (asymbol *) &global_syms[IDX]; 		\
   asection SEC = 							\
-    /* name, id,  index, next, flags, user_set_vma, reloc_done,      */	\
-    { NAME,  IDX, 0,     NULL, FLAGS, 0,            0,			\
+    /* name, id,  index, next, flags, user_set_vma,                  */	\
+    { NAME,  IDX, 0,     NULL, FLAGS, 0,				\
 									\
     /* linker_mark, linker_has_input, gc_mark, segment_mark,         */	\
        0,           0,                1,       0,			\
@@ -628,9 +612,6 @@ static const asymbol global_syms[] =
     /* need_finalize_relax, has_gp_reloc,                            */ \
        0,		    0,						\
 									\
-    /* flag13, flag14, flag15, flag16, flag20, flag24,               */ \
-       0,      0,      0,      0,      0,      0,			\
-									\
     /* vma, lma, _cooked_size, _raw_size,                            */	\
        0,   0,   0,            0,					\
 									\
@@ -1243,11 +1224,6 @@ DESCRIPTION
 
 */
 
-#define bfd_get_section_size_now(abfd, sec) \
-  (sec->reloc_done \
-   ? bfd_get_section_size_after_reloc (sec) \
-   : bfd_get_section_size_before_reloc (sec))
-
 bfd_boolean
 bfd_set_section_contents (bfd *abfd,
 			  sec_ptr section,
@@ -1263,7 +1239,7 @@ bfd_set_section_contents (bfd *abfd,
       return FALSE;
     }
 
-  sz = bfd_get_section_size_now (abfd, section);
+  sz = section->_cooked_size != 0 ? section->_cooked_size : section->_raw_size;
   if ((bfd_size_type) offset > sz
       || count > sz
       || offset + count > sz
@@ -1343,8 +1319,6 @@ bfd_get_section_contents (bfd *abfd,
       return TRUE;
     }
 
-  /* Even if reloc_done is TRUE, this function reads unrelocated
-     contents, so we want the raw size.  */
   sz = section->_raw_size;
   if ((bfd_size_type) offset > sz
       || count > sz
Index: binutils/addr2line.c
===================================================================
RCS file: /cvs/src/src/binutils/addr2line.c,v
retrieving revision 1.20
diff -u -p -r1.20 addr2line.c
--- binutils/addr2line.c	7 Nov 2003 12:19:34 -0000	1.20
+++ binutils/addr2line.c	12 Jun 2004 10:58:27 -0000
@@ -137,7 +137,7 @@ find_address_in_section (bfd *abfd, asec
   if (pc < vma)
     return;
 
-  size = bfd_get_section_size_before_reloc (section);
+  size = bfd_get_section_size (section);
   if (pc >= vma + size)
     return;
 
Index: binutils/coffgrok.c
===================================================================
RCS file: /cvs/src/src/binutils/coffgrok.c,v
retrieving revision 1.10
diff -u -p -r1.10 coffgrok.c
--- binutils/coffgrok.c	6 Dec 2003 10:02:06 -0000	1.10
+++ binutils/coffgrok.c	12 Jun 2004 10:58:27 -0000
@@ -156,7 +156,7 @@ do_sections_p1 (struct coff_ofile *head)
       if (strcmp (section->name, ".bss") == 0)
 	head->sections[i].data = 1;
       head->sections[i].address = section->lma;
-      head->sections[i].size = section->_raw_size;
+      head->sections[i].size = bfd_get_section_size (section);
       head->sections[i].number = idx;
       head->sections[i].nrelocs = section->reloc_count;
       head->sections[i].relocs =
Index: binutils/dlltool.c
===================================================================
RCS file: /cvs/src/src/binutils/dlltool.c,v
retrieving revision 1.48
diff -u -p -r1.48 dlltool.c
--- binutils/dlltool.c	8 Mar 2004 11:50:36 -0000	1.48
+++ binutils/dlltool.c	12 Jun 2004 10:58:29 -0000
@@ -1206,7 +1206,7 @@ scan_drectve_symbols (bfd *abfd)
   if (s == NULL)
     return;
 
-  size = bfd_get_section_size_before_reloc (s);
+  size = bfd_get_section_size (s);
   buf  = xmalloc (size);
 
   bfd_get_section_contents (abfd, s, buf, 0, size);
Index: binutils/nlmconv.c
===================================================================
RCS file: /cvs/src/src/binutils/nlmconv.c,v
retrieving revision 1.17
diff -u -p -r1.17 nlmconv.c
--- binutils/nlmconv.c	14 Sep 2003 12:20:16 -0000	1.17
+++ binutils/nlmconv.c	12 Jun 2004 10:58:30 -0000
@@ -431,7 +431,7 @@ main (int argc, char **argv)
     {
       bfd_size_type add;
 
-      vma = bfd_get_section_size_before_reloc (data_sec);
+      vma = bfd_get_section_size (data_sec);
       align = 1 << bss_sec->alignment_power;
       add = ((vma + align - 1) &~ (align - 1)) - vma;
       vma += add;
@@ -441,7 +441,7 @@ main (int argc, char **argv)
 	{
 	  bfd_size_type data_size;
 
-	  data_size = bfd_get_section_size_before_reloc (data_sec);
+	  data_size = bfd_get_section_size (data_sec);
 	  if (! bfd_set_section_size (outbfd, data_sec, data_size + add))
 	    bfd_fatal (_("set .data size"));
 	}
@@ -499,14 +499,14 @@ main (int argc, char **argv)
 	 symbols into the .bss section, and mark them as exported.  */
       if (bfd_is_com_section (bfd_get_section (sym)))
 	{
-	  bfd_vma size;
+	  bfd_vma size = sym->value;
 
 	  sym->section = bss_sec;
-	  size = sym->value;
-	  sym->value = bss_sec->_raw_size;
-	  bss_sec->_raw_size += size;
+	  sym->value = bfd_get_section_size (bss_sec);
+	  size += sym->value;
 	  align = 1 << bss_sec->alignment_power;
-	  bss_sec->_raw_size = (bss_sec->_raw_size + align - 1) &~ (align - 1);
+	  size = (size + align - 1) & ~(align - 1);
+	  bfd_set_section_size (outbfd, bss_sec, size);
 	  sym->flags |= BSF_EXPORT | BSF_GLOBAL;
 	}
       else if (bfd_get_section (sym)->output_section != NULL)
@@ -670,7 +670,7 @@ main (int argc, char **argv)
 
   if (endsym != NULL)
     {
-      endsym->value = bfd_get_section_size_before_reloc (bss_sec);
+      endsym->value = bfd_get_section_size (bss_sec);
 
       /* FIXME: If any relocs referring to _end use inplace addends,
 	 then I think they need to be updated.  This is handled by
@@ -1230,11 +1230,7 @@ copy_sections (bfd *inbfd, asection *ins
   outsec = insec->output_section;
   assert (outsec != NULL);
 
-  size = bfd_get_section_size_before_reloc (insec);
-
-  /* FIXME: Why are these necessary?  */
-  insec->_cooked_size = insec->_raw_size;
-  insec->reloc_done = TRUE;
+  size = bfd_get_section_size (insec);
 
   if ((bfd_get_section_flags (inbfd, insec) & SEC_HAS_CONTENTS) == 0)
     contents = NULL;
@@ -1881,8 +1877,7 @@ powerpc_mangle_relocs (bfd *outbfd, asec
      going to write out whatever we return in the contents field.  */
   if (strcmp (bfd_get_section_name (insec->owner, insec), ".got") == 0)
     memset (contents + powerpc_initial_got_size, 0,
-	    (size_t) (bfd_get_section_size_after_reloc (insec)
-		      - powerpc_initial_got_size));
+	    (size_t) (bfd_get_section_size (insec) - powerpc_initial_got_size));
 
   reloc_count = *reloc_count_ptr;
   relocs = *relocs_ptr;
Index: binutils/objcopy.c
===================================================================
RCS file: /cvs/src/src/binutils/objcopy.c,v
retrieving revision 1.68
diff -u -p -r1.68 objcopy.c
--- binutils/objcopy.c	17 May 2004 16:39:59 -0000	1.68
+++ binutils/objcopy.c	12 Jun 2004 10:58:32 -0000
@@ -2014,7 +2014,7 @@ copy_section (bfd *ibfd, sec_ptr isectio
     return;
 
   osection = isection->output_section;
-  size = bfd_get_section_size_before_reloc (isection);
+  size = bfd_get_section_size (isection);
 
   if (size == 0 || osection == 0)
     return;
@@ -2071,7 +2071,6 @@ copy_section (bfd *ibfd, sec_ptr isectio
     }
 
   isection->_cooked_size = isection->_raw_size;
-  isection->reloc_done = TRUE;
 
   if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS
       && bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS)
@@ -2164,9 +2161,9 @@ compare_section_lma (const void *arg1, c
     return -1;
 
   /* Sort sections with the same LMA by size.  */
-  if ((*sec1)->_raw_size > (*sec2)->_raw_size)
+  if (bfd_get_section_size (*sec1) > bfd_get_section_size (*sec2))
     return 1;
-  else if ((*sec1)->_raw_size < (*sec2)->_raw_size)
+  else if (bfd_get_section_size (*sec1) < bfd_get_section_size (*sec2))
     return -1;
 
   return 0;
Index: binutils/objdump.c
===================================================================
RCS file: /cvs/src/src/binutils/objdump.c,v
retrieving revision 1.89
diff -u -p -r1.89 objdump.c
--- binutils/objdump.c	24 Apr 2004 12:39:47 -0000	1.89
+++ binutils/objdump.c	12 Jun 2004 10:58:33 -0000
@@ -1579,7 +1579,7 @@ disassemble_section (bfd *abfd, asection
   if (! process_section_p (section))
     return;
 
-  datasize = bfd_get_section_size_before_reloc (section);
+  datasize = bfd_get_section_size (section);
   if (datasize == 0)
     return;
 
Index: binutils/prdbg.c
===================================================================
RCS file: /cvs/src/src/binutils/prdbg.c,v
retrieving revision 1.10
diff -u -p -r1.10 prdbg.c
--- binutils/prdbg.c	6 Dec 2003 00:06:12 -0000	1.10
+++ binutils/prdbg.c	12 Jun 2004 10:58:34 -0000
@@ -1904,7 +1904,7 @@ find_address_in_section (bfd *abfd, asec
   if (pc < vma)
     return;
 
-  size = bfd_get_section_size_before_reloc (section);
+  size = bfd_get_section_size (section);
   if (pc >= vma + size)
     return;
 
Index: binutils/size.c
===================================================================
RCS file: /cvs/src/src/binutils/size.c,v
retrieving revision 1.18
diff -u -p -r1.18 size.c
--- binutils/size.c	7 Nov 2003 12:19:34 -0000	1.18
+++ binutils/size.c	12 Jun 2004 10:58:34 -0000
@@ -429,7 +429,7 @@ berkeley_sum (bfd *abfd ATTRIBUTE_UNUSED
   if ((flags & SEC_ALLOC) == 0)
     return;
 
-  size = bfd_get_section_size_before_reloc (sec);
+  size = bfd_get_section_size (sec);
   if ((flags & SEC_CODE) != 0 || (flags & SEC_READONLY) != 0)
     textsize += size;
   else if ((flags & SEC_HAS_CONTENTS) != 0)
Index: binutils/srconv.c
===================================================================
RCS file: /cvs/src/src/binutils/srconv.c,v
retrieving revision 1.11
diff -u -p -r1.11 srconv.c
--- binutils/srconv.c	14 Sep 2003 12:20:16 -0000	1.11
+++ binutils/srconv.c	12 Jun 2004 10:58:35 -0000
@@ -456,14 +456,14 @@ wr_ob (struct coff_ofile *p ATTRIBUTE_UN
   unsigned char stuff[200];
 
   i = 0;
-  while (i < section->bfd_section->_raw_size)
+  while (i < bfd_get_section_size (section->bfd_section))
     {
       struct IT_ob ob;
       int todo = 200;		/* Copy in 200 byte lumps.  */
 
       ob.spare = 0;
-      if (i + todo > section->bfd_section->_raw_size)
-	todo = section->bfd_section->_raw_size - i;
+      if (i + todo > bfd_get_section_size (section->bfd_section))
+	todo = bfd_get_section_size (section->bfd_section) - i;
 
       if (first)
 	{
Index: binutils/strings.c
===================================================================
RCS file: /cvs/src/src/binutils/strings.c,v
retrieving revision 1.22
diff -u -p -r1.22 strings.c
--- binutils/strings.c	14 Apr 2004 05:49:59 -0000	1.22
+++ binutils/strings.c	12 Jun 2004 10:58:35 -0000
@@ -317,7 +317,7 @@ strings_a_section (bfd *abfd, asection *
 
   if ((sect->flags & DATA_FLAGS) == DATA_FLAGS)
     {
-      bfd_size_type sz = bfd_get_section_size_before_reloc (sect);
+      bfd_size_type sz = bfd_get_section_size (sect);
       void *mem = xmalloc (sz);
 
       if (bfd_get_section_contents (abfd, sect, mem, (file_ptr) 0, sz))
Index: gas/config/obj-coff.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-coff.c,v
retrieving revision 1.69
diff -u -p -r1.69 obj-coff.c
--- gas/config/obj-coff.c	20 Nov 2003 00:01:54 -0000	1.69
+++ gas/config/obj-coff.c	12 Jun 2004 10:58:43 -0000
@@ -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;
Index: gas/config/obj-elf.c
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.c,v
retrieving revision 1.84
diff -u -p -r1.84 obj-elf.c
--- gas/config/obj-elf.c	3 May 2004 04:08:32 -0000	1.84
+++ gas/config/obj-elf.c	12 Jun 2004 10:58:44 -0000
@@ -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
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.265
diff -u -p -r1.265 tc-mips.c
--- gas/config/tc-mips.c	20 May 2004 10:10:43 -0000	1.265
+++ gas/config/tc-mips.c	12 Jun 2004 10:58:54 -0000
@@ -11013,7 +11013,7 @@ md_apply_fix3 (fixS *fixP, valueT *valP,
 	       && 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 */
Index: gdb/dsrec.c
===================================================================
RCS file: /cvs/src/src/gdb/dsrec.c,v
retrieving revision 1.14
diff -u -p -r1.14 dsrec.c
--- gdb/dsrec.c	21 Apr 2004 23:52:20 -0000	1.14
+++ gdb/dsrec.c	12 Jun 2004 10:59:04 -0000
@@ -93,7 +93,7 @@ load_srec (struct serial *desc, const ch
       {
 	int numbytes;
 	bfd_vma addr = bfd_get_section_vma (abfd, s) + load_offset;
-	bfd_size_type size = bfd_get_section_size_before_reloc (s);
+	bfd_size_type size = bfd_get_section_size (s);
 	char *section_name = (char *) bfd_get_section_name (abfd, s);
 	/* Both GDB and BFD have mechanisms for printing addresses.
            In the below, GDB's is used so that the address is
@@ -263,7 +263,7 @@ make_srec (char *srec, CORE_ADDR targ_ad
   if (sect && abfd)
     {
       payload_size = (*maxrecsize - (1 + 1 + 2 + addr_size * 2 + 2)) / 2;
-      payload_size = min (payload_size, sect->_raw_size - sectoff);
+      payload_size = min (payload_size, bfd_get_section_size (sect) - sectoff);
 
       bfd_get_section_contents (abfd, sect, binbuf, sectoff, payload_size);
     }
Index: gdb/dwarf2-frame.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2-frame.c,v
retrieving revision 1.35
diff -u -p -r1.35 dwarf2-frame.c
--- gdb/dwarf2-frame.c	8 Jun 2004 13:34:56 -0000	1.35
+++ gdb/dwarf2-frame.c	12 Jun 2004 10:59:05 -0000
@@ -1571,8 +1571,7 @@ dwarf2_build_frame_info (struct objfile 
       unit.dwarf_frame_buffer = dwarf2_read_section (objfile,
 						     dwarf_eh_frame_section);
 
-      unit.dwarf_frame_size
-	= bfd_get_section_size_before_reloc (dwarf_eh_frame_section);
+      unit.dwarf_frame_size = bfd_get_section_size (dwarf_eh_frame_section);
       unit.dwarf_frame_section = dwarf_eh_frame_section;
 
       /* FIXME: kettenis/20030602: This is the DW_EH_PE_datarel base
@@ -1599,8 +1598,7 @@ dwarf2_build_frame_info (struct objfile 
       unit.cie = NULL;
       unit.dwarf_frame_buffer = dwarf2_read_section (objfile,
 						     dwarf_frame_section);
-      unit.dwarf_frame_size
-	= bfd_get_section_size_before_reloc (dwarf_frame_section);
+      unit.dwarf_frame_size = bfd_get_section_size (dwarf_frame_section);
       unit.dwarf_frame_section = dwarf_frame_section;
 
       frame_ptr = unit.dwarf_frame_buffer;
Index: gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.152
diff -u -p -r1.152 dwarf2read.c
--- gdb/dwarf2read.c	10 Jun 2004 20:05:43 -0000	1.152
+++ gdb/dwarf2read.c	12 Jun 2004 10:59:09 -0000
@@ -996,47 +996,47 @@ dwarf2_locate_sections (bfd *ignore_abfd
 {
   if (strcmp (sectp->name, INFO_SECTION) == 0)
     {
-      dwarf2_per_objfile->info_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->info_size = bfd_get_section_size (sectp);
       dwarf_info_section = sectp;
     }
   else if (strcmp (sectp->name, ABBREV_SECTION) == 0)
     {
-      dwarf2_per_objfile->abbrev_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->abbrev_size = bfd_get_section_size (sectp);
       dwarf_abbrev_section = sectp;
     }
   else if (strcmp (sectp->name, LINE_SECTION) == 0)
     {
-      dwarf2_per_objfile->line_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->line_size = bfd_get_section_size (sectp);
       dwarf_line_section = sectp;
     }
   else if (strcmp (sectp->name, PUBNAMES_SECTION) == 0)
     {
-      dwarf2_per_objfile->pubnames_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->pubnames_size = bfd_get_section_size (sectp);
       dwarf_pubnames_section = sectp;
     }
   else if (strcmp (sectp->name, ARANGES_SECTION) == 0)
     {
-      dwarf2_per_objfile->aranges_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->aranges_size = bfd_get_section_size (sectp);
       dwarf_aranges_section = sectp;
     }
   else if (strcmp (sectp->name, LOC_SECTION) == 0)
     {
-      dwarf2_per_objfile->loc_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->loc_size = bfd_get_section_size (sectp);
       dwarf_loc_section = sectp;
     }
   else if (strcmp (sectp->name, MACINFO_SECTION) == 0)
     {
-      dwarf2_per_objfile->macinfo_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->macinfo_size = bfd_get_section_size (sectp);
       dwarf_macinfo_section = sectp;
     }
   else if (strcmp (sectp->name, STR_SECTION) == 0)
     {
-      dwarf2_per_objfile->str_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->str_size = bfd_get_section_size (sectp);
       dwarf_str_section = sectp;
     }
   else if (strcmp (sectp->name, FRAME_SECTION) == 0)
     {
-      dwarf2_per_objfile->frame_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->frame_size = bfd_get_section_size (sectp);
       dwarf_frame_section = sectp;
     }
   else if (strcmp (sectp->name, EH_FRAME_SECTION) == 0)
@@ -1044,13 +1044,13 @@ dwarf2_locate_sections (bfd *ignore_abfd
       flagword aflag = bfd_get_section_flags (ignore_abfd, sectp);
       if (aflag & SEC_HAS_CONTENTS)
         {
-          dwarf2_per_objfile->eh_frame_size = bfd_get_section_size_before_reloc (sectp);
+          dwarf2_per_objfile->eh_frame_size = bfd_get_section_size (sectp);
           dwarf_eh_frame_section = sectp;
         }
     }
   else if (strcmp (sectp->name, RANGES_SECTION) == 0)
     {
-      dwarf2_per_objfile->ranges_size = bfd_get_section_size_before_reloc (sectp);
+      dwarf2_per_objfile->ranges_size = bfd_get_section_size (sectp);
       dwarf_ranges_section = sectp;
     }
 }
@@ -4464,7 +4464,7 @@ dwarf2_read_section (struct objfile *obj
 {
   bfd *abfd = objfile->obfd;
   char *buf, *retbuf;
-  bfd_size_type size = bfd_get_section_size_before_reloc (sectp);
+  bfd_size_type size = bfd_get_section_size (sectp);
 
   if (size == 0)
     return NULL;
Index: gdb/elfread.c
===================================================================
RCS file: /cvs/src/src/gdb/elfread.c,v
retrieving revision 1.43
diff -u -p -r1.43 elfread.c
--- gdb/elfread.c	2 Apr 2004 19:23:05 -0000	1.43
+++ gdb/elfread.c	12 Jun 2004 10:59:10 -0000
@@ -83,12 +83,12 @@ elf_locate_sections (bfd *ignore_abfd, a
   if (strcmp (sectp->name, ".debug") == 0)
     {
       ei->dboffset = sectp->filepos;
-      ei->dbsize = bfd_get_section_size_before_reloc (sectp);
+      ei->dbsize = bfd_get_section_size (sectp);
     }
   else if (strcmp (sectp->name, ".line") == 0)
     {
       ei->lnoffset = sectp->filepos;
-      ei->lnsize = bfd_get_section_size_before_reloc (sectp);
+      ei->lnsize = bfd_get_section_size (sectp);
     }
   else if (strcmp (sectp->name, ".stab") == 0)
     {
Index: gdb/gcore.c
===================================================================
RCS file: /cvs/src/src/gdb/gcore.c,v
retrieving revision 1.14
diff -u -p -r1.14 gcore.c
--- gdb/gcore.c	14 Jan 2004 18:39:08 -0000	1.14
+++ gdb/gcore.c	12 Jun 2004 10:59:10 -0000
@@ -244,7 +244,7 @@ derive_heap_segment (bfd *abfd, bfd_vma 
 	  || strcmp (".bss", bfd_section_name (abfd, sec)) == 0)
 	{
 	  sec_vaddr = bfd_get_section_vma (abfd, sec);
-	  sec_size = bfd_get_section_size_before_reloc (sec);
+	  sec_size = bfd_get_section_size (sec);
 	  if (sec_vaddr + sec_size > top_of_data_memory)
 	    top_of_data_memory = sec_vaddr + sec_size;
 	}
Index: gdb/mipsread.c
===================================================================
RCS file: /cvs/src/src/gdb/mipsread.c,v
retrieving revision 1.17
diff -u -p -r1.17 mipsread.c
--- gdb/mipsread.c	7 May 2004 14:29:33 -0000	1.17
+++ gdb/mipsread.c	12 Jun 2004 10:59:10 -0000
@@ -234,10 +234,10 @@ read_alphacoff_dynamic_symtab (struct se
       || si.got_sect == NULL)
     return;
 
-  sym_secsize = bfd_get_section_size_before_reloc (si.sym_sect);
-  str_secsize = bfd_get_section_size_before_reloc (si.str_sect);
-  dyninfo_secsize = bfd_get_section_size_before_reloc (si.dyninfo_sect);
-  got_secsize = bfd_get_section_size_before_reloc (si.got_sect);
+  sym_secsize = bfd_get_section_size (si.sym_sect);
+  str_secsize = bfd_get_section_size (si.str_sect);
+  dyninfo_secsize = bfd_get_section_size (si.dyninfo_sect);
+  got_secsize = bfd_get_section_size (si.got_sect);
   sym_secptr = xmalloc (sym_secsize);
   cleanups = make_cleanup (free, sym_secptr);
   str_secptr = xmalloc (str_secsize);
Index: gdb/remote-e7000.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-e7000.c,v
retrieving revision 1.41
diff -u -p -r1.41 remote-e7000.c
--- gdb/remote-e7000.c	25 May 2004 14:58:30 -0000	1.41
+++ gdb/remote-e7000.c	12 Jun 2004 10:59:11 -0000
@@ -1569,7 +1569,7 @@ e7000_load (char *args, int from_tty)
 	  file_ptr fptr;
 
 	  section_address = bfd_get_section_vma (pbfd, section);
-	  section_size = bfd_get_section_size_before_reloc (section);
+	  section_size = bfd_get_section_size (section);
 
 	  if (!quiet)
 	    printf_filtered ("[Loading section %s at 0x%s (%s bytes)]\n",
Index: gdb/remote-m32r-sdi.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-m32r-sdi.c,v
retrieving revision 1.3
diff -u -p -r1.3 remote-m32r-sdi.c
--- gdb/remote-m32r-sdi.c	25 May 2004 14:58:30 -0000	1.3
+++ gdb/remote-m32r-sdi.c	12 Jun 2004 10:59:12 -0000
@@ -1320,7 +1320,7 @@ m32r_load (char *args, int from_tty)
 	  int n;
 
 	  section_address = bfd_section_lma (pbfd, section);
-	  section_size = bfd_get_section_size_before_reloc (section);
+	  section_size = bfd_get_section_size (section);
 
 	  if (!mmu_on)
 	    {
Index: gdb/remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.47
diff -u -p -r1.47 remote-mips.c
--- gdb/remote-mips.c	25 May 2004 14:58:30 -0000	1.47
+++ gdb/remote-mips.c	12 Jun 2004 10:59:14 -0000
@@ -2648,12 +2648,12 @@ mips_load_srec (char *args)
 	  /* FIXME!  vma too small????? */
 	  printf_filtered ("%s\t: 0x%4lx .. 0x%4lx  ", s->name,
 			   (long) s->vma,
-			   (long) (s->vma + s->_raw_size));
+			   (long) (s->vma + bfd_get_section_size (s)));
 	  gdb_flush (gdb_stdout);
 
-	  for (i = 0; i < s->_raw_size; i += numbytes)
+	  for (i = 0; i < bfd_get_section_size (s); i += numbytes)
 	    {
-	      numbytes = min (srec_frame, s->_raw_size - i);
+	      numbytes = min (srec_frame, bfd_get_section_size (s) - i);
 
 	      bfd_get_section_contents (abfd, s, buffer, i, numbytes);
 
@@ -3135,11 +3135,11 @@ pmon_load_fast (char *file)
   for (s = abfd->sections; s && !finished; s = s->next)
     if (s->flags & SEC_LOAD)	/* only deal with loadable sections */
       {
-	bintotal += s->_raw_size;
-	final = (s->vma + s->_raw_size);
+	bintotal += bfd_get_section_size (s);
+	final = (s->vma + bfd_get_section_size (s));
 
 	printf_filtered ("%s\t: 0x%4x .. 0x%4x  ", s->name, (unsigned int) s->vma,
-			 (unsigned int) (s->vma + s->_raw_size));
+			 (unsigned int) (s->vma + bfd_get_section_size (s)));
 	gdb_flush (gdb_stdout);
 
 	/* Output the starting address */
@@ -3160,11 +3160,13 @@ pmon_load_fast (char *file)
 
 	    reclen = 0;
 
-	    for (i = 0; ((i < s->_raw_size) && !finished); i += binamount)
+	    for (i = 0;
+		 i < bfd_get_section_size (s) && !finished;
+		 i += binamount)
 	      {
 		int binptr = 0;
 
-		binamount = min (BINCHUNK, s->_raw_size - i);
+		binamount = min (BINCHUNK, bfd_get_section_size (s) - i);
 
 		bfd_get_section_contents (abfd, s, binbuf, i, binamount);
 
Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.136
diff -u -p -r1.136 remote.c
--- gdb/remote.c	25 May 2004 14:58:30 -0000	1.136
+++ gdb/remote.c	12 Jun 2004 10:59:17 -0000
@@ -4729,7 +4729,7 @@ compare_sections_command (char *args, in
       if (!(s->flags & SEC_LOAD))
 	continue;		/* skip non-loadable section */
 
-      size = bfd_get_section_size_before_reloc (s);
+      size = bfd_get_section_size (s);
       if (size == 0)
 	continue;		/* skip zero-length section */
 
Index: gdb/symfile.c
===================================================================
RCS file: /cvs/src/src/gdb/symfile.c,v
retrieving revision 1.130
diff -u -p -r1.130 symfile.c
--- gdb/symfile.c	20 May 2004 09:51:33 -0000	1.130
+++ gdb/symfile.c	12 Jun 2004 10:59:20 -0000
@@ -1369,7 +1369,7 @@ add_section_size_callback (bfd *abfd, as
 {
   bfd_size_type *sum = data;
 
-  *sum += bfd_get_section_size_before_reloc (asec);
+  *sum += bfd_get_section_size (asec);
 }
 
 /* Opaque data for load_section_callback.  */
@@ -1389,7 +1389,7 @@ load_section_callback (bfd *abfd, asecti
 
   if (bfd_get_section_flags (abfd, asec) & SEC_LOAD)
     {
-      bfd_size_type size = bfd_get_section_size_before_reloc (asec);
+      bfd_size_type size = bfd_get_section_size (asec);
       if (size > 0)
 	{
 	  char *buffer;
@@ -2896,7 +2896,7 @@ pc_in_unmapped_range (CORE_ADDR pc, asec
   if (overlay_debugging)
     if (section && section_is_overlay (section))
       {
-	size = bfd_get_section_size_before_reloc (section);
+	size = bfd_get_section_size (section);
 	if (section->lma <= pc && pc < section->lma + size)
 	  return 1;
       }
@@ -2916,7 +2916,7 @@ pc_in_mapped_range (CORE_ADDR pc, asecti
   if (overlay_debugging)
     if (section && section_is_overlay (section))
       {
-	size = bfd_get_section_size_before_reloc (section);
+	size = bfd_get_section_size (section);
 	if (section->vma <= pc && pc < section->vma + size)
 	  return 1;
       }
@@ -2932,9 +2932,9 @@ sections_overlap (asection *a, asection 
   /* FIXME: need bfd *, so we can use bfd_section_vma methods. */
 
   CORE_ADDR a_start = a->vma;
-  CORE_ADDR a_end = a->vma + bfd_get_section_size_before_reloc (a);
+  CORE_ADDR a_end = a->vma + bfd_get_section_size (a);
   CORE_ADDR b_start = b->vma;
-  CORE_ADDR b_end = b->vma + bfd_get_section_size_before_reloc (b);
+  CORE_ADDR b_end = b->vma + bfd_get_section_size (b);
 
   return (a_start < b_end && b_start < a_end);
 }
@@ -3069,7 +3069,7 @@ list_overlays_command (char *args, int f
 
 	vma = bfd_section_vma (objfile->obfd, osect->the_bfd_section);
 	lma = bfd_section_lma (objfile->obfd, osect->the_bfd_section);
-	size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+	size = bfd_get_section_size (osect->the_bfd_section);
 	name = bfd_section_name (objfile->obfd, osect->the_bfd_section);
 
 	printf_filtered ("Section %s, loaded at ", name);
@@ -3409,7 +3409,7 @@ simple_overlay_update_1 (struct obj_sect
   bfd *obfd = osect->objfile->obfd;
   asection *bsect = osect->the_bfd_section;
 
-  size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+  size = bfd_get_section_size (osect->the_bfd_section);
   for (i = 0; i < cache_novlys; i++)
     if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
 	&& cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
@@ -3470,7 +3470,7 @@ simple_overlay_update (struct obj_sectio
       bfd *obfd = osect->objfile->obfd;
       asection *bsect = osect->the_bfd_section;
 
-      size = bfd_get_section_size_before_reloc (osect->the_bfd_section);
+      size = bfd_get_section_size (bsect);
       for (i = 0; i < cache_novlys; i++)
 	if (cache_ovly_table[i][VMA] == bfd_section_vma (obfd, bsect)
 	    && cache_ovly_table[i][LMA] == bfd_section_lma (obfd, bsect)
Index: gdb/tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.60
diff -u -p -r1.60 tracepoint.c
--- gdb/tracepoint.c	13 May 2004 19:09:30 -0000	1.60
+++ gdb/tracepoint.c	12 Jun 2004 10:59:21 -0000
@@ -1693,7 +1693,7 @@ remote_set_transparent_ranges (void)
 
       anysecs = 1;
       lma = s->lma;
-      size = bfd_get_section_size_before_reloc (s);
+      size = bfd_get_section_size (s);
       sprintf_vma (tmp1, lma);
       sprintf_vma (tmp2, lma + size);
       sprintf (target_buf + strlen (target_buf), 
Index: gdb/win32-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/win32-nat.c,v
retrieving revision 1.89
diff -u -p -r1.89 win32-nat.c
--- gdb/win32-nat.c	25 May 2004 14:58:31 -0000	1.89
+++ gdb/win32-nat.c	12 Jun 2004 10:59:23 -0000
@@ -2340,20 +2340,20 @@ core_section_load_dll_symbols (bfd * abf
   if (strncmp (sect->name, ".module", 7))
     return;
 
-  buf = (char *) xmalloc (sect->_raw_size + 1);
+  buf = (char *) xmalloc (bfd_get_section_size (sect) + 1);
   if (!buf)
     {
       printf_unfiltered ("memory allocation failed for %s\n", sect->name);
       goto out;
     }
-  if (!bfd_get_section_contents (abfd, sect, buf, 0, sect->_raw_size))
+  if (!bfd_get_section_contents (abfd, sect, buf, 0, bfd_get_section_size (sect)))
     goto out;
 
   pstatus = (struct win32_pstatus *) buf;
 
   memmove (&base_addr, &(pstatus->data.module_info.base_address), sizeof (base_addr));
   dll_name_size = pstatus->data.module_info.module_name_size;
-  if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > sect->_raw_size)
+  if (offsetof (struct win32_pstatus, data.module_info.module_name) + dll_name_size > bfd_get_section_size (sect))
       goto out;
 
   dll_name = (char *) xmalloc (dll_name_size + 1);
Index: gdb/gdbtk/generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.80
diff -u -p -r1.80 gdbtk-cmds.c
--- gdb/gdbtk/generic/gdbtk-cmds.c	11 Jun 2004 18:49:38 -0000	1.80
+++ gdb/gdbtk/generic/gdbtk-cmds.c	12 Jun 2004 10:59:25 -0000
@@ -896,7 +896,7 @@ gdb_load_info (ClientData clientData, Tc
     {
       if (s->flags & SEC_LOAD)
 	{
-	  bfd_size_type size = bfd_get_section_size_before_reloc (s);
+	  bfd_size_type size = bfd_get_section_size (s);
 	  if (size > 0)
 	    {
 	      ob[0] = Tcl_NewStringObj ((char *)
Index: gprof/corefile.c
===================================================================
RCS file: /cvs/src/src/gprof/corefile.c,v
retrieving revision 1.18
diff -u -p -r1.18 corefile.c
--- gprof/corefile.c	26 May 2004 19:40:53 -0000	1.18
+++ gprof/corefile.c	12 Jun 2004 10:59:26 -0000
@@ -216,17 +216,17 @@ core_init (const char *aout_name)
 void
 core_get_text_space (bfd *cbfd)
 {
-  core_text_space = (PTR) malloc ((unsigned int) core_text_sect->_raw_size);
+  core_text_space = malloc (bfd_get_section_size (core_text_sect));
 
   if (!core_text_space)
     {
       fprintf (stderr, _("%s: ran out room for %lu bytes of text space\n"),
-	       whoami, (unsigned long) core_text_sect->_raw_size);
+	       whoami, (unsigned long) bfd_get_section_size (core_text_sect));
       done (1);
     }
 
   if (!bfd_get_section_contents (cbfd, core_text_sect, core_text_space,
-				 (bfd_vma) 0, core_text_sect->_raw_size))
+				 0, bfd_get_section_size (core_text_sect)))
     {
       bfd_perror ("bfd_get_section_contents");
       free (core_text_space);
@@ -613,7 +613,7 @@ core_create_line_syms ()
   ltab.len = 0;
   prev_line_num = 0;
 
-  vma_high = core_text_sect->vma + core_text_sect->_raw_size;
+  vma_high = core_text_sect->vma + bfd_get_section_size (core_text_sect);
   for (vma = core_text_sect->vma; vma < vma_high; vma += min_insn_size)
     {
       unsigned int len;
Index: gprof/symtab.c
===================================================================
RCS file: /cvs/src/src/gprof/symtab.c,v
retrieving revision 1.9
diff -u -p -r1.9 symtab.c
--- gprof/symtab.c	26 May 2004 04:55:55 -0000	1.9
+++ gprof/symtab.c	12 Jun 2004 10:59:26 -0000
@@ -148,7 +148,8 @@ symtab_finalize (Sym_Table *tab)
     }
 
   if (tab->len > 0 && dst[-1].end_addr == 0)
-    dst[-1].end_addr = core_text_sect->vma + core_text_sect->_raw_size - 1;
+    dst[-1].end_addr
+      = core_text_sect->vma + bfd_get_section_size (core_text_sect) - 1;
 
   DBG (AOUTDEBUG | IDDEBUG,
        printf ("[symtab_finalize]: removed %d duplicate entries\n",
Index: ld/ldwrite.c
===================================================================
RCS file: /cvs/src/src/ld/ldwrite.c,v
retrieving revision 1.16
diff -u -p -r1.16 ldwrite.c
--- ld/ldwrite.c	28 May 2004 10:34:18 -0000	1.16
+++ ld/ldwrite.c	12 Jun 2004 10:59:28 -0000
@@ -254,7 +254,7 @@ build_link_order (lang_statement_union_t
 	      if (i->_cooked_size)
 		link_order->size = i->_cooked_size;
 	      else
-		link_order->size = bfd_get_section_size_before_reloc (i);
+		link_order->size = bfd_get_section_size (i);
 	      link_order->offset = i->output_offset;
 	    }
 	}
Index: ld/pe-dll.c
===================================================================
RCS file: /cvs/src/src/ld/pe-dll.c,v
retrieving revision 1.69
diff -u -p -r1.69 pe-dll.c
--- ld/pe-dll.c	29 Apr 2004 13:05:49 -0000	1.69
+++ ld/pe-dll.c	12 Jun 2004 10:59:29 -0000
@@ -515,7 +515,7 @@ process_def_file (bfd *abfd ATTRIBUTE_UN
       s = bfd_get_section_by_name (b, ".drectve");
       if (s)
 	{
-	  int size = bfd_get_section_size_before_reloc (s);
+	  int size = bfd_get_section_size (s);
 	  char *buf = xmalloc (size);
 
 	  bfd_get_section_contents (b, s, buf, 0, size);
Index: opcodes/arc-ext.c
===================================================================
RCS file: /cvs/src/src/opcodes/arc-ext.c,v
retrieving revision 1.3
diff -u -p -r1.3 arc-ext.c
--- opcodes/arc-ext.c	31 Aug 2001 20:05:24 -0000	1.3
+++ opcodes/arc-ext.c	12 Jun 2004 10:59:36 -0000
@@ -248,7 +248,7 @@ build_ARC_extmap (text_bfd)
   for (p = text_bfd->sections; p != NULL; p = p->next)
     if (!strcmp (p->name, ".arcextmap"))
       {
-        count = p->_raw_size;
+        count = bfd_get_section_size (p);
         arcExtMap = (char *) xmalloc (count);
         if (bfd_get_section_contents (text_bfd, p, (PTR) arcExtMap, 0, count))
           {
Index: sim/common/sim-load.c
===================================================================
RCS file: /cvs/src/src/sim/common/sim-load.c,v
retrieving revision 1.6
diff -u -p -r1.6 sim-load.c
--- sim/common/sim-load.c	10 May 2004 16:18:03 -0000	1.6
+++ sim/common/sim-load.c	12 Jun 2004 10:59:41 -0000
@@ -112,7 +112,7 @@ sim_load_file (sd, myname, callback, pro
 	{
 	  bfd_size_type size;
 
-	  size = bfd_get_section_size_before_reloc (s);
+	  size = bfd_get_section_size (s);
 	  if (size > 0)
 	    {
 	      char *buffer;
Index: sim/m68hc11/interp.c
===================================================================
RCS file: /cvs/src/src/sim/m68hc11/interp.c,v
retrieving revision 1.16
diff -u -p -r1.16 interp.c
--- sim/m68hc11/interp.c	8 Aug 2003 20:42:21 -0000	1.16
+++ sim/m68hc11/interp.c	12 Jun 2004 10:59:42 -0000
@@ -386,7 +386,7 @@ sim_prepare_for_program (SIM_DESC sd, bf
             {
               bfd_size_type size;
 
-              size = bfd_get_section_size_before_reloc (s);
+              size = bfd_get_section_size (s);
               if (size > 0)
                 {
                   bfd_vma lma;
Index: sim/ppc/hw_htab.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/hw_htab.c,v
retrieving revision 1.3
diff -u -p -r1.3 hw_htab.c
--- sim/ppc/hw_htab.c	22 Jun 2003 13:03:40 -0000	1.3
+++ sim/ppc/hw_htab.c	12 Jun 2004 10:59:43 -0000
@@ -391,7 +391,7 @@ htab_sum_binary(bfd *abfd,
 		PTR data)
 {
   htab_binary_sizes *sizes = (htab_binary_sizes*)data;
-  unsigned_word size = bfd_get_section_size_before_reloc (sec);
+  unsigned_word size = bfd_get_section_size (sec);
   unsigned_word vma = bfd_get_section_vma (abfd, sec);
 #define bfd_get_section_lma(abfd, sec) ((sec)->lma + 0)
   unsigned_word ra = bfd_get_section_lma (abfd, sec);
@@ -437,7 +437,7 @@ htab_dma_binary(bfd *abfd,
     return;
 
   /* check/ignore any sections of size zero */
-  section_size = bfd_get_section_size_before_reloc(sec);
+  section_size = bfd_get_section_size (sec);
   if (section_size == 0)
     return;
 
Index: sim/ppc/hw_init.c
===================================================================
RCS file: /cvs/src/src/sim/ppc/hw_init.c,v
retrieving revision 1.3
diff -u -p -r1.3 hw_init.c
--- sim/ppc/hw_init.c	20 Jun 2003 13:32:34 -0000	1.3
+++ sim/ppc/hw_init.c	12 Jun 2004 10:59:43 -0000
@@ -329,7 +329,7 @@ update_for_binary_section(bfd *abfd,
     return;
 
   /* check/ignore any sections of size zero */
-  section_size = bfd_get_section_size_before_reloc(the_section);
+  section_size = bfd_get_section_size (the_section);
   if (section_size == 0)
     return;
 
Index: winsup/utils/dumper.cc
===================================================================
RCS file: /cvs/src/src/winsup/utils/dumper.cc,v
retrieving revision 1.10
diff -u -p -r1.10 dumper.cc
--- winsup/utils/dumper.cc	26 Apr 2003 21:52:03 -0000	1.10
+++ winsup/utils/dumper.cc	12 Jun 2004 10:59:47 -0000
@@ -689,7 +689,8 @@ dumper::prepare_core_dump ()
 	{
 	  if (!bfd_set_section_size (core_bfd,
 				     status_section,
-				     status_section->_raw_size + sect_size))
+				     (bfd_get_section_size (status_section)
+				      + sect_size)))
 	    {
 	      bfd_perror ("resizing status section");
 	      goto failed;
@@ -746,7 +747,7 @@ dumper::write_core_dump ()
       deb_printf ("writing section type=%u base=%08x size=%08x flags=%08x\n",
 		  p->type,
 		  p->section->vma,
-		  p->section->_raw_size,
+		  bfd_get_section_size (p->section),
 		  p->section->flags);
 
       switch (p->type)
Index: winsup/utils/parse_pe.cc
===================================================================
RCS file: /cvs/src/src/winsup/utils/parse_pe.cc,v
retrieving revision 1.5
diff -u -p -r1.5 parse_pe.cc
--- winsup/utils/parse_pe.cc	18 Sep 2003 01:46:18 -0000	1.5
+++ winsup/utils/parse_pe.cc	12 Jun 2004 10:59:47 -0000
@@ -64,10 +64,11 @@ select_data_section (bfd * abfd, asectio
   exclusion *excl_list = (exclusion *) obj;
 
   if ((sect->flags & (SEC_CODE | SEC_DEBUGGING)) &&
-      sect->vma && sect->_raw_size)
+      sect->vma && bfd_get_section_size (sect))
     {
-      excl_list->add ((LPBYTE) sect->vma, (DWORD) sect->_raw_size);
-      deb_printf ("excluding section: %20s %08lx\n", sect->name, sect->_raw_size);
+      excl_list->add ((LPBYTE) sect->vma, (DWORD) bfd_get_section_size (sect));
+      deb_printf ("excluding section: %20s %08lx\n", sect->name,
+		  bfd_get_section_size (sect));
     }
 }
 

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]