This adds the LinkingContext parameter to the ELFReader. Previously the flags in that were needed in the Context was passed to the ELFReader, this made it very hard to access data structures in the LinkingContext when reading an ELF file. This change makes the ELFReader more flexible so that required parameters can be grabbed directly from the LinkingContext. Future patches make use of the changes. There is no change in functionality though. llvm-svn: 228905
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
//===- lib/ReaderWriter/ELF/DefaultTargetHandler.h ------------------------===//
|
|
//
|
|
// The LLVM Linker
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLD_READER_WRITER_ELF_DEFAULT_TARGET_HANDLER_H
|
|
#define LLD_READER_WRITER_ELF_DEFAULT_TARGET_HANDLER_H
|
|
|
|
#include "DefaultLayout.h"
|
|
#include "DynamicLibraryWriter.h"
|
|
#include "ELFReader.h"
|
|
#include "ExecutableWriter.h"
|
|
#include "TargetHandler.h"
|
|
#include "lld/ReaderWriter/ELFLinkingContext.h"
|
|
#include "llvm/ADT/Triple.h"
|
|
#include "llvm/Support/ELF.h"
|
|
|
|
namespace lld {
|
|
namespace elf {
|
|
template <class ELFT>
|
|
class DefaultTargetHandler : public TargetHandler<ELFT> {
|
|
public:
|
|
const TargetRelocationHandler &getRelocationHandler() const = 0;
|
|
|
|
virtual std::unique_ptr<Reader> getObjReader() = 0;
|
|
|
|
virtual std::unique_ptr<Reader> getDSOReader() = 0;
|
|
|
|
virtual std::unique_ptr<Writer> getWriter() = 0;
|
|
};
|
|
|
|
} // end namespace elf
|
|
} // end namespace lld
|
|
#endif
|