made linker scripts more general

This commit is contained in:
stnolting 2020-08-19 21:14:03 +02:00
parent fed3c5770a
commit d1ebd62d88
2 changed files with 6 additions and 4 deletions

View file

@ -1,5 +1,5 @@
/* ################################################################################################# */
/* # << NEORV32 - RISC-V GCC Linker Script (for bootloader) >> # */
/* # << NEORV32 - RISC-V GCC Linker Script (for bootloader only) >> # */
/* # ********************************************************************************************* # */
/* # BSD 3-Clause License # */
/* # # */
@ -99,9 +99,10 @@ SECTIONS
*(.rela.plt)
KEEP(*(.text.boot)); /* keep start-up code */
KEEP (*(SORT_NONE(.init)))
KEEP(bootloader_crt0.elf(.text)); /* NEORV32-SPECIFIC bootloader start-up code */
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
*(.text.exit .text.exit.*)
*(.text.startup .text.startup.*)

View file

@ -54,7 +54,7 @@ SEARCH_DIR("=/opt/riscv/riscv64-unknown-linux-gnu/lib"); SEARCH_DIR("=/usr/local
MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 16*1024
ram (rwx) : ORIGIN = 0x80000000, LENGTH = 8*1024
ram (rwx) : ORIGIN = 0x80000000, LENGTH = 16*1024
}
/* ************************************************* */
@ -103,9 +103,10 @@ SECTIONS
*(.rela.plt)
KEEP(*(.text.boot)); /* keep start-up code */
KEEP (*(SORT_NONE(.init)))
KEEP(crt0.elf(.text)); /* NEORV32-SPECIFIC start-up code */
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
*(.text.exit .text.exit.*)
*(.text.startup .text.startup.*)