Browse Source

iar: linker_script: fix bug with alphabetical order

Having alphabetical order on an init block causes a linker error.
So it is one of the things replaced when translating a block to its
corresponding init block.
The recent changes in ff8b24b6bd caused
iterable sections having ONLY alphabetical order as an attribute,
triggering a bug in this regexp.

Signed-off-by: Robin Kastberg <robin.kastberg@iar.com>
pull/91677/head
Robin Kastberg 3 weeks ago committed by Dan Kalowsky
parent
commit
e572e8f491
  1. 7
      cmake/linker/iar/config_file_script.cmake

7
cmake/linker/iar/config_file_script.cmake

@ -832,7 +832,12 @@ function(section_to_string) @@ -832,7 +832,12 @@ function(section_to_string)
string(REGEX REPLACE "(block[ \t\r\n]+)([^ \t\r\n]+)" "\\1\\2_init" INIT_TEMP "${TEMP}")
string(REGEX REPLACE "(rw)([ \t\r\n]+)(section[ \t\r\n]+)([^ \t\r\n,]+)" "\\1\\2\\3\\4_init" INIT_TEMP "${INIT_TEMP}")
string(REGEX REPLACE "(rw)([ \t\r\n]+)(section[ \t\r\n]+)" "ro\\2\\3" INIT_TEMP "${INIT_TEMP}")
string(REGEX REPLACE "alphabetical order, " "" INIT_TEMP "${INIT_TEMP}")
# No alphabetical orders on initializers
# Only alphabetical attribute.
string(REGEX REPLACE "with alphabetical order {" " {" INIT_TEMP "${INIT_TEMP}")
# Respect other attributes.
string(REGEX REPLACE "(, alphabetical order|alphabetical order, )" "" INIT_TEMP "${INIT_TEMP}")
string(REGEX REPLACE "{ readwrite }" "{ }" INIT_TEMP "${INIT_TEMP}")
set(TEMP "${TEMP}\n${INIT_TEMP}\n")

Loading…
Cancel
Save