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: jiwang at gcc dot gnu.org
Subject: [Bug ld/20995] Read-only data in ELF libraries may be remapped writable at runtime
Date: Thu, 26 Jan 2017 14:32:44 +0000

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

--- Comment #15 from Jiong Wang <jiwang at gcc dot gnu.org> ---
(In reply to Alan Modra from comment #14)
> 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.

Thanks for the explanation. I kind of understanding this as caused by remapping
of the page which cross text and data twice for different permission.

-- 
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]