gcc.ld does not align .data correctly

Bug #1566385 reported by Thomas Preud'homme
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Fix Released
High
Thomas Preud'homme

Bug Description

David Robinson reported that gcc.ld as provided in samples/ldscripts does not align the .data section correctly. Indeed, it is assumed by samples/startup/startup_ARMCM0 .s that this section is 4byte aligned. However, the .text section can contain narrow Thumb instructions and thus is only guaranteed to be 4byte aligned.

David proposed the following modification:

                } > FLASH
                */

++ . = ALIGN(4);
                __etext = .;

                .data : AT (__etext)
                {

which fixes the problem for him. Attached file show the difference between a version with and without that patch applied.

Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :
Changed in gcc-arm-embedded:
status: Confirmed → In Progress
Revision history for this message
Thomas Preud'homme (thomas-preudhomme) wrote :

The fix has been committed for the next update release.

Changed in gcc-arm-embedded:
status: In Progress → Fix Committed
Changed in gcc-arm-embedded:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.