SORT_BY_ALIGNMENT alternative in ARM Compiler

Hi,

I need to sort address and size aligned symbols in the memory section by descending size using ARM Compiler scatter file.
In GNU toolchain this is easily achieved by using SORT_BY_ALIGNMENT keyword in the linker script.

In ARM compiler scatter file the memory section looks as below:

Fullscreen
1
2
3
4
SRAM_SORTED +0 ALIGN 0x1000 UNINIT
{
*(.bss.*sorted_*)
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

In armlink user guide there are options like --any_sort_order and SORTTYPE, which do not produce descending size sorting for the section though.

Please, suggest what should be the configuration for the linker to produce the needed result?

Parents Reply Children
  • Hi Kevin,
    Thanks for the suggestion.
    First option is to find a solution for the ARM Compiler toolchain, as the migration of the existing projects is quite a process.

  • Hi,

    I have further Investigated padding issue for the RTOS task's stack section, when attribute aligned is used for the stack objects.

    To remove padding, sort by alignment algorithm should be used for the memory section (works in GNU and LLVM linker). 
    Arm Compiler for Embedded 6.23 doesn't produce efficient sort by alignment output for the section.
    Testing different linker flags and scatter file configuration shows that the symbol sorting feature is malfunctioning:
    • Using symbol wildcard approach always produces lexical sorting
    • Using attribute section produces symbol alignment dependent sorting:
      • If max alignment size is less or equal 256 bytes the section is alignment sorted
      • If max alignment size is greater 256 bytes the section is cmdline sorted

    Is it planned to remove the max limit for the alignment (e.g. allow 8KB alignment in sorting algorithm) and fix this in the upcoming Arm Compiler release?

0