1//===- DynObjWriter.h -----------------------------------------------------===//
2//
3//                     The MCLinker Project
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9#ifndef MCLD_DYNAMIC_SHARED_OBJECT_WRITER_H
10#define MCLD_DYNAMIC_SHARED_OBJECT_WRITER_H
11#ifdef ENABLE_UNITTEST
12#include <gtest.h>
13#endif
14#include <mcld/MC/MCLDOutput.h>
15#include <mcld/LD/LDWriter.h>
16#include <llvm/Support/system_error.h>
17
18namespace mcld
19{
20
21/** \class DynObjWriter
22 *  \brief DynObjWriter provides an common interface for different object
23 *  formats.
24 */
25class DynObjWriter : public LDWriter
26{
27protected:
28  // force to have a TargetLDBackend
29  DynObjWriter(TargetLDBackend& pLDBackend)
30  { }
31
32public:
33  virtual ~DynObjWriter() { }
34
35  virtual llvm::error_code writeDynObj(Output& pOutput) = 0;
36};
37
38} // namespace of mcld
39
40#endif
41
42