2019-04-25 21:46:11 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
# See root CMakeLists.txt for description and expectations of these macros
|
|
|
|
|
|
|
|
macro(toolchain_ld_base)
|
|
|
|
|
|
|
|
# TOOLCHAIN_LD_FLAGS comes from compiler/gcc/target.cmake
|
2019-04-25 22:36:43 +08:00
|
|
|
# LINKERFLAGPREFIX comes from linker/ld/target.cmake
|
2019-04-25 21:46:11 +08:00
|
|
|
zephyr_ld_options(
|
|
|
|
${TOOLCHAIN_LD_FLAGS}
|
2019-04-25 22:36:43 +08:00
|
|
|
${LINKERFLAGPREFIX},--gc-sections
|
|
|
|
${LINKERFLAGPREFIX},--build-id=none
|
2019-04-25 21:46:11 +08:00
|
|
|
)
|
|
|
|
|
2019-04-25 22:52:23 +08:00
|
|
|
# Sort the common symbols and each input section by alignment
|
|
|
|
# in descending order to minimize padding between these symbols.
|
|
|
|
zephyr_ld_option_ifdef(
|
|
|
|
CONFIG_LINKER_SORT_BY_ALIGNMENT
|
|
|
|
${LINKERFLAGPREFIX},--sort-common=descending
|
|
|
|
${LINKERFLAGPREFIX},--sort-section=alignment
|
|
|
|
)
|
|
|
|
|
2019-04-25 21:46:11 +08:00
|
|
|
endmacro()
|