cat < imem} .data ${RELOCATING-0} : { /* Optional variable that user is prepared to have NULL address. */ ${RELOCATING+ *(.data.atzero*)} /* CRT is prepared for constructor/destructor table to have a "valid" NULL address. */ ${CONSTRUCTING+ __init_array_start = . ; } ${CONSTRUCTING+ KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))} ${CONSTRUCTING+ KEEP (*(.init_array))} ${CONSTRUCTING+ __init_array_end = . ; } ${CONSTRUCTING+ __fini_array_start = . ; } ${CONSTRUCTING+ KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))} ${CONSTRUCTING+ KEEP (*(.fini_array))} ${CONSTRUCTING+ __fini_array_end = . ; } ${RELOCATING+/* DATA memory starts at address 0. So to avoid placing a valid static variable at the invalid NULL address, we introduce the .data.atzero section. If CRT can make some use of it - great. Otherwise skip a word. In all cases .data/.bss sections must start at non-zero. */ . += (. == 0 ? 4 : 0);} ${RELOCATING+ PROVIDE (_data_start = .) ; } *(.data) ${RELOCATING+ *(.data*)} ${RELOCATING+ *(.data:*)} ${RELOCATING+ *(.rodata) /* We need to include .rodata here if gcc is used. */} ${RELOCATING+ *(.rodata.*) /* with -fdata-sections. */} ${RELOCATING+ *(.rodata:*)} ${RELOCATING+*(.gnu.linkonce.d*)} ${RELOCATING+*(.gnu.linkonce.r*)} ${RELOCATING+ PROVIDE (_data_end = .) ; } ${RELOCATING+/* Merge the bss input sections into the output data section. The Linux kernel's remoteproc PRU ELF loader will not memzero the bss section. The CRT0 will not either, in order to reduce the final firmware's instruction memory size. Hence present bss sections as regular data sections, at the negligible expense of increasing the ELF file size. */} ${RELOCATING+ PROVIDE (_bss_start = .) ; } *(.bss) ${RELOCATING+ *(.bss.*)} ${RELOCATING+ *(.bss:*)} ${RELOCATING+*(.gnu.linkonce.b*)} ${RELOCATING+*(COMMON)} ${RELOCATING+ PROVIDE (_bss_end = .) ; } ${OUTPUT_SECTION_ALIGN} } ${RELOCATING+ > dmem} .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame))${RELOCATING+ *(.eh_frame.*)} ${OUTPUT_SECTION_ALIGN} } ${RELOCATING+ > dmem} .gnu_extab ${RELOCATING-0} : { *(.gnu_extab) ${OUTPUT_SECTION_ALIGN} } ${RELOCATING+ > dmem} .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) ${OUTPUT_SECTION_ALIGN} } ${RELOCATING+ > dmem} /* Linux remoteproc loader requires the resource_table section start address to be aligned to 8 bytes for SoCs with AARCH64 host processors. */ .resource_table ${RELOCATING-0} ${RELOCATING+ ALIGN (CONSTANT (MAXPAGESIZE))} : { KEEP (*(.resource_table)) ${OUTPUT_SECTION_ALIGN} } ${RELOCATING+ > dmem} /* Global data not cleared after reset. */ .noinit ${RELOCATING-0} : { ${RELOCATING+ PROVIDE (_noinit_start = .) ; } *(.noinit${RELOCATING+ .noinit.* .gnu.linkonce.n.*}) ${RELOCATING+ PROVIDE (_noinit_end = .) ; } ${RELOCATING+ PROVIDE (_heap_start = .) ; } ${RELOCATING+ . += __HEAP_SIZE ; } ${RELOCATING+/* Stack is not here really. It will be put at the end of DMEM. But we take into account its size here, in order to allow for MEMORY overflow checking during link time. */} ${RELOCATING+ . += __STACK_SIZE ; } } ${RELOCATING+ > dmem} /* Remoteproc loader in Linux kernel 5.10 and later reads this section to setup the PRUSS interrupt controller. The interrupt map section is never referenced from PRU firmware, so there is no need to place it in the target dmem memory. */ .pru_irq_map 0 : { *(.pru_irq_map) } .note.gnu.build-id ${RELOCATING-0} : { *(.note.gnu.build-id) } EOF source_sh $srcdir/scripttempl/misc-sections.sc source_sh $srcdir/scripttempl/DWARF.sc cat <