/// This method is called by core linking to give the Writer a chance
/// to add file format specific "files" to set of files to be linked. This is
/// how file format specific atoms can be added to the link.
- virtual bool createImplicitFiles(std::vector<std::unique_ptr<File> > &);
+ virtual void createImplicitFiles(std::vector<std::unique_ptr<File>> &);
/// This method is called by core linking to build the list of Passes to be
/// run on the merged/linked graph of all input files.
/// \brief This method is called by Core Linking to give the Writer a chance
/// to add file format specific "files" to set of files to be linked. This is
/// how file format specific atoms can be added to the link.
- virtual bool createImplicitFiles(std::vector<std::unique_ptr<File> > &);
+ virtual void createImplicitFiles(std::vector<std::unique_ptr<File>> &) {}
protected:
// only concrete subclasses can be instantiated
bool validateImpl(raw_ostream &diagnostics) override;
std::string demangle(StringRef symbolName) const override;
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
uint32_t getCPUType() const;
uint32_t getCPUSubType() const;
void addPasses(PassManager &pm) override;
- bool createImplicitFiles(
- std::vector<std::unique_ptr<File> > &result) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &result) override;
bool is64Bit() const {
return _machineType == llvm::COFF::IMAGE_FILE_MACHINE_AMD64;
return this->writer().writeFile(linkedFile, _outputPath);
}
-bool LinkingContext::createImplicitFiles(
- std::vector<std::unique_ptr<File> > &result) {
- return this->writer().createImplicitFiles(result);
+void LinkingContext::createImplicitFiles(
+ std::vector<std::unique_ptr<File>> &result) {
+ this->writer().createImplicitFiles(result);
}
std::unique_ptr<File> LinkingContext::createEntrySymbolFile() const {
Writer::~Writer() {
}
-
-bool Writer::createImplicitFiles(std::vector<std::unique_ptr<File> > &) {
- return true;
-}
} // end namespace lld
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override {
return DynamicLibraryWriter<ELFT>::finalizeDefaultAtomValues();
_ctx(ctx), _layout(layout) {}
template <class ELFT>
-bool AArch64DynamicLibraryWriter<ELFT>::createImplicitFiles(
+void AArch64DynamicLibraryWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
DynamicLibraryWriter<ELFT>::createImplicitFiles(result);
_gotFile->addAtom(*new (_gotFile->_alloc) GlobalOffsetTableAtom(*_gotFile));
_gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile));
result.push_back(std::move(_gotFile));
- return true;
}
} // namespace elf
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override {
return ExecutableWriter<ELFT>::finalizeDefaultAtomValues();
_ctx(ctx), _layout(layout) {}
template <class ELFT>
-bool AArch64ExecutableWriter<ELFT>::createImplicitFiles(
+void AArch64ExecutableWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
ExecutableWriter<ELFT>::createImplicitFiles(result);
_gotFile->addAtom(*new (_gotFile->_alloc) GlobalOffsetTableAtom(*_gotFile));
if (_ctx.isDynamic())
_gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile));
result.push_back(std::move(_gotFile));
- return true;
}
} // namespace elf
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override;
: ExecutableWriter<ELFT>(ctx, layout), _ctx(ctx), _armLayout(layout) {}
template <class ELFT>
-bool ARMExecutableWriter<ELFT>::createImplicitFiles(
+void ARMExecutableWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
ExecutableWriter<ELFT>::createImplicitFiles(result);
- return true;
}
template <class ELFT>
protected:
void buildDynamicSymbolTable(const File &file) override;
void addDefaultAtoms() override;
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override;
protected:
/// \brief Hook in lld to add CRuntime file
template <class ELFT>
-bool DynamicLibraryWriter<ELFT>::createImplicitFiles(
+void DynamicLibraryWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File> > &result) {
// Add the default atoms as defined by executables
DynamicLibraryWriter<ELFT>::addDefaultAtoms();
OutputELFWriter<ELFT>::createImplicitFiles(result);
result.push_back(std::move(_runtimeFile));
- return true;
}
template <class ELFT>
protected:
void buildDynamicSymbolTable(const File &file) override;
void addDefaultAtoms() override;
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override;
void createDefaultSections() override;
/// \brief Hook in lld to add CRuntime file
template <class ELFT>
-bool ExecutableWriter<ELFT>::createImplicitFiles(
+void ExecutableWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File> > &result) {
// Add the default atoms as defined by executables
ExecutableWriter<ELFT>::addDefaultAtoms();
OutputELFWriter<ELFT>::createImplicitFiles(result);
result.push_back(std::move(_runtimeFile));
- return true;
}
template <class ELFT> void ExecutableWriter<ELFT>::createDefaultSections() {
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override;
_runtimeFile(new HexagonRuntimeFile<ELFT>(ctx)) {}
template <class ELFT>
-bool HexagonDynamicLibraryWriter<ELFT>::createImplicitFiles(
+void HexagonDynamicLibraryWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
DynamicLibraryWriter<ELFT>::createImplicitFiles(result);
// Add the default atoms as defined for hexagon
addDefaultAtoms();
result.push_back(std::move(_runtimeFile));
- return true;
}
template <class ELFT>
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override;
_runtimeFile(new HexagonRuntimeFile<ELFT>(ctx)) {}
template <class ELFT>
-bool HexagonExecutableWriter<ELFT>::createImplicitFiles(
+void HexagonExecutableWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
ExecutableWriter<ELFT>::createImplicitFiles(result);
// Add the default atoms as defined for hexagon
addDefaultAtoms();
result.push_back(std::move(_runtimeFile));
- return true;
}
template <class ELFT>
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override;
void createDefaultSections() override;
_targetLayout(layout) {}
template <class ELFT>
-bool MipsDynamicLibraryWriter<ELFT>::createImplicitFiles(
+void MipsDynamicLibraryWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
DynamicLibraryWriter<ELFT>::createImplicitFiles(result);
result.push_back(std::move(_writeHelper.createRuntimeFile()));
- return true;
}
template <class ELFT>
void buildDynamicSymbolTable(const File &file) override;
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override;
void createDefaultSections() override;
}
template <class ELFT>
-bool MipsExecutableWriter<ELFT>::createImplicitFiles(
+void MipsExecutableWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
ExecutableWriter<ELFT>::createImplicitFiles(result);
result.push_back(std::move(_writeHelper.createRuntimeFile()));
- return true;
}
template <class ELFT>
virtual void addDefaultAtoms();
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
// Finalize the default atom values
virtual void finalizeDefaultAtomValues();
}
template <class ELFT>
-bool OutputELFWriter<ELFT>::createImplicitFiles(
+void OutputELFWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
// Add the virtual archive to resolve undefined symbols.
// The file will be added later in the linking context.
llvm::make_unique<DynamicSymbolFile<ELFT>>(ctx, std::move(callback)));
// Add script defined symbols
result.push_back(std::move(_scriptFile));
- return true;
}
template <class ELFT>
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override {
return DynamicLibraryWriter<ELFT>::finalizeDefaultAtomValues();
_ctx(ctx), _layout(layout) {}
template <class ELFT>
-bool X86DynamicLibraryWriter<ELFT>::createImplicitFiles(
+void X86DynamicLibraryWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
DynamicLibraryWriter<ELFT>::createImplicitFiles(result);
_gotFile->addAtom(*new (_gotFile->_alloc) GlobalOffsetTableAtom(*_gotFile));
_gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile));
result.push_back(std::move(_gotFile));
- return true;
}
} // namespace elf
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override {
return ExecutableWriter<ELFT>::finalizeDefaultAtomValues();
: ExecutableWriter<ELFT>(ctx, layout), _ctx(ctx), _layout(layout) {}
template <class ELFT>
-bool X86ExecutableWriter<ELFT>::createImplicitFiles(
+void X86ExecutableWriter<ELFT>::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
ExecutableWriter<ELFT>::createImplicitFiles(result);
- return true;
}
} // namespace elf
protected:
// Add any runtime files and their atoms to the output
- bool createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &) override;
void finalizeDefaultAtomValues() override {
return DynamicLibraryWriter::finalizeDefaultAtomValues();
X86_64LinkingContext &ctx, X86_64TargetLayout &layout)
: DynamicLibraryWriter(ctx, layout), _gotFile(new GOTFile(ctx)) {}
-bool X86_64DynamicLibraryWriter::createImplicitFiles(
+void X86_64DynamicLibraryWriter::createImplicitFiles(
std::vector<std::unique_ptr<File>> &result) {
DynamicLibraryWriter::createImplicitFiles(result);
_gotFile->addAtom(*new (_gotFile->_alloc) GlobalOffsetTableAtom(*_gotFile));
_gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile));
result.push_back(std::move(_gotFile));
- return true;
}
} // namespace elf
protected:
// Add any runtime files and their atoms to the output
- bool
+ void
createImplicitFiles(std::vector<std::unique_ptr<File>> &result) override {
ExecutableWriter::createImplicitFiles(result);
_gotFile->addAtom(*new (_gotFile->_alloc)
if (_ctx.isDynamic())
_gotFile->addAtom(*new (_gotFile->_alloc) DynamicAtom(*_gotFile));
result.push_back(std::move(_gotFile));
- return true;
}
void finalizeDefaultAtomValues() override {
return 0x1000; // 1.0
}
-bool MachOLinkingContext::createImplicitFiles(
+void MachOLinkingContext::createImplicitFiles(
std::vector<std::unique_ptr<File> > &result) {
// Add indirect dylibs by asking each linked dylib to add its indirects.
// Iterate until no more dylibs get loaded.
}
// Let writer add output type specific extras.
- return writer().createImplicitFiles(result);
+ writer().createImplicitFiles(result);
}
return writeBinary(*nFile->get(), path);
}
- bool createImplicitFiles(std::vector<std::unique_ptr<File> > &r) override {
+ void createImplicitFiles(std::vector<std::unique_ptr<File>> &r) override {
// When building main executables, add _main as required entry point.
if (_context.outputTypeHasEntry())
r.emplace_back(new CEntryFile(_context));
// Final linked images can access a symbol for their mach_header.
if (_context.outputMachOType() != llvm::MachO::MH_OBJECT)
r.emplace_back(new MachHeaderAliasFile(_context));
-
- return true;
}
private:
const MachOLinkingContext &_context;
currentGroupEnd->getSize() + 1);
}
-bool PECOFFLinkingContext::createImplicitFiles(
+void PECOFFLinkingContext::createImplicitFiles(
std::vector<std::unique_ptr<File>> &) {
std::vector<std::unique_ptr<Node>> &members = getNodes();
std::unique_ptr<FileNode> exportNode(new FileNode(
llvm::make_unique<pecoff::ExportedSymbolRenameFile>(*this)));
addLibraryFile(std::move(exportNode));
-
- return true;
}
/// Returns the section name in the resulting executable.