This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix elflink crash with both rel and rela sections
- From: Alan Modra <amodra at gmail dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 9 Sep 2010 11:49:16 +0930
- Subject: Re: Fix elflink crash with both rel and rela sections
- References: <4C881A40.4050509@codesourcery.com>
On Thu, Sep 09, 2010 at 01:20:32AM +0200, Bernd Schmidt wrote:
> * elflink.c (bfd_elf_final_link): Correct calculation of
> max_external_reloc_size.
OK.
> Index: bfd/elflink.c
> ===================================================================
> --- bfd/elflink.c (revision 297792)
> +++ bfd/elflink.c (working copy)
> @@ -10190,6 +10190,9 @@ bfd_elf_final_link (bfd *abfd, struct bf
> size_t ext_size;
>
> ext_size = elf_section_data (sec)->rel_hdr.sh_size;
While you're at it, you may as well tidy the above line to use esdi
too.
> + if (esdi->rel_hdr2 != NULL)
> + ext_size += esdi->rel_hdr2->sh_size;
> +
> if (ext_size > max_external_reloc_size)
> max_external_reloc_size = ext_size;
> if (sec->reloc_count > max_internal_reloc_count)
--
Alan Modra
Australia Development Lab, IBM