Simple asm program with gcc, ld error
Hi, i'm trying to assemble a simple program to check if i've gotten it right. The program(test.s) simply contains, MOVS r0, #0x5.
In terminal i first tried:
$arm-none-eabi-gcc -x assembler-with-cpp -Wa,-mcpu=cortex-m0 -o test.bin test2.s
However got error from the linker:
/opt/gcc-
exit.c:
/opt/gcc-
(.text+0xec): undefined reference to `main'
collect2: error: ld returned 1 exit status
Searching the net, a recommendation was to use, --specs=
$ arm-none-eabi-gcc -x assembler-with-cpp --specs=nosys.specs --specs=
/opt/gcc-
(.text+0x120): undefined reference to `main'
collect2: error: ld returned 1 exit status
Any idea how to solve this? Im simply trying to assemble arm code to a cortex-m0 based MCU(which im going to download to the MCU). If there is a better way to do this i greatly appreciate any suggestions!
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Andre Vieira
- Solved:
- Last query:
- Last reply: