AnsweredAssumed Answered

Adding new .c file to project gives [Error li1040]

Question asked by m-j on Oct 12, 2017
Latest reply on Oct 20, 2017 by Kader.M



I am adding a new .c file to my project and when I build the project I get the linker error [Error li1040].  I went through the linker_log.xml file and the associated *map.xml for the project both before and after the new .c file was added.  To isolate the issue, I used a .c file with a single define in it that is not used elsewhere, so it would be optimized out.


From what I can see, it looks like adding the new file changes the order in which the variables are set in the L1 data memory.  I have some large variables to store data and this re-ordering causes one of theses variables to be moved from the beginning of the memory block to be allocated elsewhere.  So when it gets around to placing this variable, it cannot find enough contiguous space to do so in either of the L1 memory data blocks.  If you add up the amount of free memory available on the system (in both of the L1 memory blocks) I have enough total space to fit it in if it was mapped differently (I would still have plenty of memory to spare too).


I was wondering if there was an easy way to make sure that the large variables are mapped first so that I can get everything to fit.  Is there some linker setting that would allow me to do this?  I did not find it in the CrossCore linker manual unless I try to play with 'SECTIONS {}'.  But I think that would be harder to maintain as changes are made to the code.


I am using CCES 2.3.0 and the ADSP-BF607.


Any thoughts on this would be helpful.