Hi all,
I am new with L166 linker on ST10 target and I just would like to : Set a code section containing all the code of several files (file1.obj, file2.obj and file3.obj for example) and to locate them at a specific address.
I would like to set this linker/locator in a linker file _without_ including pragma directives in my source code (which is not very portable)
So, a section of code at 0x10000 for example, containing code of file1.obj file2.obj file3.obj ...etc...
I can't find which directive tells that code of file1.obj, file2.obj, file3.obj,... has to be stored in MY_CODE_SECTION and MY_CODE_SECTION start address has to be 0x100000 for example...
Thank you for your precious help,
Best Regards,
Pierre
To be more precise, I have added this line to my linker command file : SECTIONS (?PR?FILE1%FCODE (0x800000))
...which seems to work but I wondered if there were some wildcard facilities to be able to locate a list of files with a single directive such as :
SECTIONS (?PR?FILE_*%FCODE (0x800000))
... any idea for L166 ? ... I saw that BL51 could do that...
My first thought was to use a special class for all the modules you want to relocate but I wasn't sure it Keil supported this. I did some Please read the manual and found this:
http://www.keil.com/support/man/docs/c166/c166_renameclass.htm
and also:
http://www.keil.com/support/docs/1165.htm http://www.keil.com/support/docs/2215.htm http://www.keil.com/support/docs/829.htm http://www.keil.com/support/man/docs/l166/l166_classes.htm
Good luck, Joost Leeuwesteijn
Thank you for your answer !
I finally understood how to deal with code locating... but I face a new problem :
My file names are too long ! Therefore my SECTIONS directive in my linker command file is not correct, following error code is returned : *** FATAL ERROR L202: INVALID COMMAND LINE, TOKEN TOO LONG
Here is a part of my linker/locator command file :
SECTIONS (?PR?FILE1_TOO_LONG_NAME%FCODE (0x90000), & ?PR?FILE2_TOO_LONG_NAME%FCODE, & ?PR?FILE3_TOO_LONG_NAME%FCODE)
Since I can't rename all file names to make them shorter, I have decide to RENAMACLASS from C compiler. But here again I've got a problem : I wouldn't like to pollute my C source code with #pragmas to keep it portable. So I would like to embed my #pragma directive in an other preprocessor macro such as :
#define CODE_SECTION_NAME(X) #pragma RENAMECLASS (FCODE=X)
... but it does not work since preprocessor only preprocesses C source code once....
So here I am.... no more idea to locate my long named files and to keep my code portable...
Any help would be very appreciated !
Thanks a lot !
Modify your build environment to do the RENAMECLASS at compile time for the specific set of files (from the commandline instead of a #pragma)?
Or do an ' #include "relocate.h" ' in the source files; where the single relocate.h contains the #pragma. Basically the same as the preprocessor macro you considered.
-- Joost
Ok thanks a lot : locate.h solution seems to be the best solution. Thanks again for your time. Pierre