[Bug 139] GDC writes all-zero initialisers in the rodata section

via D.gnu d.gnu at puremagic.com
Sun Feb 19 00:00:29 PST 2017


http://bugzilla.gdcproject.org/show_bug.cgi?id=139

Timo Sintonen <t.sintonen at luukku.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |t.sintonen at luukku.com

--- Comment #12 from Timo Sintonen <t.sintonen at luukku.com> ---
(In reply to Iain Buclaw from comment #11)
> Is this still problematic?  I ask because now the old data generation pass
> is gone completely.

This bug is originally about failing tests, but while in topic I want to add my
point of wiew.

Anything in .rodata goes into the loadable file and into the code memory (rom
in microcontrollers)
Anything in .data goes into the file and into the code memory where it is
copied into the data memory (ram in microcontrollers)
Anything in .bss tekes space only in data memory. (except the gold linker may
put it into the file while ld does not)

This means anything in .data consumes more resources than anything in other
segments. Then there are different goals: in desktop programs it may be
desirable to have a smaller file while in microcontrollers it is important to
minimize the usage of ram.
It seems that in typical controllers the rom/ram ratio is good for applications
written in C but appications written in D require more ram. This means I would
like to move as much as possible to the .rodata section. there are other data
too, like classinfo.

Maybe there should be a switch that selects between desktop mode and
microcontroller mode. This switch might also remove all of typeinfo or other
unnecessary things.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the D.gnu mailing list