[lld] r197020 - [PECOFF] Writer: Remove rawSize().

Rui Ueyama ruiu at google.com
Wed Dec 11 01:00:08 PST 2013


Author: ruiu
Date: Wed Dec 11 03:00:08 2013
New Revision: 197020

URL: http://llvm.org/viewvc/llvm-project?rev=197020&view=rev
Log:
[PECOFF] Writer: Remove rawSize().

Because sections no longer have trailing NULL bytes, size() and rawSize() now
return the same value.

Modified:
    lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp

Modified: lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp?rev=197020&r1=197019&r2=197020&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp (original)
+++ lld/trunk/lib/ReaderWriter/PECOFF/WriterPECOFF.cpp Wed Dec 11 03:00:08 2013
@@ -240,8 +240,6 @@ class SectionChunk : public AtomChunk {
 public:
   virtual uint64_t align() const { return SECTOR_SIZE; }
 
-  virtual uint64_t rawSize() const { return _size; }
-
   void appendAtom(const DefinedAtom *atom);
   uint32_t getCharacteristics() const { return _characteristics; }
   StringRef getSectionName() const { return _sectionName; }
@@ -668,7 +666,7 @@ SectionHeaderTableChunk::createSectionHe
     header.VirtualSize = 0;
     header.PointerToRawData = 0;
   } else {
-    header.VirtualSize = chunk->rawSize();
+    header.VirtualSize = chunk->size();
     header.PointerToRawData = chunk->fileOffset();
   }
   return header;
@@ -874,7 +872,7 @@ void ExecutableWriter::build(const File
       addSectionChunk(baseReloc, sectionTable);
       dataDirectory->setField(DataDirectoryIndex::BASE_RELOCATION_TABLE,
                               baseReloc->getVirtualAddress(),
-                              baseReloc->rawSize());
+                              baseReloc->size());
     }
   }
 
@@ -892,10 +890,10 @@ void ExecutableWriter::build(const File
       peHeader->setBaseOfData(section->getVirtualAddress());
     if (section->getSectionName() == ".idata.a")
       dataDirectory->setField(DataDirectoryIndex::IAT,
-                              section->getVirtualAddress(), section->rawSize());
+                              section->getVirtualAddress(), section->size());
     if (section->getSectionName() == ".idata.d")
       dataDirectory->setField(DataDirectoryIndex::IMPORT_TABLE,
-                              section->getVirtualAddress(), section->rawSize());
+                              section->getVirtualAddress(), section->size());
   }
 
   // Now that we know the size and file offset of sections. Set the file





More information about the llvm-commits mailing list