[PATCH, binutils/ARM] Fix ld --gc-section segfault with ARMv8-M Security Extensions entry function in absolute section

Thomas Preudhomme thomas.preudhomme@foss.arm.com
Tue Sep 6 13:50:00 GMT 2016


Hi,

As per the title, ld crashes when linking an object file with an ARMv8-M 
Security Extensions entry function that is placed in the absolute section. The 
reason for the crash is that elf32_arm_gc_mark_extra_sections marks section with 
an entry function unconditionally. This fails with the absolute section since 
the marking function check for information about other sections in the same 
group which does not exist for the absolute section. The patch is simple: only 
mark a section if not already mark, as done elsewhere in bfd.

A testcase is added and fails without the code change and succeeds with.

ChangeLog entries are as follow:

*** bfd/ChangeLog ***

2016-09-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>

         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Only mark section
         not already marked.


*** ld/ChangeLog ***

2016-09-02  Thomas Preud'homme  <thomas.preudhomme@arm.com>

         * testsuite/ld-arm/cmse-veneers.s: Add a test for ARMv8-M Security
         Extensions entry functions in absolute section.
         * testsuite/ld-arm/cmse-veneers.rd: Adapt expected output accordingly.


Regression testsuite when run for arm-none-eabi shows no regression.

Is this ok for the master branch?

Best regards,

Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_ld_gc_absolute_se_crash.patch
Type: text/x-patch
Size: 1814 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160906/6bc2b9dd/attachment.bin>


More information about the Binutils mailing list