Hello to all,
I am trying to port the old arm project written in C language and partly in assembly that was compiled with the armcc version 4.1. And I must mention I am not an expert on this, still learning, reading the arm documentation.
The selected new compiler is armclang v6.16. For the assembly code I am still using the armasm.
I have read the migration document and the difference between the old arm v5 and new arm v6 compiler and adapted the compiler/linker flags accordingly.
Everything is ok with the build, but the linking is failing with the error:
Error: L6291E: Cannot assign Fixed Execution Region ... Load Address:0x000179b4. Load Address must be greater than or equal to next available Load Address:0x00017f7c.
and what I could see from the map file, using fromelf for specific object file is that the build output from the armclang is bigger than when I used the older compiler. I did some basic test to compile empty functions and found out the following:
- Using old compiler: building the empty function void and non-void creates function of size 2 bytes when I look in the object file using fromelf or in the map file (Memory map of the image)
- Using the new compiler:
- building the empty function void creates function size of 2 bytes
- building the empty non void function creates function size of 4 bytes. (Very strange why additional 2 bytes).
For the code optimization I am using flag -oz as we are not using LTO in the project.
For the moment I am still trying to find out the reason, also checking if I misses any specific compiler flags.
Thank you for any useful information that could help me solve this mystery, Iknerf
Hi,
VERY STRANGE, Lot of my replies are gone. What is happening to the forum?
This is the last reply I had saved.
I solved the positioning problem by passing deprecated flag --legacyalign to the armlink and change the line in scatter file to the :ER_FLASH_LIB AlignExpr(+0, 4) FIXED
Now I am getting syntax errors for embedded assembly functions in the C. Like __asm is not recognized, PRESERVE8 invalid. So I hope there is a flag I can use that armclang will support old syntax as otherwise I would need to correct all the embedded assembly functions :(
Best regards, Iknerf
Hey just to answer the first question. One of our moderation tools looks for repetitive text within content as a spam prevention tool. Sometimes this means content with code blocks gets flagged.
I have approved the post if you want to keep it in this thread.
Thanks
Oli
Arm Community Manager
Hello Oliver,
Thank you very much for information and very quick response
Yes keep it in thread, Iknerf