summaryrefslogtreecommitdiff
path: root/include/mcld/LD/ELFDynObjWriter.h
blob: dc0e37b86ef988ec89bbcea521984bc3d6351a60 (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
48
49
50
51
52
53
//===- ELFDynObjWriter.h --------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_ELF_DYNAMIC_SHARED_OBJECT_WRITER_H
#define MCLD_ELF_DYNAMIC_SHARED_OBJECT_WRITER_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif
#include <llvm/ADT/DenseMap.h>
#include <llvm/Support/ELF.h>
#include <mcld/LD/DynObjWriter.h>
#include <mcld/LD/ELFWriter.h>
#include <mcld/LD/LDContext.h>
#include <mcld/LD/LDSection.h>
#include <mcld/Support/MemoryArea.h>
#include <vector>
#include <utility>


namespace mcld
{

class GNULDBackend;
class MCLinker;

/** \class ELFDynObjWriter
 *  \brief ELFDynObjWriter writes the dynamic sections.
 */
class ELFDynObjWriter : public DynObjWriter, private ELFWriter
{
public:
  typedef ELFWriter::FileOffset FileOffset;

public:
  ELFDynObjWriter(GNULDBackend& pBackend, MCLinker& pLinker);
  ~ELFDynObjWriter();

  llvm::error_code writeDynObj(Output& pOutput);

private:
  GNULDBackend& m_Backend;
  MCLinker& m_Linker;
};

} // namespace of mcld

#endif