bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/24490] -z max-page-size=0x200000 -z separate-code creates huge b


From: amodra at gmail dot com
Subject: [Bug ld/24490] -z max-page-size=0x200000 -z separate-code creates huge binary
Date: Thu, 02 May 2019 05:05:49 +0000

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

Alan Modra <amodra at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at gmail dot com

--- Comment #1 from Alan Modra <amodra at gmail dot com> ---
If you specify -z max-page-size=0x200000 then there is an expectation that the
binary produced will work with an actual hardware page size of 0x200000.  If ld
were instead to use minpagesize then the binary may not even run when the
hardware page size is 0x200000, and certainly won't have the page protection
you expect with -z separate-code.

I don't see any way around this.  As ld.text says of -z separate-code:
"Create separate code @code{PT_LOAD} segment header in the object.  This
specifies a memory segment that should contain only instructions and must
be in wholly disjoint pages from any other data."  The presumption here is that
data can't appear in the text memory pages.  So you can't use tricks like that
done between rodata and data by DATA_SEGMENT_ALIGN (ie. starting rw data at the
end of ro data but on the next page in order to save disk), because that allows
part of rw data to leak into ro data and vice versa.

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