2010-08-16 18:57:57 +00:00
|
|
|
//===-- llvm/MC/ELFObjectWriter.h - ELF File Writer ---------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_MC_ELFOBJECTWRITER_H
|
|
|
|
#define LLVM_MC_ELFOBJECTWRITER_H
|
|
|
|
|
2010-09-09 17:57:50 +00:00
|
|
|
#include "llvm/ADT/Triple.h"
|
2010-08-16 18:57:57 +00:00
|
|
|
#include "llvm/MC/MCObjectWriter.h"
|
|
|
|
#include "llvm/Support/raw_ostream.h"
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MCAsmFixup;
|
|
|
|
class MCAssembler;
|
|
|
|
class MCFragment;
|
|
|
|
class MCValue;
|
|
|
|
class raw_ostream;
|
|
|
|
|
|
|
|
class ELFObjectWriter : public MCObjectWriter {
|
|
|
|
void *Impl;
|
|
|
|
|
|
|
|
public:
|
2010-09-09 17:57:50 +00:00
|
|
|
ELFObjectWriter(raw_ostream &OS, bool Is64Bit, Triple::OSType OSType,
|
2010-10-22 15:52:49 +00:00
|
|
|
uint16_t EMachine, bool IsLittleEndian = true,
|
|
|
|
bool HasRelocationAddend = true);
|
2010-08-16 18:57:57 +00:00
|
|
|
|
|
|
|
virtual ~ELFObjectWriter();
|
|
|
|
|
|
|
|
virtual void ExecutePostLayoutBinding(MCAssembler &Asm);
|
|
|
|
|
|
|
|
virtual void RecordRelocation(const MCAssembler &Asm,
|
|
|
|
const MCAsmLayout &Layout,
|
|
|
|
const MCFragment *Fragment,
|
|
|
|
const MCFixup &Fixup, MCValue Target,
|
|
|
|
uint64_t &FixedValue);
|
|
|
|
|
2010-09-30 02:22:20 +00:00
|
|
|
virtual bool IsFixupFullyResolved(const MCAssembler &Asm,
|
|
|
|
const MCValue Target,
|
|
|
|
bool IsPCRel,
|
|
|
|
const MCFragment *DF) const;
|
|
|
|
|
2010-10-05 15:11:03 +00:00
|
|
|
virtual void WriteObject(MCAssembler &Asm, const MCAsmLayout &Layout);
|
2010-08-16 18:57:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|