[lld] r250296 - ELF2: Remove getAddrSize().

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 07:02:07 PDT 2015


Author: ruiu
Date: Wed Oct 14 09:02:06 2015
New Revision: 250296

URL: http://llvm.org/viewvc/llvm-project?rev=250296&view=rev
Log:
ELF2: Remove getAddrSize().

Modified:
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/OutputSections.h

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=250296&r1=250295&r2=250296&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Wed Oct 14 09:02:06 2015
@@ -34,7 +34,7 @@ GotSection<ELFT>::GotSection()
     : OutputSectionBase<ELFT::Is64Bits>(".got", llvm::ELF::SHT_PROGBITS,
                                         llvm::ELF::SHF_ALLOC |
                                             llvm::ELF::SHF_WRITE) {
-  this->Header.sh_addralign = this->getAddrSize();
+  this->Header.sh_addralign = sizeof(uintX_t);
 }
 
 template <class ELFT> void GotSection<ELFT>::addEntry(SymbolBody *Sym) {
@@ -45,7 +45,7 @@ template <class ELFT> void GotSection<EL
 template <class ELFT>
 typename GotSection<ELFT>::uintX_t
 GotSection<ELFT>::getEntryAddr(const SymbolBody &B) const {
-  return this->getVA() + B.GotIndex * this->getAddrSize();
+  return this->getVA() + B.GotIndex * sizeof(uintX_t);
 }
 
 template <class ELFT> void GotSection<ELFT>::writeTo(uint8_t *Buf) {

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=250296&r1=250295&r2=250296&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Wed Oct 14 09:02:06 2015
@@ -85,8 +85,6 @@ public:
   }
   uint32_t getType() { return Header.sh_type; }
 
-  static unsigned getAddrSize() { return Is64Bits ? 8 : 4; }
-
   virtual void finalize() {}
   virtual void writeTo(uint8_t *Buf) = 0;
 
@@ -105,7 +103,7 @@ class GotSection final : public OutputSe
 public:
   GotSection();
   void finalize() override {
-    this->Header.sh_size = Entries.size() * this->getAddrSize();
+    this->Header.sh_size = Entries.size() * sizeof(uintX_t);
   }
   void writeTo(uint8_t *Buf) override;
   void addEntry(SymbolBody *Sym);




More information about the llvm-commits mailing list