!624 [sync] PR-605: x86: add noseparate-code for bash program performance

From: @openeuler-sync-bot 
Reviewed-by: @yang_yanchao 
Signed-off-by: @yang_yanchao
This commit is contained in:
openeuler-ci-bot 2023-07-04 01:54:48 +00:00 committed by Gitee
commit c90d33ebd6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,34 @@
From 2eb52cc0dd1ce02871d4f863649a8656831805c7 Mon Sep 17 00:00:00 2001
From: hongrongxuan <hongrongxuan@huawei.com>
Date: Tue, 25 Oct 2022 21:24:21 +0800
Subject: [PATCH] add Wl,-z,noseparate-code for so
binutils 2.31 add a separate-code(default)/noseparate-code link option to separate
.rodata from .text segment. Cause this is a dubious feature that intends to
reduce the number of ROP gadgets, and this will reduce batch program's
performance, like unixbench shell program, it will reduce 8%~10%. So
add 'Wl,-z,noseparate-code' to disable this feature.
Refrences:
https://sourceware.org/pipermail/binutils/2018-February/101950.html
https://reviews.llvmm.org/D64903
https://packagehub.suse.com/packages/binutils/2_37-1050100_7_34_1/
---
Makeconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makeconfig b/Makeconfig
index 92e76d62..28cea3de 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -366,7 +366,7 @@ LDFLAGS.so += $(combreloc-LDFLAGS)
LDFLAGS-rtld += $(combreloc-LDFLAGS)
endif
-relro-LDFLAGS = -Wl,-z,relro
+relro-LDFLAGS = -Wl,-z,relro -Wl,-z,noseparate-code
LDFLAGS.so += $(relro-LDFLAGS)
LDFLAGS-rtld += $(relro-LDFLAGS)
--
2.27.0

View File

@ -36,6 +36,10 @@
%bcond_without compat_2_17 %bcond_without compat_2_17
%endif %endif
%ifarch x86_64
%bcond_without noseparate_code
%endif
%ifarch %{valgrind_arches} %ifarch %{valgrind_arches}
%bcond_without valgrind %bcond_without valgrind
%else %else
@ -66,7 +70,7 @@
############################################################################## ##############################################################################
Name: glibc Name: glibc
Version: 2.34 Version: 2.34
Release: 122 Release: 123
Summary: The GNU libc libraries Summary: The GNU libc libraries
License: %{all_license} License: %{all_license}
URL: http://www.gnu.org/software/glibc/ URL: http://www.gnu.org/software/glibc/
@ -309,6 +313,10 @@ Patch9038: elf-ld.so-prohibit-multiple-i-options-and-do-not-allow-i-speci.patch
Patch9039: elf-ld.so-Consider-maybe-existing-hole-between-PT_LO.patch Patch9039: elf-ld.so-Consider-maybe-existing-hole-between-PT_LO.patch
Patch9040: add-GB18030-2022-charmap.patch Patch9040: add-GB18030-2022-charmap.patch
%if %{with noseparate_code}
Patch9041: add-Wl-z-noseparate-code-for-so.patch
%endif
Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) Provides: ldconfig rtld(GNU_HASH) bundled(gnulib)
BuildRequires: audit-libs-devel >= 1.1.3, sed >= 3.95, libcap-devel, gettext BuildRequires: audit-libs-devel >= 1.1.3, sed >= 3.95, libcap-devel, gettext
@ -1473,6 +1481,9 @@ fi
%endif %endif
%changelog %changelog
* Sun Jun 4 2023 Qingqing Li <liqingqing3@huawei.com> - 2.34-123
- x86: add noseparate-code for bash program performance
* Mon May 29 2023 Qingqing Li <liqingqing3@huawei.com> - 2.34-122 * Mon May 29 2023 Qingqing Li <liqingqing3@huawei.com> - 2.34-122
- locale: reduce the size of locale C.utf-8 - locale: reduce the size of locale C.utf-8