This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: arm-elf-ld 2.16.1 crash at bfd/elf32-arm.c:5536
- From: Paul Brook <paul at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Cc: Nick Clifton <nickc at redhat dot com>,Shaun Jackman <sjackman at gmail dot com>
- Date: Fri, 5 Aug 2005 23:02:58 +0100
- Subject: Re: arm-elf-ld 2.16.1 crash at bfd/elf32-arm.c:5536
- References: <7f45d939050728162929bb9286@mail.gmail.com> <7f45d93905080113386f325997@mail.gmail.com> <42EF2DE5.6020105@redhat.com>
On Tuesday 02 August 2005 09:25, Nick Clifton wrote:
> Hi Shaun,
>
> >> 2. Please could you create a bugzilla entry for this so that we have
> >> somewhere to record this bug, how to reproduce it and how it was fixed.
> >
> > http://sourceware.org/bugzilla/show_bug.cgi?id=1147
>
> Thanks - I have added the patch to this PR and then closed it as FIXED.
> I have also checked in the patch.
This has broken arm-unknown-eabi-ar.
What appears to be happening is that ar.c:open_inarch is calling
bfd_openr/bfd_check_format which indirectly calls
record_section_with_arm_elf_section_data
It then calls bfd_close, which frees the memory allocated for
sections_with_arm_elf_section_data without calling
unrecord_section_with_arm_elf_section_data.
This then segfaults on a later call torecord_section_with_arm_elf_section_data
because sections_with_arm_elf_section_data point to memory that no longer
exists.
This occurred when building libstdc++.
To reproduce:
$ rm -f libtest.a
$ arm-unknown-eabi-ar cru libtest.s test1.o
Segmentation fault
You can fetch test1.o from https://nowt.dyndns.org/test1.o.bz2
Paul