Last active
December 2, 2022 13:24
-
-
Save csrohit/b5971965cb9e7909b8ff0de6dcd24e68 to your computer and use it in GitHub Desktop.
Supporting code for article on linker script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* continued */ | |
.bss : | |
{ | |
_sbss = .; | |
__bss_start__ = _sbss; | |
*(.bss) | |
*(.bss.*) | |
. = ALIGN(4); | |
_ebss = .; | |
__bss_end__ = _ebss; | |
. = ALIGN(4); | |
end = .; | |
__end__ = .; | |
}> SRAM | |
} | |
/* END */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* continued */ | |
_la_data = LOADADDR(.data); | |
.data : | |
{ | |
_sdata = .; | |
*(.data) | |
*(.data.*) | |
. = ALIGN(4); | |
_edata = .; | |
}> SRAM AT> FLASH | |
/* continued */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENTRY(Reset_Handler) | |
. | |
. | |
. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SECTIONS | |
{ | |
.isr_vector : | |
{ | |
KEEP(*(.isr_vector)); | |
. = ALIGN(4); | |
}> FLASH | |
/* continued */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
swswsw | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MEMORY | |
{ | |
rom (rx) : ORIGIN = 0, LENGTH = 256K | |
ram (!rx) : org = 0x40000000, l = 4M | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SECTIONS | |
{ | |
. = 0x10000; | |
.text : { *(.text) } | |
. = 0x8000000; | |
.data : { *(.data) } | |
.bss : { *(.bss) } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MEMORY | |
{ | |
FLASH(rx):ORIGIN =0x08000000,LENGTH =64K | |
SRAM(rwx):ORIGIN =0x20000000,LENGTH =20K | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
floating_point = 0; | |
SECTIONS | |
{ | |
.text : | |
{ | |
*(.text) | |
_etext = .; | |
} | |
_bdata = (. + 3) & ~ 3; | |
.data : { *(.data) } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* continued */ | |
.text : | |
{ | |
*(.text) | |
*(.text.*) | |
*(.rodata) | |
*(.rodata.*) | |
. = ALIGN(4); | |
_etext = .; | |
}> FLASH | |
/* continued */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment