Re: __attribute__((used)) and druntime

2015-04-13 Thread Mike via Digitalmars-d
On Saturday, 11 April 2015 at 15:35:47 UTC, w0rp wrote: I've been looking into compiling smaller executables, and the trick I learned from watching sessions from the last DConf is to use the KEEP symbol in a linker script with something like gc-sections. So at the compilation stage, symbols

Re: __attribute__((used)) and druntime

2015-04-11 Thread w0rp via Digitalmars-d
On Saturday, 11 April 2015 at 15:59:53 UTC, David Nadlinger wrote: On Saturday, 11 April 2015 at 15:35:47 UTC, w0rp wrote: […] (Also LDC?) in druntime and flag all of the symbols like this appropriately, so that creating executables with gc-sections will Just Work in some cases without a

__attribute__((used)) and druntime

2015-04-11 Thread w0rp via Digitalmars-d
I've been looking into compiling smaller executables, and the trick I learned from watching sessions from the last DConf is to use the KEEP symbol in a linker script with something like gc-sections. So at the compilation stage, symbols are put in different sections, a linker script marks some

Re: __attribute__((used)) and druntime

2015-04-11 Thread David Nadlinger via Digitalmars-d
On Saturday, 11 April 2015 at 15:35:47 UTC, w0rp wrote: […] (Also LDC?) in druntime and flag all of the symbols like this appropriately, so that creating executables with gc-sections will Just Work in some cases without a linker script? LDC is shipping with --gc-sections enabled by default

Re: __attribute__((used)) and druntime

2015-04-11 Thread Jens Bauer via Digitalmars-d
On Saturday, 11 April 2015 at 15:35:47 UTC, w0rp wrote: From what I just read, __attribute__((used)) in GCC should do the job, and I think it should be usable from GDC with its attribute pragmas. I wouldn't mind having this functionality. For a long time, I've wanted it in C in those cases