Fixed heap manager and added custom linker script for calling global/static ctors and dtors.
This commit is contained in:
48
custom.ld
Normal file
48
custom.ld
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Define memory regions */
|
||||
MEMORY
|
||||
{
|
||||
RAM (wxa) : ORIGIN = 0x20000000, LENGTH = 1M /* Adjust these values for your target */
|
||||
ROM (rx) : ORIGIN = 0x08000000, LENGTH = 512K /* Adjust these values for your target */
|
||||
}
|
||||
|
||||
/* Define the entry point of the program */
|
||||
ENTRY(_start)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* Place the program code at the beginning of ROM */
|
||||
.text : {
|
||||
*(.text)
|
||||
*(.text*)
|
||||
} > ROM
|
||||
|
||||
/* Initialize data section in ROM, copy to RAM at startup */
|
||||
.data : {
|
||||
*(.data)
|
||||
*(.data*)
|
||||
} > RAM AT > ROM
|
||||
|
||||
/* Uninitialized data section in RAM */
|
||||
.bss : {
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
} > RAM
|
||||
|
||||
/* Constructor array section */
|
||||
.init_array : {
|
||||
__start_init_array = .; /* Define the start symbol */
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
__stop_init_array = .; /* Define the end symbol */
|
||||
} > ROM
|
||||
|
||||
.fini_array : {
|
||||
__start_fini_array = .; /* Define the start symbol for destructors */
|
||||
KEEP(*(SORT(.fini_array.*)))
|
||||
KEEP(*(.fini_array))
|
||||
__stop_fini_array = .; /* Define the end symbol for destructors */
|
||||
} > ROM
|
||||
|
||||
/* Add other sections as needed */
|
||||
}
|
||||
Reference in New Issue
Block a user