0
votes

I'm using IAR toolchain to compile few source files and then link generated .o files.

However, I'm running into linking errors like below:

Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]

Error[Lc036]: no block or place matches the pattern "ro code section .intvec in vector_table_M.o(rt7M_tl.a)"

As I understand, ILINK linker is trying to link object files as an executable image and in the process adding dependencies from standard libraries[ i.e looking for main() and interrupt vector table ].

What I'm looking for :

  1. How to configure linker to not to add these system-library dependencies like main/start/interrupt-vector-table etc. ?
  2. How to configure linker to output a non-executable image from bunch of object files - if that at all is possible ?

You can think of this non-executable image sort of configuration-table image which will be put in persistent memory to be read/write by main application image.

1
Can you compile it as a library?user694733
Yes, I can get object files using the IAR compiler and i didn't try it but i'm assuming I can archive it and create .a out of it.dkumar
You'll should be able to set it to output library file directly. In project options, set General Options -> Output -> Output file from Executable to Library. (Note that I haven't never used this myself.)user694733
Thanks, i'll try it out.dkumar

1 Answers

1
votes

If you tell the linker that you don't have an entry point with the command line option '--no_entry' you will get rid of the reference to main and the .intvec data.

However you do need to tell the linker what it should keep.
--keep and/or __root can help you with that.