This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Last data page not being filled


When a program has (to take a real example) 220 bytes of initialized
data and 444 bytes of zero-filled data, the GNU tools put the 220 bytes
into the data segment and the 444 bytes into the bss segment, frittering
away a page of memory per process. They should instead put all 664 bytes
into the data segment.

The general rule is simple: as long as there's something in bss that
fits into the last page of data, move it to the last page of data and
repeat, unless the user explicitly asks for different behavior.

(The reason I care about a page per process is that I'm building systems
on the scale of ten thousand processes. Each process has its own uid,
and memory protection is crucial, so please don't suggest threads.)

---D. J. Bernstein, Associate Professor, Department of Mathematics,
Statistics, and Computer Science, University of Illinois at Chicago


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]