Quantcast
Viewing all articles
Browse latest Browse all 22016

arm-GCC to compile asm file

I am trying to compile a simple "asm" file with GCC to understand the compilation. test.h:

#define APPLICATION_EXIT .end

test.asm:

#include "test.h"
APPLICATION_EXIT

when I run :

arm-none-eabi-gcc-9.2.1.exe -mcpu=cortex-m7 -mthumb -g -c .\test.asm

I got :

arm-none-eabi-gcc-9.2.1.exe: warning: .\test.asm: linker input file unused because linking not done

but there is nothing generated , no "out' file. I try to run

arm-none-eabi-as -mcpu=cortex-m7 -mthumb -g -c .\test.asm

I got :

.\test.asm: Assembler messages:
.\test.asm:2: Error: bad instruction `application_exit'

It looks like the AS works but the Macro doesn't work. when I change the test.asm to :

#include "test.h"
.end

arm-none-eabi-as -mcpu=cortex-m7 -mthumb -g -c .\test.asm works. I got a.out.

Did I use GCC wrong? whey Gcc is not able to run the backend "as" directly? Why the #define Macro doesn't work? Thank you so much, I appreciate any comments.


Viewing all articles
Browse latest Browse all 22016

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>