[arm-gnu] Placing variable at absolute address in RAM
Mark Deneen
mdeneen+arm at saucontech.com
Thu Apr 5 17:22:35 UTC 2012
Even in this situation, haven't you just allocated space for a pointer to a struct?
I don't see how GCC is going to do anything special here.
-M
----- Original Message -----
Ok, looks like you're right there - bad example. But I think my basic
idea is correct. Here is yet another link - see the post by Paul Curtis
(he is a compiler writer) near the end.
excerpt:
struct my_placed_vars *my_vars = (void *)0x40003000; // EASY!
#define MY_VAR_1 (my_vars->var_1)
#define MY_VAR_2 (my_vars->var_2)
COMPLETELY PORTABLE AMONGST ALL COMPILERS FOR THE GIVEN TARGET!
More information about the arm-gnu
mailing list