_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.
+2004-06-15 Alan Modra <amodra@bigpond.net.au>
+
+ * 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.
+
2004-05-28 Ian Lance Taylor <ian@wasabisystems.com>
* readelf.c (decode_ARM_machine_flags): Add EF_ARM_VFP_FLOAT.
/* addr2line.c -- convert addresses to line number and function name
- Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
Contributed by Ulrich Lauther <Ulrich.Lauther@mchp.siemens.de>
if (pc < vma)
return;
- size = bfd_get_section_size_before_reloc (section);
+ size = bfd_get_section_size (section);
if (pc >= vma + size)
return;
/* coffgrok.c
- Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003
+ Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GNU Binutils.
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 =
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);
/* nlmconv.c -- NLM conversion program
- Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+ 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Binutils.
{
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;
{
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"));
}
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)
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
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;
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;
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;
}
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)
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;
if (! process_section_p (section))
return;
- datasize = bfd_get_section_size_before_reloc (section);
+ datasize = bfd_get_section_size (section);
if (datasize == 0)
return;
/* prdbg.c -- Print out generic debugging information.
- Copyright 1995, 1996, 2002, 2003 Free Software Foundation, Inc.
+ Copyright 1995, 1996, 2002, 2003, 2004 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@cygnus.com>.
Tags style generation written by Salvador E. Tropea <set@computer.org>.
if (pc < vma)
return;
- size = bfd_get_section_size_before_reloc (section);
+ size = bfd_get_section_size (section);
if (pc >= vma + size)
return;
/* size.c -- report size of various sections of an executable file.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003 Free Software Foundation, Inc.
+ 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Binutils.
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)
/* srconv.c -- Sysroff conversion program
- Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003
+ Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GNU Binutils.
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)
{
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))