llvmbot wrote:
@llvm/pr-subscribers-bolt
Author: Amir Ayupov (aaupov)
Changes
getSignedValueAtAddress calls DataExtractor::getSigned which naturally
returns a signed value.
Test Plan: NFCI
---
Full diff: https://github.com/llvm/llvm-project/pull/91664.diff
3 Files Affected:
- (modified) bolt/include/bolt/Core/BinaryContext.h (+1-2)
- (modified) bolt/lib/Core/BinaryContext.cpp (+1-1)
- (modified) bolt/lib/Rewrite/LinuxKernelRewriter.cpp (+1-1)
``diff
diff --git a/bolt/include/bolt/Core/BinaryContext.h
b/bolt/include/bolt/Core/BinaryContext.h
index 75765819ac464..4a59a581dfedb 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -1217,8 +1217,7 @@ class BinaryContext {
/// Return a signed value of \p Size stored at \p Address. The address has
/// to be a valid statically allocated address for the binary.
- ErrorOr getSignedValueAtAddress(uint64_t Address,
-size_t Size) const;
+ ErrorOr getSignedValueAtAddress(uint64_t Address, size_t Size)
const;
/// Special case of getUnsignedValueAtAddress() that uses a pointer size.
ErrorOr getPointerAtAddress(uint64_t Address) const {
diff --git a/bolt/lib/Core/BinaryContext.cpp b/bolt/lib/Core/BinaryContext.cpp
index ad2eb18caf109..507b203ea9d8b 100644
--- a/bolt/lib/Core/BinaryContext.cpp
+++ b/bolt/lib/Core/BinaryContext.cpp
@@ -2212,7 +2212,7 @@ ErrorOr
BinaryContext::getUnsignedValueAtAddress(uint64_t Address,
return DE.getUnsigned(&ValueOffset, Size);
}
-ErrorOr BinaryContext::getSignedValueAtAddress(uint64_t Address,
+ErrorOr BinaryContext::getSignedValueAtAddress(uint64_t Address,
size_t Size) const {
const ErrorOr Section = getSectionForAddress(Address);
if (!Section)
diff --git a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp
b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp
index 99775ccfe38d3..b2c8b2446f7e1 100644
--- a/bolt/lib/Rewrite/LinuxKernelRewriter.cpp
+++ b/bolt/lib/Rewrite/LinuxKernelRewriter.cpp
@@ -393,7 +393,7 @@ void LinuxKernelRewriter::processLKKSymtab(bool IsGPL) {
for (uint64_t I = 0; I < SectionSize; I += 4) {
const uint64_t EntryAddress = SectionAddress + I;
-ErrorOr Offset = BC.getSignedValueAtAddress(EntryAddress, 4);
+ErrorOr Offset = BC.getSignedValueAtAddress(EntryAddress, 4);
assert(Offset && "Reading valid PC-relative offset for a ksymtab entry");
const int32_t SignedOffset = *Offset;
const uint64_t RefAddress = EntryAddress + SignedOffset;
``
https://github.com/llvm/llvm-project/pull/91664
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits