This is the mail archive of the binutils@sources.redhat.com 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: [PATCH] Fix for "ld -r" crash in mingw32


On Thu, Oct 16, 2003 at 10:02:36PM -0400, Pavel Roskin wrote:
>Hello!
>
>This patch fixes segmentation fault in mingw32 linker when it tries to
>combine multiple object files into one.  Function
>_bfd_XXi_swap_aouthdr_out() calculates the total virtual size by adding
>virtual size of sections.  However, some sections don't provide this
>information and should not be counted.
>
>There are many other examples in the same file peXXigen.c, when
>coff_section_data and pei_section_data are checked for being not NULL
>before the virt_size field is accessed.  See functions add_data_entry(),
>pe_print_pdata(), _bfd_XX_bfd_copy_private_section_data() in the same
>file.
>
>I tried to be consistent with the existing code style.  The code has been
>tested with problematic object files.  The problematic object file can be
>found here: http://www.red-bean.com/~proski/tmp/crt2.o
>
>To test, run "ld -r -o out.o crt2.o" - it crashes without the patch.
>
>Description of the problem can be found here:
>http://sources.redhat.com/ml/binutils/2003-10/msg00189.html
>
>The patch is against the head version in CVS.  I checked the sources and
>I'm quite confident that the patch is correct.  Please review and apply.

Thanks for the patch and the supporting information which made it
easy to review.  I've checked this in.  I created a ChangeLog for
it as well.  Next time maybe you could provide that as well?

Not that I'm complaining.  Other than that this was an excellent patch
submission.

cgf


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