[lld] 213896b - [ELF] Remove unused InputSection::getOffsetInFile

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 26 15:19:01 PST 2021


Author: Fangrui Song
Date: 2021-12-26T15:18:56-08:00
New Revision: 213896bc5aea019c0c776a069f54d23febe4e807

URL: https://github.com/llvm/llvm-project/commit/213896bc5aea019c0c776a069f54d23febe4e807
DIFF: https://github.com/llvm/llvm-project/commit/213896bc5aea019c0c776a069f54d23febe4e807.diff

LOG: [ELF] Remove unused InputSection::getOffsetInFile

Added: 
    

Modified: 
    lld/ELF/InputSection.cpp
    lld/ELF/InputSection.h

Removed: 
    


################################################################################
diff  --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 6d26e19aac48..76a29b034146 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -153,12 +153,6 @@ void InputSectionBase::uncompress() const {
   uncompressedSize = -1;
 }
 
-uint64_t InputSectionBase::getOffsetInFile() const {
-  const uint8_t *fileStart = (const uint8_t *)file->mb.getBufferStart();
-  const uint8_t *secStart = data().begin();
-  return secStart - fileStart;
-}
-
 template <class ELFT> RelsOrRelas<ELFT> InputSectionBase::relsOrRelas() const {
   if (relSecIdx == 0)
     return {};

diff  --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 5319830b5d80..cbb060fd2740 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -156,8 +156,6 @@ class InputSectionBase : public SectionBase {
     return rawData;
   }
 
-  uint64_t getOffsetInFile() const;
-
   // Input sections are part of an output section. Special sections
   // like .eh_frame and merge sections are first combined into a
   // synthetic section that is then added to an output section. In all


        


More information about the llvm-commits mailing list