Hi, I'm experimenting an odd problem with a FreeRTOS asm/C mixed macro as my code grows bigger:
I'm using an ATMEL EB40A ev. board and GCC 4.02 WinARM dev. environment, and my application runs fairly good. The problem is that now my code is large (.text is about 0x12000 bytes long) and some macros (like portSAVE_CONTEXT() and restore()) macros stopped working: the compiler stops reporting: "Error: invalid literal constant: pool needs to be closer" several times (one per far data reference). The same macros work fine elsewhere in the code, nearer to the required variable: they address global C variables like:
asm volatile ( "LDR R0, =ulCriticalNesting " );
that are now too far to be directly referred (the C compiler instead addresses them by storing their address in local constants, eg:
ldr r1, .LC3 ... .LC3: .word __data_beg__
). I think that the problem can be fixed using the same technique (a local constant), but I'd like to place this declaration INSIDE the macros themselves, by using something like the old "local" or "private" assembly directive to avoid generating duplicate symbols... I don't know how is this kind of construct managed by gnu asm. Using a location OUTSIDE of the macro implies that I have to change the location name inside the macro at any usage, so I cannot use the plain macro... Does anybody know the ARM gas syntax well enough to fix this problem? Thank you, Oraz