summaryrefslogtreecommitdiff
path: root/binutils/nlmconv.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-06-15 01:19:13 +0000
committerAlan Modra <amodra@bigpond.net.au>2004-06-15 01:19:13 +0000
commit9e236ad389c6b1a2cc2f65702e5c811fcd054e1e (patch)
tree507d1068b38372a28d0444b10b86923869c5747c /binutils/nlmconv.c
parente8b544b6eaa2cf55ab4a0ad3c89a676fd02e0be7 (diff)
downloadbinutils-redhat-9e236ad389c6b1a2cc2f65702e5c811fcd054e1e.tar.gz
* 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.
Diffstat (limited to 'binutils/nlmconv.c')
-rw-r--r--binutils/nlmconv.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/binutils/nlmconv.c b/binutils/nlmconv.c
index 5a644e4466..cb167b76e4 100644
--- a/binutils/nlmconv.c
+++ b/binutils/nlmconv.c
@@ -1,6 +1,6 @@
/* 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.
@@ -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 *insec, void *data_ptr)
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, asection *insec,
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;