Hi:
Is there a linker switch or any #progma keywords can force a block of variables located at a fixed area and without re-arrange the order, for example, I have the variable definition as following:
int a
int b
int c
double d
double e
int * f
I'd like to force the variables locate at contiguous address, like:
a: 0xc3000000
b: 0xc3000004
c: 0xc3000008
d: 0xc3000010
e: 0xc3000018
f: 0xc3000020
If I don't do anything, the linker may put a, b,c in one address area and d and e in another address area, not contiguous address to a, b, c. I know it's easy to force a single variable to a fixed address by adding following statement to command file:
a=0xc3000000;
but the project contains too many variables (more than 3000 variables) and it's a tedious work to specify address one by one. Another way is to group them as a struct or union, so they will be a single variable known by linker, but in this way, there are a lot of variable names need to be modified due to struct name added. So is there a easy way I can assign the 1st variable to a fixed address and let next variables located at the same adjucontinuous address area?