!786 add Wl,-z,noseparate-code for so

From: @zhangnaichuan 
Reviewed-by: @yang_yanchao 
Signed-off-by: @yang_yanchao
This commit is contained in:
openeuler-ci-bot 2024-04-18 12:44:50 +00:00 committed by Gitee
commit 4d5463ec3f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,29 @@
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/
---
sysdeps/x86_64/Makeconfig | 1 +
1 file changed, 1 insertion(+)
create mode 100644 sysdeps/x86_64/Makeconfig
diff --git a/sysdeps/x86_64/Makeconfig b/sysdeps/x86_64/Makeconfig
new file mode 100644
index 00000000..5f544fd7
--- /dev/null
+++ b/sysdeps/x86_64/Makeconfig
@@ -0,0 +1 @@
+relro-LDFLAGS = -Wl,-z,relro -Wl,-z,noseparate-code
--
2.33.0

View File

@ -67,7 +67,7 @@
############################################################################## ##############################################################################
Name: glibc Name: glibc
Version: 2.38 Version: 2.38
Release: 24 Release: 25
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/
@ -196,6 +196,7 @@ Patch9019: 0001-fix-glibc-build-error-on-x86.patch
%if %{ENABLE_RELOC} %if %{ENABLE_RELOC}
Patch9021: reserve-relocation-information-for-sysboost.patch Patch9021: reserve-relocation-information-for-sysboost.patch
%endif %endif
Patch9022: add-Wl-z-noseparate-code-for-so.patch
Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) Provides: ldconfig rtld(GNU_HASH) bundled(gnulib)
@ -1392,6 +1393,9 @@ fi
%endif %endif
%changelog %changelog
* Thu Apr 18 2024 zhangnaichuan <zhangnaichuan@huawei.com> - 2.38-25
- add Wl,-z,noseparate-code for so
* Tue Apr 9 2024 yangpan <yangpan51@huawei.com> - 2.38-24 * Tue Apr 9 2024 yangpan <yangpan51@huawei.com> - 2.38-24
- disable sysboost - disable sysboost