[patch] Fix PR 84487, large rodata increase in tonto and other programs

Segher Boessenkool segher@kernel.crashing.org
Tue Apr 16 10:16:00 GMT 2019


On Tue, Apr 16, 2019 at 11:33:39AM +0200, Florian Weimer wrote:
> * Segher Boessenkool:
> 
> > On Mon, Apr 15, 2019 at 01:54:11PM +0200, Florian Weimer wrote:
> >> * Richard Biener:
> >> 
> >> > Of course adding sth like a .robss section would be nice.
> >> 
> >> I think this is strictly a link editor issue because a read-only PT_LOAD
> >> directive with a memory size larger than the file size already produces
> >> read-only zero pages, without requiring a file allocation.
> >
> > But .rodata normally is not the last thing in its segment (the .eh*
> > things are after it, and those are usually not all zero).
> 
> If you don't mind the proliferation of load segments (we've add many of
> them in recent years), placement does not matter.

Many (or at least some) ABIs have requirements wrt placement, and number
and kind of segments even.

Is there any disadvantage to having a .robss section (that is mapped at the
end of the text segment, or some other r/o segment, so that its data does
not have to exist in object and executable files)?


Segher



More information about the Gcc-patches mailing list