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

Execution stop at call of 'atexit' #367

Open
alanmasu opened this issue Jul 31, 2024 · 0 comments
Open

Execution stop at call of 'atexit' #367

alanmasu opened this issue Jul 31, 2024 · 0 comments

Comments

@alanmasu
Copy link

alanmasu commented Jul 31, 2024

Hi,
I've build the RISC-V toolchain whit NewLib as indicated in the official repository (cause I'll need it), so when I compiled a simple main whit a string copy implemented on, the simulator execute from _start to the call of atexit and then stops the execution without any error o message, and also without calling main.

Here is the code:

void copia_stringa(char source[], char dest[]);

int main(){
    char a [10] = "ciao";
    char b [10] = "";
    copia_stringa(a, b);
    return 0;
}


void copia_stringa(char source[], char dest[]){
    unsigned int i = 0;
    while(source[i] != '\0'){
        dest[i] = source[i];
    }
}

Here I put also the disassembled code (builded whit local tool-chain) and the object file.
disass.txt
main_elf.txt (change extension to .elf).

There is an issue on the simulator or is a tool-chain configuration issue??

My goal is to simulate the boot stage of the compiled code!

[EDIT]
I also need to specify the linker script for allocating ELF sections in a memory map that's different from the default one, so here there is also the linker script:
ld_script.txt

Thanks to who respond me,
Alan Masutti

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