Skip to main content
Yannek
Associate III
January 11, 2020
Solved

Why default alignment of functions in SPC5Studio projects is 16 bytes?

  • January 11, 2020
  • 3 replies
  • 1214 views

Default linker script created with new SPC5Studio project (SPC560BCxxx in my case) aligns code on 16-byte boundary.

This is a part of default linker script (application.ld/user.ld):

 .text_vle : ALIGN(16) SUBALIGN(16)
 {
 *(.text_vle)
 *(.text_vle.*)
 *(.gnu.linkonce.t_vle.*)
 *(.vletext)
 "*(.vletext.*)"
 "*(.ghs.linkonce.t_vle.*)"
 } > flash
 
 .text : ALIGN(16) SUBALIGN(16)
 {
 *(.text)
 *(.text.*)
 *(.gnu.linkonce.t.*)
 } > flash
 
 .rodata : ALIGN(16) SUBALIGN(16)
 {
 *(.glue_7t)
 *(.glue_7)
 *(.gcc*)
 *(.rodata)
 *(.rodata.*)
 *(.rodata1)
 } > flash

Are there any contraindications to change alignment to 4-byte based?

Since my program contains a lot of tiny functions, I waste a lot of memory space between these functions.

    This topic has been closed for replies.
    Best answer by Giuseppe DI-GIORE

    ​Hello,

    there is no issue to align text sections to 4bytes boundary.

    Actually the code in SPC5Studio shall be updated to reflect this.

    Regards,

    Giuseppe

    3 replies

    Erwan YVIN
    ST Employee
    January 14, 2020

    Hello ,

    I do not see no issue by updating the alignment in 4-bytes in e200z0.pdf and BookE

    Anyway , i am checking with experts.

    The ticket is Submitted

    Best regards

    Erwan

    Giuseppe DI-GIORE
    ST Employee
    February 3, 2020

    ​Hello,

    there is no issue to align text sections to 4bytes boundary.

    Actually the code in SPC5Studio shall be updated to reflect this.

    Regards,

    Giuseppe

    Yannek
    YannekAuthor
    Associate III
    February 4, 2020

    Thank you, Giuseppe