diff options
Diffstat (limited to 'ld/scripttempl/elf32xc16x.sc')
-rw-r--r-- | ld/scripttempl/elf32xc16x.sc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ld/scripttempl/elf32xc16x.sc b/ld/scripttempl/elf32xc16x.sc index 3a2c7b5..4c7cc36 100644 --- a/ld/scripttempl/elf32xc16x.sc +++ b/ld/scripttempl/elf32xc16x.sc @@ -13,7 +13,10 @@ cat <<EOF OUTPUT_FORMAT("${OUTPUT_FORMAT}") OUTPUT_ARCH(${ARCH}) -${RELOCATING+ENTRY ("_start")} +EOF + +test -n "${RELOCATING}" && cat <<EOF +ENTRY ("_start") MEMORY { @@ -28,6 +31,9 @@ MEMORY ldata : o =0x4000 ,l = 0x0200 } +ELF + +cat <<EOF SECTIONS { .init : @@ -37,15 +43,15 @@ SECTIONS .text : { - *(.rodata) - *(.text.*) + ${RELOCATING+*(.rodata)} + ${RELOCATING+*(.text.*)} *(.text) ${RELOCATING+ _etext = . ; } } ${RELOCATING+ > introm} .data : { *(.data) - *(.data.*) + ${RELOCATING+*(.data.*)} ${RELOCATING+ _edata = . ; } } ${RELOCATING+ > dram} @@ -54,7 +60,7 @@ SECTIONS { ${RELOCATING+ _bss_start = . ;} *(.bss) - *(COMMON) + ${RELOCATING+*(COMMON)} ${RELOCATING+ _end = . ; } } ${RELOCATING+ > dram} |