Add comments.
authorRui Ueyama <ruiu@google.com>
Mon, 12 Sep 2016 21:44:29 +0000 (21:44 +0000)
committerRui Ueyama <ruiu@google.com>
Mon, 12 Sep 2016 21:44:29 +0000 (21:44 +0000)
llvm-svn: 281265

lld/ELF/ELFCreator.cpp
lld/ELF/InputFiles.cpp

index 37b7392..43aa4ac 100644 (file)
@@ -6,6 +6,11 @@
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+//
+// This file contains a class to create an ELF file in memory. This is
+// supposed to be used for "-format binary" option.
+//
+//===----------------------------------------------------------------------===//
 
 #include "ELFCreator.h"
 
index 622dec5..e73ac7f 100644 (file)
@@ -733,6 +733,8 @@ static std::unique_ptr<InputFile> createELFFile(MemoryBufferRef MB) {
 }
 
 template <class ELFT> std::unique_ptr<InputFile> BinaryFile::createELF() {
+  // Wrap the binary blob with an ELF header and footer
+  // so that we can link it as a regular ELF file.
   ELFCreator<ELFT> ELF(ET_REL, Config->EMachine);
   auto DataSec = ELF.addSection(".data");
   DataSec.Header->sh_flags = SHF_ALLOC;