Re: how to parse the special define

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear lan

         Thanks, I will research it.
         but, Is it good way if we use int a __attribute__ ((address
(0x08))) to handle the variable with address.
         If we can use it, my question is how to add the new key
"address" to the attribute table and GCC could handle the attribute?
Thanks.

Best Regards
Bien Chen

2011/1/6 Ian Lance Taylor <iant@xxxxxxxxxx>:
> bb c <chenbenbin@xxxxxxxxx> writes:
>
>>      Yes, Gcc don't suport it now. Could we use the pragma to set the
>> variable attribute and handle the attribute at backend to asm?
>
> I suppose that would be possible, although just using a variable
> attribute would be simpler if you don't have existing code.
>
>>       "The usual way to put a variable at a specific memory address
>> would be to use an attribute to put the variable in a specific section
>> and to use a linker script to put that section at a specific address."
>>
>>        Could you tell me how to use the variable attribute to put the
>> varibable to a specific section? Thanks.
>
> In
>
> http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Variable-Attributes.html#Variable-Attributes
>
> search for section ("section-name").
>
> Ian
>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux