bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/20995] Read-only data in ELF libraries may be remapped writable


From: amodra at gmail dot com
Subject: [Bug ld/20995] Read-only data in ELF libraries may be remapped writable at runtime
Date: Thu, 26 Jan 2017 13:21:02 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=20995

--- Comment #14 from Alan Modra <amodra at gmail dot com> ---
If you define COMMONPAGESIZE, yes, you may waste up to COMMONPAGESIZE extra on
disk in order to *save* memory pages.

To see this, imagine a system where memory pages are 16k and disk pages are 4k.
 Consider a binary with 15k of text and 5k of data.  The classic layout puts
data adjacent to text on disk, thus taking 20k of disk.  In memory text
occupies one page covering base address b to b+15k, while data starts at
b+15k+16k.  This means data takes two 16k memory pages.  If we add a gap of 1k
between text and data, then data only takes one 16k memory page but we now have
21k on disk, or one extra disk page.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]