Re: Removing RTTI from binaries

2015-05-10 Thread Mike via D.gnu
On Sunday, 10 May 2015 at 12:48:55 UTC, Mike wrote: On Sunday, 10 May 2015 at 09:54:51 UTC, Mike wrote: Looks like someone picked up on this and submitted a patch: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=192#c9 Cool!! But I still have yet to test it. Damn! Didn't work. Bug report

Re: Removing RTTI from binaries

2015-05-10 Thread Mike via D.gnu
On Sunday, 10 May 2015 at 13:20:42 UTC, Iain Buclaw wrote: Not sure what you're using to build, but it seems reliant on -ffunction-sections -fdata-sections -fmerge-constants - or at least the latter two of those options. Did you try the minimum test in the PR? I'm using the cross-compiler b

Re: Removing RTTI from binaries

2015-05-10 Thread Iain Buclaw via D.gnu
On 10 May 2015 at 14:48, Mike via D.gnu wrote: > On Sunday, 10 May 2015 at 09:54:51 UTC, Mike wrote: > >> Looks like someone picked up on this and submitted a patch: >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=192#c9 Cool!! But I still >> have yet to test it. > > > Damn! Didn't work. > No

Re: Removing RTTI from binaries

2015-05-10 Thread Mike via D.gnu
On Sunday, 10 May 2015 at 09:54:51 UTC, Mike wrote: Looks like someone picked up on this and submitted a patch: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=192#c9 Cool!! But I still have yet to test it. Damn! Didn't work.

Re: Removing RTTI from binaries

