This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: x86: Enable -z separate-code by default
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, Michael Matz <matz at suse dot de>
- Cc: nd at arm dot com, Binutils <binutils at sourceware dot org>
- Date: Thu, 19 Jul 2018 13:30:52 +0100
- Subject: Re: RFC: x86: Enable -z separate-code by default
- References: <20180219131555.GA22753@gmail.com> <alpine.LSU.2.21.1802191551410.825@wotan.suse.de> <CAMe9rOo6oV1vr+nTfqDBDUfOQhHQp1uy551Ygt+1R-Cd6j8Cmw@mail.gmail.com> <CAMe9rOqDjktt_aS_pwWeoetsPXN4ZaasfzksQma7-pG_sQfP6g@mail.gmail.com> <alpine.LSU.2.21.1802221315020.10187@wotan.suse.de> <CAMe9rOoDv6cHP1kOjxPL2YwCn-yveQsKtSYAvxt+qaqYAZt9Ag@mail.gmail.com> <CAMe9rOpJCrWtbUEkeoi_nUykS0WCBVwvYcfw3Azdz5r4EAnh=g@mail.gmail.com>
On 22/02/18 17:43, H.J. Lu wrote:
From 5c7e47ff34a11b412a30c1f644f8a4d46074eb50 Mon Sep 17 00:00:00 2001
From: "H.J. Lu"<hjl.tools@gmail.com>
Date: Wed, 14 Feb 2018 04:09:05 -0800
Subject: [PATCH] ld: Add --enable-separate-code
This patch adds --enable-separate-code to ld configure to turn on
-z separate-code by default and enables it by default for Linux/x86.
This avoids mixing code pages with data to improve cache performance
as well as security.
To reduce x86-64 executable and shared object sizes, the maximum page
size is reduced from 2MB to 4KB when -z separate-code is turned on by
default. Note: -z max-page-size= can be used to set the maximum page
size.
We compared SPEC CPU 2017 performance before and after this change on
Skylake server. There are no any significant performance changes.
Everything is mostly below ±1%.
this broke static linking because program headers may no longer
be in a load segment (binutils 2.31 produces broken binaries).
i opened
https://sourceware.org/bugzilla/show_bug.cgi?id=23428