2013-01-30 06:03:39 +08:00
|
|
|
//===- lib/ReaderWriter/ELF/DefaultTargetHandler.h ------------------------===//
|
2013-01-25 15:39:18 +08:00
|
|
|
//
|
|
|
|
// The LLVM Linker
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-11-15 11:09:26 +08:00
|
|
|
#ifndef LLD_READER_WRITER_ELF_DEFAULT_TARGET_HANDLER_H
|
|
|
|
#define LLD_READER_WRITER_ELF_DEFAULT_TARGET_HANDLER_H
|
2013-01-30 06:03:39 +08:00
|
|
|
|
|
|
|
#include "DefaultLayout.h"
|
|
|
|
#include "TargetHandler.h"
|
2014-01-27 09:02:03 +08:00
|
|
|
#include "ELFReader.h"
|
2014-01-27 09:20:53 +08:00
|
|
|
#include "DynamicLibraryWriter.h"
|
|
|
|
#include "ExecutableWriter.h"
|
2013-01-25 15:39:18 +08:00
|
|
|
|
2013-08-07 06:31:59 +08:00
|
|
|
#include "lld/ReaderWriter/ELFLinkingContext.h"
|
2013-01-25 15:39:18 +08:00
|
|
|
|
|
|
|
#include "llvm/ADT/Triple.h"
|
|
|
|
#include "llvm/Support/ELF.h"
|
|
|
|
|
|
|
|
namespace lld {
|
|
|
|
namespace elf {
|
|
|
|
template <class ELFT>
|
2013-01-30 06:03:39 +08:00
|
|
|
class DefaultTargetHandler : public TargetHandler<ELFT> {
|
2013-01-25 15:39:18 +08:00
|
|
|
public:
|
2013-08-07 06:31:59 +08:00
|
|
|
DefaultTargetHandler(ELFLinkingContext &context)
|
|
|
|
: TargetHandler<ELFT>(context) {}
|
2013-01-25 15:39:18 +08:00
|
|
|
|
2013-01-30 13:25:44 +08:00
|
|
|
const TargetRelocationHandler<ELFT> &getRelocationHandler() const {
|
|
|
|
llvm_unreachable("Target should provide implementation for function ");
|
|
|
|
}
|
|
|
|
|
2014-01-27 09:02:03 +08:00
|
|
|
virtual std::unique_ptr<Reader> getObjReader(bool atomizeStrings) {
|
|
|
|
return std::unique_ptr<Reader>(new ELFObjectReader(atomizeStrings));
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual std::unique_ptr<Reader> getDSOReader(bool useShlibUndefines) {
|
|
|
|
return std::unique_ptr<Reader>(new ELFDSOReader(useShlibUndefines));
|
|
|
|
}
|
|
|
|
|
2014-01-27 09:21:02 +08:00
|
|
|
virtual std::unique_ptr<Writer> getWriter() = 0;
|
2013-01-25 15:39:18 +08:00
|
|
|
};
|
2014-01-27 09:20:53 +08:00
|
|
|
|
2013-01-30 06:03:39 +08:00
|
|
|
} // end namespace elf
|
|
|
|
} // end namespace lld
|
2013-01-25 15:39:18 +08:00
|
|
|
#endif
|