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.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to