[GOLD][PATCH] Remove Output_section::Simple_input_section class.

Ian Lance Taylor iant@google.com
Thu May 20 00:59:00 GMT 2010


Cary Coutant <ccoutant@google.com> writes:

>>> We use off_t for data_size() in Output_data and its sub-classes.   I
>>> changed this to make it consistent.  I agree that uint32_t is
>>> sufficient for ARM and will change this.
>>
>> Oh yeah.  That dates back to when I created output.h.  It should
>> probably change at some point.
>
> To what -- section_size_type and section_offset_type? Or, for sized
> classes, something that's sized for the target?

Templated classes should normally use the appropriate templated size.

In output.h the size of a section should probably be uint64_t.

section_size_type and section_offset_type are for sections which need
to be loaded into memory, such as merge sections or symtab sections.
I introduced it so that we could use 32-bit sizes on 32-bit hosts,
since that made a measurable improvement in link time.  But there is
no restriction on the size of a section which is not loaded into
memory.

This is different from Output_data::offset(), which is an offset
within the file, and should continue to be off_t.  When off_t is
32-bits then you just can't build a file larger than 4G, and there is
nothing to be done about it.  Of course, the size of a SHT_NOBITS
section could still be larger than 4G.

Ian



More information about the Binutils mailing list