I'm learning assembler language (Keil) for cortex-mX in university. The project consists of several files. How to make links from one file visible in another file? In order to be used in code. For example procedures from one file are visible to other files. The use of the "EXPORT procname" from one file and "IMPORT procname" to another file highly uncomfortable. I tried all of the Directive "IMPORT procname" to collect in one file that connects to every project file with the INCLUDE Directive. But appears a message like "error: A1108E: Multiply defined symbol '__main'". How to solve this issue? Project structure similar to this: file "Main.s"
AREA |.main|, CODE, READONLY, ALIGN=2 INCLUDE Include.inc __main PROC ; in this file "multiply defined symbol '__main'" EXPORT __main ... LDR R0, =sheduller ... ; any code ... B.W __main ENDP END
file "sheduller.s"
AREA |.sheduller|, CODE, READONLY, ALIGN=2 INCLUDE Include.inc sheduller PROC ; in this file "multiply defined symbol 'sheduller'" EXPORT sheduller ... ; any code ... ENDP END
file "handlers.s"
AREA |.handlers|, CODE, READONLY, ALIGN=2 INCLUDE Include.inc IRQhandler PROC ; in this file "multiply defined symbol 'IRQhandler'" EXPORT IRQhandler ... ; any code ... ENDP END
file "Include.inc"
AREA |.include|, CODE, READONLY, ALIGN=2 IMPORT __main IMPORT sheduller IMPORT IRQHandler ... END
Already tried. Not helped. The problem is that the existing symbol in the current file conflicts with the imported character from include file. In fact it turns out this code:
IMPORT sheduller IMPORT IRQhandler IMPORT __main __main PROC EXPORT __main ... ENDP
The selected text is in conflict with each other. That's right. But as it correctly to do a file "include.inc"?