summaryrefslogtreecommitdiff
path: root/include/mcld/LD/ELFObjectWriter.h
blob: a6b9a87d3410dc421e6d09f34b20c3205ca1755d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//===- ELFObjectWriter.h --------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_ELF_OBJECT_WRITER_H
#define MCLD_ELF_OBJECT_WRITER_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
#include <llvm/Support/system_error.h>
#include <mcld/LD/ObjectWriter.h>
#include <mcld/LD/ELFWriter.h>

namespace mcld
{

class Input;
class MCLinker;
class GNULDBackend;

/** \class ELFObjectWriter
 *  \brief ELFObjectWriter writes the target-independent parts of object files.
 *  ELFObjectWriter reads a MCLDFile and writes into raw_ostream
 *
 */
class ELFObjectWriter : public ObjectWriter, protected ELFWriter
{
public:
  ELFObjectWriter(GNULDBackend& pBackend, MCLinker& pLinker);

  ~ELFObjectWriter();

  llvm::error_code writeObject(Output& pOutput)
  { return llvm::make_error_code(llvm::errc::not_supported); }

private:
  MCLinker& m_Linker;
};

} // namespace of mcld

#endif