diff --git a/cmake/modules/extensions.cmake b/cmake/modules/extensions.cmake index 6df0ef51f67..22e72ff6356 100644 --- a/cmake/modules/extensions.cmake +++ b/cmake/modules/extensions.cmake @@ -1522,7 +1522,7 @@ function(zephyr_code_relocate) if(CODE_REL_PHDR) set(CODE_REL_LOCATION "${CODE_REL_LOCATION}\ :${CODE_REL_PHDR}") endif() - # We use the "|" character to separate code relocation directives, instead of + # Each code relocation directive is placed on an independent line, instead of # using set_property(APPEND) to produce a ";"-separated CMake list. This way, # each directive can embed multiple CMake lists, representing flags and files, # the latter of which can come from generator expressions. @@ -1530,7 +1530,7 @@ function(zephyr_code_relocate) PROPERTY INTERFACE_SOURCES) set_property(TARGET code_data_relocation_target PROPERTY INTERFACE_SOURCES - "${code_rel_str}|${CODE_REL_LOCATION}:${flag_list}:${file_list}") + "${code_rel_str}\n${CODE_REL_LOCATION}:${flag_list}:${file_list}") endfunction() # Usage: diff --git a/scripts/build/gen_relocate_app.py b/scripts/build/gen_relocate_app.py index f1bcccf1df6..95cb0e557b9 100755 --- a/scripts/build/gen_relocate_app.py +++ b/scripts/build/gen_relocate_app.py @@ -526,10 +526,10 @@ def create_dict_wrt_mem(): rel_dict = dict() phdrs = dict() - input_rel_dict = args.input_rel_dict.read() - if input_rel_dict == '': + input_rel_dict = args.input_rel_dict.read().splitlines() + if not input_rel_dict: sys.exit("Disable CONFIG_CODE_DATA_RELOCATION if no file needs relocation") - for line in input_rel_dict.split('|'): + for line in input_rel_dict: if ':' not in line: continue