llvm-6502/include/llvm/MC/ELFObjectWriter.h
Rafael Espindola 7070387f08 Make it possible for the MCObjectWriter to decide if a given fixup is fully
resolved or not. Different object files have different restrictions and
different native assemblers have different idiosyncrasies we want to emulate
for now.

Move the existing MachO logic to the new place and implement an ELF one that
gets fixups to globals right.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:22:20 +00:00

53 lines
1.6 KiB
C++

//===-- 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
#include "llvm/ADT/Triple.h"
#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:
ELFObjectWriter(raw_ostream &OS, bool Is64Bit, Triple::OSType OSType,
bool IsLittleEndian = true, bool HasRelocationAddend = true);
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);
virtual bool IsFixupFullyResolved(const MCAssembler &Asm,
const MCValue Target,
bool IsPCRel,
const MCFragment *DF) const;
virtual void WriteObject(const MCAssembler &Asm, const MCAsmLayout &Layout);
};
} // End llvm namespace
#endif