Skip to content

Commit 3a6bdf0

Browse files
Grommerinpennam
authored andcommitted
scripts: gen_relocate_app.py: add quotes around section names in templates
Section names may contain paths to files with special characters. For example, a valid file path might contain '@'. Then using CONFIG_CODE_DATA_RELOCATION to relocate section, macro __in_section_unique() will generate section name like this: KEEP(*file.c.obj(.noinit.WEST_TOPDIR/path_with@char/file.c.0)) Such section names cannot be processed by ld because '@' is a special character for ld. This fix wraps section names in double quotes to escape special characters for ld. Signed-off-by: Nikita Divakov <grommerin@gmail.com>
1 parent 99219ce commit 3a6bdf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/build/gen_relocate_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ class OutputSection(NamedTuple):
101101

102102

103103
PRINT_TEMPLATE = """
104-
KEEP(*{obj_file_name}({section_name}))
104+
KEEP(*{obj_file_name}("{section_name}"))
105105
"""
106106

107107
PRINT_TEMPLATE_NOKEEP = """
108-
*{obj_file_name}({section_name})
108+
*{obj_file_name}("{section_name}")
109109
"""
110110

111111
SECTION_LOAD_MEMORY_SEQ = """

0 commit comments

Comments
 (0)