mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Added init_array support for vexriscv to allow static C++ ctors and C __attribute__((constructor, priority)) in gcc
This commit is contained in:
parent
3dbe349dd9
commit
35a8c8f9f6
2 changed files with 10 additions and 0 deletions
|
@ -84,6 +84,7 @@ bss_done:
|
|||
li a0, 0x880 //880 enable timer + external interrupt sources (until mstatus.MIE is set, they will never trigger an interrupt)
|
||||
csrw mie,a0
|
||||
|
||||
call __libc_init_array
|
||||
call main
|
||||
infinit_loop:
|
||||
j infinit_loop
|
||||
|
|
|
@ -51,6 +51,15 @@ SECTIONS
|
|||
PROVIDE_HIDDEN (__bios_init_end = .);
|
||||
} > rom
|
||||
|
||||
.init_array :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
__init_array_start = .;
|
||||
KEEP(*(SORT(.init_array.*)))
|
||||
KEEP(*(.init_array))
|
||||
__init_array_end = .;
|
||||
} > rom
|
||||
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(8);
|
||||
|
|
Loading…
Reference in a new issue