[PATCH] D11267: LLD: Add AMDGPU ELF ReaderWriter

Tom Stellard thomas.stellard at amd.com
Wed Aug 5 11:39:59 PDT 2015


tstellarAMD marked 12 inline comments as done.

================
Comment at: lib/ReaderWriter/ELF/AMDGPU/AMDGPUExecutableWriter.cpp:18-33
@@ +17,17 @@
+
+void AMDGPUExecutableWriter::createImplicitFiles(
+    std::vector<std::unique_ptr<File>> &Result) {
+  // ExecutableWriter::createImplicitFiles() adds C runtime symbols that we
+  // don't need, so we use the OutputELFWriter implementation instead.
+  OutputELFWriter<ELF64LE>::createImplicitFiles(Result);
+}
+
+void AMDGPUExecutableWriter::finalizeDefaultAtomValues() {
+
+  // ExecutableWriter::finalizeDefaultAtomValues() assumes the presence of
+  // C runtime symbols.  However, since we skip the call to
+  // ExecutableWriter::createImplicitFiles(), these symbols are never added
+  // and ExectuableWriter::finalizeDefaultAtomValues() will crash if we call
+  // it.
+  OutputELFWriter<ELF64LE>::finalizeDefaultAtomValues();
+}
----------------
atanasyan wrote:
> These methods do nothing now. I suggest to remove them from this commit and add later if necessary.
These functions are actually calling the implementation of the parent class's parent instead of the parent's.  This is done to avoid having c runtime symbols added to the binary.




http://reviews.llvm.org/D11267





More information about the llvm-commits mailing list