arm-elf-ld 2.16.1 crash at bfd/elf32-arm.c:5536

Paul Brook paul@codesourcery.com
Fri Aug 5 22:03:00 GMT 2005


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



More information about the Binutils mailing list