Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminate called after throwing an instance of 'trap_store_access_fault‘ #5

Open
IC-Dream opened this issue Oct 22, 2018 · 0 comments

Comments

@IC-Dream
Copy link

Hi, @poweihuang17 ,

when I use "spike -l --isa=RV32IMAFDC testMUL.elf >& out.log", I got the error: terminate called after throwing an instance of 'trap_store_access_fault', I have no idea about this, any help will be appreciated.

The gcc commad:
gcc

The .ld files:
/* not needed, but we need separate linker scripts anyway */
OUTPUT_ARCH(riscv)

/* required to correctly link newlib */
GROUP( -lc -lgloss -lgcc -lsupc++ )

SEARCH_DIR(.)
__DYNAMIC = 0;

MEMORY
{
instrram : ORIGIN = 0x00000000, LENGTH = 0x8000
dataram : ORIGIN = 0x00100000, LENGTH = 0x6000
stack : ORIGIN = 0x00106000, LENGTH = 0x2000
}

/* Stack information variables /
_min_stack = 0x1000; / 4K - minimum stack space to reserve */
_stack_len = LENGTH(stack);
_stack_start = ORIGIN(stack) + LENGTH(stack);

/* We have to align each sector to word boundaries as our current s19->slm

conversion scripts are not able to handle non-word aligned sections. /
SECTIONS
{
.vectors :
{
. = ALIGN(4);
KEEP(
(.vectors))
} > instrram

.text : {
. = ALIGN(4);
_stext = .;
*(.text)
_etext = .;
CTOR_LIST = .;
LONG((CTOR_END - CTOR_LIST) / 4 - 2)
*(.ctors)
LONG(0)
CTOR_END = .;
DTOR_LIST = .;
LONG((DTOR_END - DTOR_LIST) / 4 - 2)
*(.dtors)
LONG(0)
DTOR_END = .;
*(.lit)
*(.shdata)
_endtext = .;
} > instrram

/--------------------------------------------------------------------/
/* Global constructor/destructor segement /
/
--------------------------------------------------------------------*/

.preinit_array :
{
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
} > dataram

.init_array :
{
PROVIDE_HIDDEN (__init_array_start = .);
KEEP ((SORT(.init_array.)))
KEEP (*(.init_array ))
PROVIDE_HIDDEN (__init_array_end = .);
} > dataram

.fini_array :
{
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP ((SORT(.fini_array.)))
KEEP (*(.fini_array ))
PROVIDE_HIDDEN (__fini_array_end = .);
} > dataram

.rodata : {
. = ALIGN(4);
*(.rodata);
(.rodata.)
} > dataram

.shbss :
{
. = ALIGN(4);
*(.shbss)
} > dataram

.data : {
. = ALIGN(4);
sdata = .;
_sdata = .;
*(.data);
(.data.)
edata = .;
_edata = .;
} > dataram

.bss :
{
. = ALIGN(4);
_bss_start = .;
*(.bss)
(.bss.)
*(.sbss)
(.sbss.)
*(COMMON)
_bss_end = .;
} > dataram

/* ensure there is enough room for stack */
.stack (NOLOAD): {
. = ALIGN(4);
. = . + _min_stack ;
. = ALIGN(4);
stack = . ;
_stack = . ;
} > stack

.stab 0 (NOLOAD) :
{
[ .stab ]
}

.stabstr 0 (NOLOAD) :
{
[ .stabstr ]
}

.bss :
{
. = ALIGN(4);
_end = .;
} > dataram
}

Thanks
Dream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant