1//===- ELFDynObjWriter.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_ELF_EXECUTABLE_OBJECT_WRITER_H
10#define MCLD_ELF_EXECUTABLE_OBJECT_WRITER_H
11#ifdef ENABLE_UNITTEST
12#include <gtest.h>
13#endif
14#include <llvm/ADT/DenseMap.h>
15#include <llvm/Support/ELF.h>
16#include <mcld/LD/ExecWriter.h>
17#include <mcld/LD/ELFWriter.h>
18#include <mcld/LD/LDContext.h>
19#include <mcld/LD/LDSection.h>
20#include <mcld/Support/MemoryArea.h>
21#include <vector>
22#include <utility>
23
24
25namespace mcld
26{
27
28class GNULDBackend;
29class MCLinker;
30
31/** \class ELFDynObjWriter
32 *  \brief ELFDynObjWriter writes the dynamic sections.
33 */
34class ELFExecWriter : public ExecWriter, private ELFWriter
35{
36public:
37  typedef ELFWriter::FileOffset FileOffset;
38
39public:
40  ELFExecWriter(GNULDBackend& pBackend, MCLinker& pLinker);
41  ~ELFExecWriter();
42
43  llvm::error_code writeExecutable(Output& pOutput);
44
45private:
46  GNULDBackend& m_Backend;
47  MCLinker& m_Linker;
48};
49
50} // namespace of mcld
51
52#endif
53
54