Constant at a defined address

Ian Lance Taylor iant@google.com
Thu Jun 8 17:54:00 GMT 2006


Phildale <Pdale@activer.com> writes:

> In other compilers this works
> 
> #define Address
> 
> const u8 Var[] @ Address = {
>     1,2,3
> }
> 
> so Var is alway at address, how can i do this with teh GCC compiler?

You can't.

You can do something along these lines using the linker.  Read about
linker scripts in the linker manual.

Ian



More information about the Gcc-help mailing list