linker: sort sections by alignment

This turns on the linker flag to sort sections by alignment
in decreasing size of symbols. This helps to minimize
padding between symbols.

This also adds the linker options to sort common symbols by
alignment in descending to minimize the need for padding.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2019-03-09 00:58:57 -08:00 committed by Kumar Gala
parent 8328d6df76
commit af10d16a08

View file

@ -384,6 +384,13 @@ zephyr_ld_options(
${LINKERFLAGPREFIX},--build-id=none
)
# Sort the common symbols and each input section by alignment
# in descending order to minimize padding between these symbols.
zephyr_ld_options(
${LINKERFLAGPREFIX},--sort-common=descending
${LINKERFLAGPREFIX},--sort-section=alignment
)
get_property(TOPT GLOBAL PROPERTY TOPT)
set_ifndef( TOPT -T)