cancel
Showing results for 
Search instead for 
Did you mean: 

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

Yannek
Associate III

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 discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Giuseppe DI-GIORE
ST Employee

​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

View solution in original post

3 REPLIES 3
Erwan YVIN
ST Employee

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

​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
Associate III

Thank you, Giuseppe