This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Re: Fix elflink crash with both rel and rela sections


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


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