• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_DYNAMIC_SHARED_OBJECT_WRITER_H
10 #define MCLD_ELF_DYNAMIC_SHARED_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/DynObjWriter.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 
25 namespace mcld
26 {
27 
28 class GNULDBackend;
29 class MCLinker;
30 
31 /** \class ELFDynObjWriter
32  *  \brief ELFDynObjWriter writes the dynamic sections.
33  */
34 class ELFDynObjWriter : public DynObjWriter, private ELFWriter
35 {
36 public:
37   typedef ELFWriter::FileOffset FileOffset;
38 
39 public:
40   ELFDynObjWriter(GNULDBackend& pBackend, MCLinker& pLinker);
41   ~ELFDynObjWriter();
42 
43   llvm::error_code writeDynObj(Output& pOutput);
44 
45 private:
46   GNULDBackend& m_Backend;
47   MCLinker& m_Linker;
48 };
49 
50 } // namespace of mcld
51 
52 #endif
53 
54