[cfe-dev] How to force Clang to put a variable at specific absolute address?

John McCall rjmccall at apple.com
Fri Mar 22 10:10:47 PDT 2013


On Mar 22, 2013, at 9:15 AM, octal at pocketmt.com wrote:
> How to force Clang to put a variable at specific absolute address?
> 
> (PS. I don't want solution purely based on linker scripts)
> 
> On some Gcc versions, we use __attribute__((address(0xnnnn))) tu put a variable at adress 0xnnnn
> On Clang I have seen something like "address_space" but it doesn't seem to do anything on MIPS port of LLVM.
> Is this the correct attribute to use, or do I have to implement a new attribute?

We don't currently support any attributes for doing this.
Address spaces are a different concept.

John.



More information about the cfe-dev mailing list