diff --git a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp index 91a10434b2b221bac945e1a1ce459cc3605286e9..9aeedb70020e38c5d36feee25b57655045e91d09 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");