This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to parse the special define


bb c <chenbenbin@gmail.com> writes:

>          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?

Whether you can use it depends on how your assembler and linker work.
As I said earlier, there is no reasonable way to make it work for an
initialized variable when using a conventional Unix system.  I don't
think you've said anything about your target.

If you know what you want gcc to generate for this attribute, then it
shouldn't be too hard to modify gcc accordingly.  In current development
sources the attribute table is in gcc/c-family/c-common.c.  Then you
would check for the presence of the attribute in gcc/varasm.c when
emitting the definition of the variable.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]