cmake: save eh_frame section in output with CONFIG_EXCEPTIONS.
.eh_frame section should not be removed directly in the hex format and bin format output, it should be based on whether we need exception handler feature. Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
This commit is contained in:
parent
ac079fcba6
commit
8c069c365d
|
@ -1417,6 +1417,17 @@ if(CONFIG_BUILD_OUTPUT_ADJUST_LMA)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT CONFIG_EXCEPTIONS)
|
||||||
|
set(eh_frame_section ".eh_frame")
|
||||||
|
else()
|
||||||
|
set(eh_frame_section "")
|
||||||
|
endif()
|
||||||
|
set(remove_sections_argument_list "")
|
||||||
|
foreach(section .comment COMMON ${eh_frame_section})
|
||||||
|
list(APPEND remove_sections_argument_list
|
||||||
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_section_remove>${section})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
if(CONFIG_BUILD_OUTPUT_HEX OR BOARD_FLASH_RUNNER STREQUAL openocd)
|
if(CONFIG_BUILD_OUTPUT_HEX OR BOARD_FLASH_RUNNER STREQUAL openocd)
|
||||||
get_property(elfconvert_formats TARGET bintools PROPERTY elfconvert_formats)
|
get_property(elfconvert_formats TARGET bintools PROPERTY elfconvert_formats)
|
||||||
if(ihex IN_LIST elfconvert_formats)
|
if(ihex IN_LIST elfconvert_formats)
|
||||||
|
@ -1426,9 +1437,7 @@ if(CONFIG_BUILD_OUTPUT_HEX OR BOARD_FLASH_RUNNER STREQUAL openocd)
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag>
|
$<TARGET_PROPERTY:bintools,elfconvert_flag>
|
||||||
${GAP_FILL}
|
${GAP_FILL}
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_outtarget>ihex
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_outtarget>ihex
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_section_remove>.comment
|
${remove_sections_argument_list}
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_section_remove>COMMON
|
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_section_remove>.eh_frame
|
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_infile>${KERNEL_ELF_NAME}
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_infile>${KERNEL_ELF_NAME}
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_outfile>${KERNEL_HEX_NAME}
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_outfile>${KERNEL_HEX_NAME}
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_final>
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_final>
|
||||||
|
@ -1450,9 +1459,7 @@ if(CONFIG_BUILD_OUTPUT_BIN)
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag>
|
$<TARGET_PROPERTY:bintools,elfconvert_flag>
|
||||||
${GAP_FILL}
|
${GAP_FILL}
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_outtarget>binary
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_outtarget>binary
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_section_remove>.comment
|
${remove_sections_argument_list}
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_section_remove>COMMON
|
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_section_remove>.eh_frame
|
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_infile>${KERNEL_ELF_NAME}
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_infile>${KERNEL_ELF_NAME}
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_outfile>${KERNEL_BIN_NAME}
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_outfile>${KERNEL_BIN_NAME}
|
||||||
$<TARGET_PROPERTY:bintools,elfconvert_flag_final>
|
$<TARGET_PROPERTY:bintools,elfconvert_flag_final>
|
||||||
|
|
Loading…
Reference in a new issue