2015-05-10 Thread Mike via D.gnu
On Thursday, 15 January 2015 at 12:01:05 UTC, Johannes Pfau wrote: After some google-fu: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=192 Considering this was filed in 2000 I'd say it's not very likely to get fixed soon :-( So the best option is probably to get rid of this problem by patchin

Re: Removing RTTI from binaries

2015-05-01 Thread Jens Bauer via D.gnu
Am Thu, 30 Apr 2015 14:27:15 + schrieb "Jens Bauer" : I was wondering... Would it be possible to make selective TypeInfo ? -Eg. Only add TypeInfo for those things that really need it. {snip} On Thursday, 30 April 2015 at 19:24:14 UTC, Johannes Pfau wrote: I think one place where you reall

Re: Removing RTTI from binaries

2015-04-30 Thread Johannes Pfau via D.gnu
Am Thu, 30 Apr 2015 14:27:15 + schrieb "Jens Bauer" : > I was wondering... Would it be possible to make selective > TypeInfo ? > -Eg. Only add TypeInfo for those things that really need it. 'really need it' is quite subjective. IIRC TypeInfo is mostly used for GC, AA and sometimes arrays. Yo

Re: Removing RTTI from binaries

2015-04-30 Thread Jens Bauer via D.gnu
On Thursday, 30 April 2015 at 14:27:17 UTC, Jens Bauer wrote: {snip} or make a 32-bit uniqueID (perhaps even a 16-bit UID). Note: The most frequently used typeinfo should have the lowest ID numbers, because on small devices, loading a small value into a register, will use very little space.

Re: Removing RTTI from binaries

2015-04-30 Thread Jens Bauer via D.gnu
On Friday, 16 January 2015 at 18:37:28 UTC, Johannes Pfau wrote: Am Thu, 15 Jan 2015 23:08:57 -0600 schrieb "Orvid King via D.gnu" : TypeInfo is generated at declaration time. At that point you can't even know if a struct will be allocated on the heap at some point. I was wondering... Would it

Re: Removing RTTI from binaries

2015-01-16 Thread Johannes Pfau via D.gnu
Am Thu, 15 Jan 2015 23:08:57 -0600 schrieb "Orvid King via D.gnu" : > On 1/15/2015 10:31 PM, Mike via D.gnu wrote: > > On Thursday, 15 January 2015 at 12:01:05 UTC, Johannes Pfau wrote: > > > >> My best guess is that the strings are always placed in rodata, > >> never in separate sections. If you

Re: Removing RTTI from binaries

2015-01-16 Thread Dicebot via D.gnu
On Friday, 16 January 2015 at 04:31:17 UTC, Mike wrote: On Thursday, 15 January 2015 at 12:01:05 UTC, Johannes Pfau wrote: My best guess is that the strings are always placed in rodata, never in separate sections. If you do write("x"), "x" is also in rodata, the rodata section can't be remove

Re: Removing RTTI from binaries

2015-01-16 Thread Orvid King via D.gnu
On 1/15/2015 10:31 PM, Mike via D.gnu wrote: On Thursday, 15 January 2015 at 12:01:05 UTC, Johannes Pfau wrote: My best guess is that the strings are always placed in rodata, never in separate sections. If you do write("x"), "x" is also in rodata, the rodata section can't be removed. If you del

Re: Removing RTTI from binaries

2015-01-15 Thread Mike via D.gnu
On Thursday, 15 January 2015 at 12:01:05 UTC, Johannes Pfau wrote: My best guess is that the strings are always placed in rodata, never in separate sections. If you do write("x"), "x" is also in rodata, the rodata section can't be removed. If you delete the write call there's no reference to

Re: Removing RTTI from binaries

2015-01-15 Thread Mike via D.gnu
On Sunday, 11 January 2015 at 16:57:41 UTC, Johannes Pfau wrote: If you only want to disable TypeInfo for some classes that's more difficult: https://github.com/D-Programming-microD/GDC/commit/f0614bc9480dacd1ec6bb75277d280afa96e08bb Is this good enough for a pull request upstream, or just a

Re: Removing RTTI from binaries

2015-01-15 Thread ketmar via D.gnu
On Thu, 15 Jan 2015 13:01:04 +0100 "Johannes Pfau via D.gnu" wrote: > After some google-fu: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=192 > Considering this was filed in 2000 I'd say it's not very likely to get > fixed soon :-( and it's so forgotten that they have stupid portostory attached

Re: Removing RTTI from binaries

2015-01-15 Thread Mike via D.gnu
On Thursday, 15 January 2015 at 12:01:05 UTC, Johannes Pfau wrote: After some google-fu: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=192 Considering this was filed in 2000 I'd say it's not very likely to get fixed soon :-( That looks right-on, and knowing the likely cause, I should able

Re: Removing RTTI from binaries

2015-01-15 Thread Dicebot via D.gnu
On Thursday, 15 January 2015 at 12:01:05 UTC, Johannes Pfau wrote: So the best option is probably to get rid of this problem by patching the compiler (@notypeinfo or -fnortti). Oh, sorry, I though GDC already does that when TypeInfo is never actually used. Nevermind then, your version seems t

Re: Removing RTTI from binaries

2015-01-15 Thread Johannes Pfau via D.gnu
Am Thu, 15 Jan 2015 11:51:41 + schrieb "Mike" : > On Thursday, 15 January 2015 at 11:42:31 UTC, Dicebot wrote: > > > > Random guess: can it possibly confuse template-based variadics > > with runtime variadics? Latter require RTTI to work. If > > something like that happens it is surely a bug

Re: Removing RTTI from binaries

2015-01-15 Thread Johannes Pfau via D.gnu
Am Thu, 15 Jan 2015 11:42:30 + schrieb "Dicebot" : > On Thursday, 15 January 2015 at 11:04:37 UTC, Mike wrote: > > If you can explain the mechanics causing this, please enlighten > > me. Bug? Enhancement? By design? > > Random guess: can it possibly confuse template-based variadics > with

Re: Removing RTTI from binaries

2015-01-15 Thread Mike via D.gnu
On Thursday, 15 January 2015 at 11:42:31 UTC, Dicebot wrote: Random guess: can it possibly confuse template-based variadics with runtime variadics? Latter require RTTI to work. If something like that happens it is surely a bug. Thanks for the reply. I have to apologize for the last post,

Re: Removing RTTI from binaries

2015-01-15 Thread Dicebot via D.gnu
On Thursday, 15 January 2015 at 11:04:37 UTC, Mike wrote: If you can explain the mechanics causing this, please enlighten me. Bug? Enhancement? By design? Random guess: can it possibly confuse template-based variadics with runtime variadics? Latter require RTTI to work. If something like tha

Re: Removing RTTI from binaries

2015-01-15 Thread Mike via D.gnu
On Wednesday, 14 January 2015 at 14:34:48 UTC, Mike wrote: I'll try to make a reduced test case on Linux that others can run and see. Ok, here's my reduced test case that runs on Linux 64-bit. I don't know if I really needed to implement the syscalls, but I just wanted to get rid of everyt

Re: Removing RTTI from binaries

2015-01-14 Thread Mike via D.gnu
On Wednesday, 14 January 2015 at 14:20:50 UTC, Iain Buclaw via D.gnu wrote: Could it be that the entire module trace takes up 128K? Probably not very likely. And I doubt the writeLine/write templates contribute to much. Sorry, I didn't see this reply before I submitted my last post. The

Re: Removing RTTI from binaries

2015-01-14 Thread Mike via D.gnu
On Wednesday, 14 January 2015 at 13:32:53 UTC, Mike wrote: Well, I was working a reduced test case and found that it has something to do with my trace.d file here: https://github.com/JinShil/stm32f42_discovery_demo/blob/master/source/stm32f42/trace.d If I add a trace.writeLine("x") in my progr

Re: Removing RTTI from binaries

2015-01-14 Thread Iain Buclaw via D.gnu
On 14 January 2015 at 13:32, Mike via D.gnu wrote: > On Wednesday, 14 January 2015 at 09:04:50 UTC, Mike wrote: >> >> >> Ok, but I have a mess of classes generated by templates (and I love it). >> Their `name` properties [1] should go in .rodata, right? But why aren't >> they being put in their o

Re: Removing RTTI from binaries

2015-01-14 Thread Mike via D.gnu
On Wednesday, 14 January 2015 at 09:04:50 UTC, Mike wrote: Ok, but I have a mess of classes generated by templates (and I love it). Their `name` properties [1] should go in .rodata, right? But why aren't they being put in their own sections when compiling with -fdata-sections? [1] - http

Re: Removing RTTI from binaries

2015-01-14 Thread Mike via D.gnu
On Wednesday, 14 January 2015 at 08:42:55 UTC, Iain Buclaw via D.gnu wrote: On 14 January 2015 at 04:00, Mike via D.gnu wrote: On Tuesday, 13 January 2015 at 14:36:15 UTC, Dicebot wrote: I remember speaking about it with Martin and Daniel during DConf 2014 and I think it was Daniel who ment

Re: Removing RTTI from binaries

2015-01-14 Thread Iain Buclaw via D.gnu
On 14 January 2015 at 04:00, Mike via D.gnu wrote: > On Tuesday, 13 January 2015 at 14:36:15 UTC, Dicebot wrote: >> >> >> I remember speaking about it with Martin and Daniel during DConf 2014 and >> I think it was Daniel who mentioned that by default TypeInfo/ModuleInfo is >> emitted in some weird

Re: Removing RTTI from binaries

2015-01-13 Thread Mike via D.gnu
On Tuesday, 13 January 2015 at 14:36:15 UTC, Dicebot wrote: I remember speaking about it with Martin and Daniel during DConf 2014 and I think it was Daniel who mentioned that by default TypeInfo/ModuleInfo is emitted in some weird packed way. When LDC announced using --gc-sections by default

Re: Removing RTTI from binaries

2015-01-13 Thread Mike via D.gnu
On Tuesday, 13 January 2015 at 14:20:43 UTC, Mike wrote: Here's what I'm seeing: arm-none-eabi-objdump -t binary/firmware binary/firmware: file format elf32-littlearm SYMBOL TABLE: 0800 ld .text .text 08000a44 ld .rodata .rodata

Re: Removing RTTI from binaries

2015-01-13 Thread Dicebot via D.gnu
On Tuesday, 13 January 2015 at 14:20:43 UTC, Mike wrote: On Sunday, 11 January 2015 at 16:57:41 UTC, Johannes Pfau wrote: That's likely used/caused by the TypeInfo.name property. Judging by what I'm seeing, I think you're right. But I'm compiling with -fdata-sections and -Wl,--gc-sections,

Re: Removing RTTI from binaries

2015-01-13 Thread Mike via D.gnu
On Sunday, 11 January 2015 at 16:57:41 UTC, Johannes Pfau wrote: That's likely used/caused by the TypeInfo.name property. Judging by what I'm seeing, I think you're right. But I'm compiling with -fdata-sections and -Wl,--gc-sections, so shouldn't that put each TypeInfo.name in its own secti

Re: Removing RTTI from binaries

2015-01-11 Thread bearophile via D.gnu
Johannes Pfau: If you only want to disable TypeInfo for some classes that's more difficult: This seems a feature that can be useful in standard D (all compilers), with an annotation of some kind like @nortti. Bye, bearophile

Re: Removing RTTI from binaries

2015-01-11 Thread Johannes Pfau via D.gnu
Am Sun, 11 Jan 2015 15:15:38 + schrieb "Mike" : > On Sunday, 11 January 2015 at 15:02:07 UTC, bearophile wrote: > > Mike: > > > >> I'm building some code that is heavily templated. Therefore, > >> I have many very small classes. > > > > This is a non sequitur. > > I believe it is because ne

Re: Removing RTTI from binaries

2015-01-11 Thread Mike via D.gnu
On Sunday, 11 January 2015 at 15:02:07 UTC, bearophile wrote: Mike: I'm building some code that is heavily templated. Therefore, I have many very small classes. This is a non sequitur. I believe it is because nearly every one of the instantiated template names is appears in the .rodata se

Re: Removing RTTI from binaries

2015-01-11 Thread bearophile via D.gnu
Mike: I'm building some code that is heavily templated. Therefore, I have many very small classes. This is a non sequitur. Most of my code just uses classes as namespaces calling static methods and properties. Aren't structs better for that? Bye, bearophile