Strip down linker script
This commit is contained in:
+10
-37
@@ -5,10 +5,14 @@ PROVIDE( _stack_size = __stack_size );
|
||||
|
||||
MEMORY
|
||||
{
|
||||
/* CH32V20x_D6 -> 10 KB SRAM */
|
||||
/* allow full flash (incl. non-zero-wait) */
|
||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 224K
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 10K
|
||||
/* Try to squeeze down to this target size */
|
||||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 2K
|
||||
/* We have a total of 512 bytes here.
|
||||
- Need 256 bytes to buffer a flash page across USB packets
|
||||
- Need space for USB buffers
|
||||
- Tiny tiny amount of free space
|
||||
*/
|
||||
USBRAM (rw) : ORIGIN = 0x400060c0, LENGTH = 64
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
@@ -29,29 +33,6 @@ SECTIONS
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
.preinit_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
} >FLASH
|
||||
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
|
||||
KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
} >FLASH
|
||||
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
|
||||
KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
} >FLASH
|
||||
|
||||
PROVIDE(_data_lma = .);
|
||||
|
||||
.data :
|
||||
@@ -73,7 +54,7 @@ SECTIONS
|
||||
*(.srodata .srodata.*)
|
||||
. = ALIGN(4);
|
||||
PROVIDE( _edata = .);
|
||||
} >RAM AT>FLASH
|
||||
} >USBRAM AT>FLASH
|
||||
|
||||
.bss :
|
||||
{
|
||||
@@ -85,15 +66,7 @@ SECTIONS
|
||||
*(COMMON*)
|
||||
. = ALIGN(4);
|
||||
PROVIDE( _ebss = .);
|
||||
} >RAM
|
||||
} >USBRAM
|
||||
|
||||
PROVIDE( _end = _ebss);
|
||||
|
||||
.stack ORIGIN(RAM) + LENGTH(RAM) - __stack_size :
|
||||
{
|
||||
PROVIDE( _heap_end = . );
|
||||
PROVIDE( _susrstack = . );
|
||||
. = . + __stack_size;
|
||||
PROVIDE( _eusrstack = .);
|
||||
} >RAM
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user