Hi,
I have a few sets of assembly files and source files which I need to link. Is there a way to define a symbol in scatter file that can be accessed in assembly file. The assembly file that I have is in gnu syntax(since armclang v6.7 supports gnu syntax).
Is it possible to have a symbol defined in scatter file that can be accessed in gnu assembly file.
Regards.
For ARM linker, load regions and execute regions are named slightly differently - it'll be specified in this case as Load$$LR$$STACK_START$$Base and Load$$LR$$STACK_START$$Length and Load$$LR$$STACK_START$$Limit so those would be the symbols you need to import in the assembly file.
This is a little different if you're used to gcc and GNU binutils where the ld script can insert arbitrarily named symbols at any address within the image. You have less control here although it better conforms with the definitions of the scatter file:
https://developer.arm.com/docs/dui0474/latest/accessing-and-managing-symbols-with-armlink/region-related-symbols
Since these names are rather hideous to use, the best way to use them is to pick the ones you want and rename them using a steering file
.. although assemblers should be happy with $$ in the name, and you can even make variable aliases in C to them to give them nicer names, which also gives a nice route for compatibility between ARM and GNU linkers (alias Load$$/Image$$/etc. when using ARM Compiler and don't need to on GNU).
Ta,
Matt