From: Alan Modra Date: Wed, 23 Jul 2025 12:22:31 +0000 (+0930) Subject: PR 33197 [AVR] Incorrect syntax in generated ldscript X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae114fb523efe908f9e807359e2f494ee64d2801;p=thirdparty%2Fbinutils-gdb.git PR 33197 [AVR] Incorrect syntax in generated ldscript Rearrange scripttempl/avr.sc to avoid oddities of shells expanding ${RELOCATING+stuff} in here documents where "stuff" contains quoted strings. Also I think it is better to avoid multi-line "stuff" as it can be tricky to spot the ending brace. --- diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc index 4d9af7fcf2c..a902385a013 100644 --- a/ld/scripttempl/avr.sc +++ b/ld/scripttempl/avr.sc @@ -186,7 +186,9 @@ SECTIONS /* Internal text space or external memory. */ .text ${RELOCATING-0} : { - ${RELOCATING+*(.vectors) +EOF +test -z "${RELOCATING}" || cat <> 15); __RODATA_FLASH_START__ = __flmap << 15; __rodata_load_start = MAX (__data_load_end, __RODATA_FLASH_START__); -__rodata_start = __RODATA_ORIGIN__ + __rodata_load_start - __RODATA_FLASH_START__;} - +__rodata_start = __RODATA_ORIGIN__ + __rodata_load_start - __RODATA_FLASH_START__; +EOF +cat << EOF .rodata ${RELOCATING+ __rodata_start} ${RELOCATING-0} : ${RELOCATING+ AT (__rodata_load_start)} { *(.rodata)