[arm-gnu] Placing variable at absolute address in RAM

Moses McKnight moses at texband.net
Thu Apr 5 17:41:33 UTC 2012


I guess you're right, and I think I understand the problem better now!
Guess I'll go back to my hole now... :)

On 04/05/2012 12:22 PM, Mark Deneen wrote:
> 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