Thread overview | |||||
---|---|---|---|---|---|
|
September 27, 2017 Sectioned variables? | ||||
---|---|---|---|---|
| ||||
GCC supports a `__attribute((section("...")))` for variables to put them in specific sections in the final assembly. Is there any way this can be achieved in D? Does GDC support this? |
September 28, 2017 Re: Sectioned variables? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arav Ka | On Wednesday, 27 September 2017 at 11:59:16 UTC, Arav Ka wrote: > GCC supports a `__attribute((section("...")))` for variables to put them in specific sections in the final assembly. Is there any way this can be achieved in D? Does GDC support this? LDC does, see https://github.com/ldc-developers/druntime/blob/ldc/src/ldc/attributes.d#L166. |
September 28, 2017 Re: Sectioned variables? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Arav Ka | On Wednesday, 27 September 2017 at 11:59:16 UTC, Arav Ka wrote: > GCC supports a `__attribute((section("...")))` for variables to put them in specific sections in the final assembly. Is there any way this can be achieved in D? Does GDC support this? GDC should https://github.com/D-Programming-GDC/GDC/blob/master/libphobos/libdruntime/gcc/attribute.d#L30 import gcc.attribute; @attribute("section","foo") int bar; is what you want I think (untested) if you are using GDC. |
Copyright © 1999-2021 by the D Language Foundation