fix(cmakev2): add --cref with MAPFILE_TARGET and remove global -Wl,--cref

When MAPFILE_TARGET is used in idf_build_executable, add the linker
--cref option so the cross-reference table is written to the map file
instead of stdout. Remove the global -Wl,--cref from default link
options in project.cmake so cref is only applied where a map file
is requested.
This commit is contained in:
Sudeep Mohanty
2026-03-20 08:13:26 +01:00
committed by Frantisek Hrbata
parent fb38cbc990
commit c4fcce84cc
2 changed files with 2 additions and 2 deletions
-2
View File
@@ -419,8 +419,6 @@ function(__init_project_configuration)
if("${linker_type}" STREQUAL "GNU")
set(target_upper "${idf_target}")
string(TOUPPER ${target_upper} target_upper)
# Add cross-reference table to the map file
list(APPEND link_options "-Wl,--cref")
# Add this symbol as a hint for esp_idf_size to guess the target name
list(APPEND link_options "-Wl,--defsym=IDF_TARGET_${target_upper}=0")
# Check if linker supports --no-warn-rwx-segments