[llvm] 7ff2dc3 - [profgen] Use a 64bit integer for &'ing the loadable address (#79930)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 10:10:26 PST 2024


Author: Nathan Lanza
Date: 2024-01-30T13:10:22-05:00
New Revision: 7ff2dc3b49eee49edf9a2c2c7051d643c38e21b1

URL: https://github.com/llvm/llvm-project/commit/7ff2dc3b49eee49edf9a2c2c7051d643c38e21b1
DIFF: https://github.com/llvm/llvm-project/commit/7ff2dc3b49eee49edf9a2c2c7051d643c38e21b1.diff

LOG: [profgen] Use a 64bit integer for &'ing the loadable address (#79930)

For the linux kernel, the loadable segments start at 0xffff... and thus
the 32 bit integer here was truncating all the meaningful bits. Grow it
to 64 bits.

Added: 
    

Modified: 
    llvm/tools/llvm-profgen/ProfiledBinary.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-profgen/ProfiledBinary.cpp b/llvm/tools/llvm-profgen/ProfiledBinary.cpp
index b40c5f8cbbe06..f62228627b8f1 100644
--- a/llvm/tools/llvm-profgen/ProfiledBinary.cpp
+++ b/llvm/tools/llvm-profgen/ProfiledBinary.cpp
@@ -317,7 +317,7 @@ void ProfiledBinary::setPreferredTextSegmentAddresses(const ELFFile<ELFT> &Obj,
   // However such info isn't available at post-processing time, assuming
   // 4K page now. Note that we don't use EXEC_PAGESIZE from <linux/param.h>
   // because we may build the tools on non-linux.
-  uint32_t PageSize = 0x1000;
+  uint64_t PageSize = 0x1000;
   for (const typename ELFT::Phdr &Phdr : PhdrRange) {
     if (Phdr.p_type == ELF::PT_LOAD) {
       if (!FirstLoadableAddress)


        


More information about the llvm-commits mailing list