cmake: bintools: add --strip-unneeded flag to elfconvert

This flag is used by LLEXT to strip all unreferenced symbols and
debugging information from a binary.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This commit is contained in:
Luca Burelli 2025-01-14 17:08:39 +01:00 committed by Benjamin Cabé
commit dda8d776ab
3 changed files with 7 additions and 0 deletions

View file

@ -66,6 +66,7 @@
# elfconvert_flag_final : Flags that must always be applied last at the elfconvert command # elfconvert_flag_final : Flags that must always be applied last at the elfconvert command
# elfconvert_flag_strip_all : Flag that is used for stripping all symbols when converting # elfconvert_flag_strip_all : Flag that is used for stripping all symbols when converting
# elfconvert_flag_strip_debug : Flag that is used to strip debug symbols when converting # elfconvert_flag_strip_debug : Flag that is used to strip debug symbols when converting
# elfconvert_flag_strip_unneeded: Flag that is used to strip all unreferenced symbols when converting
# elfconvert_flag_compress_debug_sections: Flag that is used to compress debug sections when converting # elfconvert_flag_compress_debug_sections: Flag that is used to compress debug sections when converting
# elfconvert_flag_intarget : Flag for specifying target used for infile # elfconvert_flag_intarget : Flag for specifying target used for infile
# elfconvert_flag_outtarget : Flag for specifying target to use for converted file. # elfconvert_flag_outtarget : Flag for specifying target to use for converted file.
@ -142,6 +143,8 @@ set_property(TARGET bintools PROPERTY elfconvert_command ${CMAKE_COMMAND} -E ech
set_property(TARGET bintools PROPERTY elfconvert_formats "") set_property(TARGET bintools PROPERTY elfconvert_formats "")
set_property(TARGET bintools PROPERTY elfconvert_flag "") set_property(TARGET bintools PROPERTY elfconvert_flag "")
set_property(TARGET bintools PROPERTY elfconvert_flag_final "") set_property(TARGET bintools PROPERTY elfconvert_flag_final "")
set_property(TARGET bintools PROPERTY elfconvert_flag_strip_debug "")
set_property(TARGET bintools PROPERTY elfconvert_flag_strip_unneeded "")
set_property(TARGET bintools PROPERTY elfconvert_flag_compress_debug_sections "") set_property(TARGET bintools PROPERTY elfconvert_flag_compress_debug_sections "")
set_property(TARGET bintools PROPERTY elfconvert_flag_outtarget "") set_property(TARGET bintools PROPERTY elfconvert_flag_outtarget "")
set_property(TARGET bintools PROPERTY elfconvert_flag_section_remove "") set_property(TARGET bintools PROPERTY elfconvert_flag_section_remove "")

View file

@ -7,6 +7,7 @@
# elfconvert_flag_final : empty # elfconvert_flag_final : empty
# elfconvert_flag_strip_all : -S # elfconvert_flag_strip_all : -S
# elfconvert_flag_strip_debug : -g # elfconvert_flag_strip_debug : -g
# elfconvert_flag_strip_unneeded: --strip-unneeded
# elfconvert_flag_compress_debug_sections: --compress-debug-sections # elfconvert_flag_compress_debug_sections: --compress-debug-sections
# elfconvert_flag_intarget : --input-target= # elfconvert_flag_intarget : --input-target=
# elfconvert_flag_outtarget : --output-target= # elfconvert_flag_outtarget : --output-target=
@ -34,6 +35,7 @@ set_property(TARGET bintools PROPERTY elfconvert_flag_final "")
set_property(TARGET bintools PROPERTY elfconvert_flag_strip_all "-S") set_property(TARGET bintools PROPERTY elfconvert_flag_strip_all "-S")
set_property(TARGET bintools PROPERTY elfconvert_flag_strip_debug "-g") set_property(TARGET bintools PROPERTY elfconvert_flag_strip_debug "-g")
set_property(TARGET bintools PROPERTY elfconvert_flag_strip_unneeded "--strip-unneeded")
set_property(TARGET bintools PROPERTY elfconvert_flag_compress_debug_sections "--compress-debug-sections") set_property(TARGET bintools PROPERTY elfconvert_flag_compress_debug_sections "--compress-debug-sections")

View file

@ -7,6 +7,7 @@
# elfconvert_flag_final : empty # elfconvert_flag_final : empty
# elfconvert_flag_strip_all : -S # elfconvert_flag_strip_all : -S
# elfconvert_flag_strip_debug : -g # elfconvert_flag_strip_debug : -g
# elfconvert_flag_strip_unneeded: --strip-unneeded
# elfconvert_flag_compress_debug_sections: --compress-debug-sections # elfconvert_flag_compress_debug_sections: --compress-debug-sections
# elfconvert_flag_intarget : --input-target= # elfconvert_flag_intarget : --input-target=
# elfconvert_flag_outtarget : --output-target= # elfconvert_flag_outtarget : --output-target=
@ -34,6 +35,7 @@ set_property(TARGET bintools PROPERTY elfconvert_flag_final "")
set_property(TARGET bintools PROPERTY elfconvert_flag_strip_all "-S") set_property(TARGET bintools PROPERTY elfconvert_flag_strip_all "-S")
set_property(TARGET bintools PROPERTY elfconvert_flag_strip_debug "-g") set_property(TARGET bintools PROPERTY elfconvert_flag_strip_debug "-g")
set_property(TARGET bintools PROPERTY elfconvert_flag_strip_unneeded "--strip-unneeded")
set_property(TARGET bintools PROPERTY elfconvert_flag_compress_debug_sections "--compress-debug-sections") set_property(TARGET bintools PROPERTY elfconvert_flag_compress_debug_sections "--compress-debug-sections")