summaryrefslogtreecommitdiff
path: root/bfd/simple.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2004-06-29 14:13:44 +0000
committerAlan Modra <amodra@bigpond.net.au>2004-06-29 14:13:44 +0000
commit18e6a6626813ba2d59e733f1b52e77f6a1481c7b (patch)
treeba1da5cec9521f7b9aeadbabf6b074fbeefc1e3a /bfd/simple.c
parent087daec5b3ec460180f18664633ce09b94fc4983 (diff)
downloadgdb-18e6a6626813ba2d59e733f1b52e77f6a1481c7b.tar.gz
bfd/
* elf64-mmix.c (mmix_set_relaxable_size): Save original size in rawsize. (mmix_elf_perform_relocation): Adjust for above change. (mmix_elf_relocate_section): Likewise. (mmix_elf_relax_section): Likewise. Use output_section->rawsize. (mmix_elf_get_section_contents): Delete. (bfd_elf64_get_section_contents): Delete. (mmix_elf_relocate_section): Zero stub area. * linker.c (default_indirect_link_order): Alloc max of section size and rawsize. * simple.c (bfd_simple_get_relocated_section_contents): Likewise. * section.c (bfd_malloc_and_get_section): Likewise. (struct bfd_section): Update rawsize comment. * bfd-in2.h: Regenerate. ld/ * ldlang.c (lang_reset_memory_regions): Save last relax pass section size in rawsize.
Diffstat (limited to 'bfd/simple.c')
-rw-r--r--bfd/simple.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/simple.c b/bfd/simple.c
index 0744215d24d..5039911dcfd 100644
--- a/bfd/simple.c
+++ b/bfd/simple.c
@@ -143,10 +143,11 @@ bfd_simple_get_relocated_section_contents (bfd *abfd,
if (! (sec->flags & SEC_RELOC))
{
+ bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size;
bfd_size_type size = sec->rawsize ? sec->rawsize : sec->size;
if (outbuf == NULL)
- contents = bfd_malloc (size);
+ contents = bfd_malloc (amt);
else
contents = outbuf;