From 4fa57bf8f0fc12615d1a0eca1acdfa16255e5ebe Mon Sep 17 00:00:00 2001 From: jianghaibo Date: Tue, 8 Jul 2025 09:18:28 +0800 Subject: [PATCH] [BOLT] Fix instrumentation fail for aarch64 kernel5.10 In order to support kernels of different versions and architechures(such as aarch64 linux kernel5.10), we allow the address of the start and stop to be same. --- bolt/lib/Rewrite/LinuxKernelRewriter.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp index 91a10434b2b2..9aeedb70020e 100644 --- a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp +++ b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp @@ -1049,7 +1049,11 @@ Error LinuxKernelRewriter::readStaticCalls() { "no section matching __start_static_call_sites"); StaticCallSection = *ErrorOrSection; - if (!StaticCallSection->containsAddress(Stop->getAddress() - 1)) + // In order to support kernels of different versions and architechures(such as + // aarch64 linux kernel5.10), we allow the address of the start and stop to be + // same. + if (!StaticCallSection->containsAddress(Stop->getAddress() - 1) && + StaticCallTableAddress != Stop->getAddress()) return createStringError(errc::executable_format_error, "__stop_static_call_sites not in the same section " "as __start_static_call_sites"); -- Gitee