Object file questions

Johannes Pfau via D.gnu d.gnu at puremagic.com
Thu Aug 14 10:10:44 PDT 2014


Am Thu, 14 Aug 2014 10:07:04 +0000
schrieb "Timo Sintonen" <t.sintonen at luukku.com>:

> I have been looking at object files to see if I can reduce the 
> memory usage for minimum systems. There are two things I have 
> noticed:
> 
> 1. In the data segment there is some source code as ascii text 
> from a template in gcc/atomics.d . This is in the actual data 
> segment and not in debug info segments and goes into the data 
> segment of the executable. I do not see any code using this data. 
> Why is this in the executable and is it possible to remove it?
> 

Strange, could you post a testcase?

> 2. In the data segment there is also __init for all types. I 
> assume that they contain the initial values that are copied when 
> a new object of this type is created.

Correct, it's for '.init' (there's especially __..._TypeInfo_init which
is the initializer for typeinfo. I've implemented -fno-rtti in a private
git branch to get rid of typeinfo)

> Is this data mutable and 
> should it really be in data segment and not in rodata?
> 

I think it should be in rodata.


More information about the D.gnu mailing list