Make sure crt0 files come first

BIOS jumps on boot to the beginning of main_ram.
Unless `_start` function of loaded binary is there
it won't work correctly.
This commit is contained in:
Michal Sieron 2021-08-19 14:41:24 +02:00
parent 92fd154b28
commit 2883187c48
1 changed files with 6 additions and 0 deletions

View File

@ -10,6 +10,12 @@ SECTIONS
.text :
{
_ftext = .;
/* Make sure crt0 files come first, and they, and the isr */
/* don't get disposed of by greedy optimisation */
*crt0*(.text)
KEEP(*crt0*(.text))
KEEP(*(.text.isr))
*(.text .stub .text.* .gnu.linkonce.t.*)
_etext = .;
} > main_ram