mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 22:04:55 +00:00
18d49acdab
Add support for the COFF relocation types IMAGE_REL_I386_DIR32NB and IMAGE_REL_AMD64_ADDR32NB for 32- and 64-bit respectively. These are similar to normal 4-byte relocations except that they do not include the base address of the image. Image-relative relocations are used for debug information (32-bit) and SEH unwind tables (64-bit). A new MCSymbolRef variant called 'VK_COFF_IMGREL32' is introduced to specify such relocations. For AT&T assembly, this variant can be accessed using the symbol suffix '@imgrel'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179240 91177308-0d34-0410-b5e6-96231b3b80d8
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
//===-- llvm/MC/MCWinCOFFObjectWriter.h - Win COFF Object 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_MCWINCOFFOBJECTWRITER_H
|
|
#define LLVM_MC_MCWINCOFFOBJECTWRITER_H
|
|
|
|
namespace llvm {
|
|
class MCFixup;
|
|
class MCObjectWriter;
|
|
class MCValue;
|
|
class raw_ostream;
|
|
|
|
class MCWinCOFFObjectTargetWriter {
|
|
const unsigned Machine;
|
|
|
|
protected:
|
|
MCWinCOFFObjectTargetWriter(unsigned Machine_);
|
|
|
|
public:
|
|
virtual ~MCWinCOFFObjectTargetWriter() {}
|
|
|
|
unsigned getMachine() const { return Machine; }
|
|
virtual unsigned getRelocType(const MCValue &Target,
|
|
const MCFixup &Fixup,
|
|
bool IsCrossSection) const = 0;
|
|
};
|
|
|
|
/// \brief Construct a new Win COFF writer instance.
|
|
///
|
|
/// \param MOTW - The target specific WinCOFF writer subclass.
|
|
/// \param OS - The stream to write to.
|
|
/// \returns The constructed object writer.
|
|
MCObjectWriter *createWinCOFFObjectWriter(MCWinCOFFObjectTargetWriter *MOTW,
|
|
raw_ostream &OS);
|
|
} // End llvm namespace
|
|
|
|
#endif
|