[lld] r281265 - Add comments.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 12 14:44:30 PDT 2016
Author: ruiu
Date: Mon Sep 12 16:44:29 2016
New Revision: 281265
URL: http://llvm.org/viewvc/llvm-project?rev=281265&view=rev
Log:
Add comments.
Modified:
lld/trunk/ELF/ELFCreator.cpp
lld/trunk/ELF/InputFiles.cpp
Modified: lld/trunk/ELF/ELFCreator.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ELFCreator.cpp?rev=281265&r1=281264&r2=281265&view=diff
==============================================================================
--- lld/trunk/ELF/ELFCreator.cpp (original)
+++ lld/trunk/ELF/ELFCreator.cpp Mon Sep 12 16:44:29 2016
@@ -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"
Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=281265&r1=281264&r2=281265&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Mon Sep 12 16:44:29 2016
@@ -733,6 +733,8 @@ static std::unique_ptr<InputFile> create
}
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;
More information about the llvm-commits
mailing list