Make it possible for the MCObjectWriter to decide if a given fixup is fully
[oota-llvm.git] / include / llvm / MC / ELFObjectWriter.h
1 //===-- llvm/MC/ELFObjectWriter.h - ELF File Writer ---------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_MC_ELFOBJECTWRITER_H
11 #define LLVM_MC_ELFOBJECTWRITER_H
12
13 #include "llvm/ADT/Triple.h"
14 #include "llvm/MC/MCObjectWriter.h"
15 #include "llvm/Support/raw_ostream.h"
16 #include <cassert>
17
18 namespace llvm {
19 class MCAsmFixup;
20 class MCAssembler;
21 class MCFragment;
22 class MCValue;
23 class raw_ostream;
24
25 class ELFObjectWriter : public MCObjectWriter {
26   void *Impl;
27
28 public:
29   ELFObjectWriter(raw_ostream &OS, bool Is64Bit, Triple::OSType OSType, 
30                   bool IsLittleEndian = true, bool HasRelocationAddend = true);
31
32   virtual ~ELFObjectWriter();
33
34   virtual void ExecutePostLayoutBinding(MCAssembler &Asm);
35
36   virtual void RecordRelocation(const MCAssembler &Asm,
37                                 const MCAsmLayout &Layout,
38                                 const MCFragment *Fragment,
39                                 const MCFixup &Fixup, MCValue Target,
40                                 uint64_t &FixedValue);
41
42   virtual bool IsFixupFullyResolved(const MCAssembler &Asm,
43                                     const MCValue Target,
44                                     bool IsPCRel,
45                                     const MCFragment *DF) const;
46
47   virtual void WriteObject(const MCAssembler &Asm, const MCAsmLayout &Layout);
48 };
49
50 } // End llvm namespace
51
52 #endif