This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ld: Default the maximum page size to the common page size for -z separate-code
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 12 Jan 2018 03:39:33 -0800
- Subject: Re: [PATCH] ld: Default the maximum page size to the common page size for -z separate-code
- Authentication-results: sourceware.org; auth=none
- References: <20180112051319.GA27519@gmail.com> <20180112055526.GH20622@bubble.grove.modra.org>
On Thu, Jan 11, 2018 at 9:55 PM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Jan 11, 2018 at 09:13:19PM -0800, H.J. Lu wrote:
>> When -z separate-code is used, code segment is aligned and padded to
>> the maximum page size on disk. This patch defaults the maximum page
>> size to the common page size for -z separate-code to reduce file size.
>
> I think this is a bad idea. Options should have as few magical
> side-effects as possible. If you want -z separate-code to align to
> common-page-size, then do that in the script (and document in
> ld.texinfo that code separation is only effective for system page size
> up to common-page-size, like -z relro).
>
RELRO segment is optional. Ignoring it at run-time won't crash
the program.
How about adding ELF_MAXCODEPAGESIZE which defaults to
ELF_COMMONPAGESIZE and -z max-code-page-size?
--
H.J.