0

I am facing a trivial prblem.

I am doing an ldr r0, _buff in arm assembly, where _buff is defined in a c file. _buff is not static.

How should I define external linkage in assembly file (similar to extern in C) is it required or is there anything which I am missing.

2 Answers2

0

You don't need to. If the symbol can't be found in the source file, it'll be assumed to be defined elsewhere.

tangrs
  • 9,709
  • 1
  • 38
  • 53
0

It's not necessary to do that. If *_buff* has been defined as global in the C file, you can compile and build the files together:

arm-none-gnuaebi-gcc -o output assembly.s cfile.c

You can also compile them separately, it's also going to work. But _buff does not exist, you will get a link error.

TwoCode
  • 127
  • 7