From 2573039f44d58727421c235dca385589f9246d83 Mon Sep 17 00:00:00 2001From: Zhipeng Xie <xiezhipeng1@huawei.com>Date: 2020年3月12日 06:56:21 -0400Subject: [PATCH 17/38] kpatch-build: add compile flag -fno-reorder-functionsSometimes function foo with static variables can be put in.text.foo section in original binary and be put in.text.unlikely.foo section in patched binary. This will resultin "reference to static local variable xxx in foo was removed"problem because the .text.foo section can not be correlatedto .text.unlikely.foo section by create-diff-object.gcc just put the function in .text.unlikely.xxx section,thesymbol name doesn't change which is different with otheroptimization such as ".constprop/.isra/.part". So disable theoptimization with -fno-reorder-functions just make sure thefunction is placed in .text.xxx section, kernel can still findthe symbol name to patch or relocate.Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>---kpatch-build/kpatch-build | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-buildindex 67e56e1..0431e0b 100755--- a/kpatch-build/kpatch-build+++ b/kpatch-build/kpatch-build@@ -1194,7 +1194,7 @@ if [[ "$ARCH" = "s390x" ]]; thenARCH_KCFLAGS="-mno-pic-data-is-text-relative -fno-section-anchors"fi-export KCFLAGS="-I$DATADIR/patch -ffunction-sections -fdata-sections \+export KCFLAGS="-I$DATADIR/patch -ffunction-sections -fdata-sections -fno-reorder-functions \$ARCH_KCFLAGS $DEBUG_KCFLAGS"echo "Reading special section data"--2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. Open source ecosystem
2. Collaboration, People, Software
3. Evaluation model