Files
llvm/lld/lib/Core/TargetInfo.cpp
Shankar Easwaran eeee23e60a This adds functionality for undefined atoms from dynamic libraries to be added
to the list of undefined atoms. 

The processing of undefined atoms from dynamic libraries is controlled by
use-shlib-undefines command line option. 

This patch also adds additional command line arguments to allow/disallow
unresolved symbols from shared libraries and mimics GNU ld behavior.

llvm-svn: 179257
2013-04-11 02:56:30 +00:00

52 lines
1.6 KiB
C++

//===- lib/Core/TargetInfo.cpp - Linker Target Info Interface -------------===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lld/Core/TargetInfo.h"
#include "lld/ReaderWriter/Writer.h"
#include "llvm/ADT/Triple.h"
namespace lld {
TargetInfo::TargetInfo()
: Reader(*this), _deadStrip(false), _globalsAreDeadStripRoots(false),
_searchArchivesToOverrideTentativeDefinitions(false),
_searchSharedLibrariesToOverrideTentativeDefinitions(false),
_warnIfCoalesableAtomsHaveDifferentCanBeNull(false),
_warnIfCoalesableAtomsHaveDifferentLoadName(false),
_forceLoadAllArchives(false), _printRemainingUndefines(true),
_allowRemainingUndefines(false), _logInputFiles(false),
_allowShlibUndefines(false) {}
TargetInfo::~TargetInfo() {}
error_code TargetInfo::readFile(StringRef path,
std::vector<std::unique_ptr<File>> &result) const {
OwningPtr<llvm::MemoryBuffer> opmb;
if (error_code ec = llvm::MemoryBuffer::getFileOrSTDIN(path, opmb))
return ec;
std::unique_ptr<MemoryBuffer> mb(opmb.take());
return this->parseFile(mb, result);
}
error_code TargetInfo::writeFile(const File &linkedFile) const {
return this->writer().writeFile(linkedFile, _outputPath);
}
void TargetInfo::addImplicitFiles(InputFiles& inputs) const {
this->writer().addFiles(inputs);
}
void TargetInfo::addPasses(PassManager &pm) const {
}
} // end namespace lld