I just want to write a program that just starts and ends without a segmentation error.

If I just write the function int _start() { return 0;} then I get a segmentation error, as far as I understand it in Google, I need to correctly complete the program (a couple of lines in assembler), but what should be the lines for the arm (I'm with the arm of the laptop)?

    1 answer 1

    test.c :

     void _start() { asm( "mov r0, #0;" /* кладем в r0 0 -- код выхода */ "mov r7, #1;" /* кладем в r7 1 -- номер системного вызова exit */ "swi 0" /* системный вызов Linux */ ); } 

    Compilation and execution:

     $ gcc -nostdlib test.c -o test $ ./test