diff options
author | Nico Rieck <nico.rieck@gmail.com> | 2013-04-10 23:28:17 +0000 |
---|---|---|
committer | Nico Rieck <nico.rieck@gmail.com> | 2013-04-10 23:28:17 +0000 |
commit | 1da4529b15ed80e5d6c0b21d3ac46538fbcad87f (patch) | |
tree | e8405a0153ee13919176b470d5febec56dee98e3 /llvm/include | |
parent | 51f6fb9a189fc62694d30f54322c9007168e1844 (diff) | |
download | bcm5719-llvm-1da4529b15ed80e5d6c0b21d3ac46538fbcad87f.tar.gz bcm5719-llvm-1da4529b15ed80e5d6c0b21d3ac46538fbcad87f.zip |
MC: Support COFF image-relative MCSymbolRefs
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'.
llvm-svn: 179240
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/MC/MCExpr.h | 4 | ||||
-rw-r--r-- | llvm/include/llvm/MC/MCWinCOFFObjectWriter.h | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/llvm/include/llvm/MC/MCExpr.h b/llvm/include/llvm/MC/MCExpr.h index b5bfed18eca..a2c5bd3f766 100644 --- a/llvm/include/llvm/MC/MCExpr.h +++ b/llvm/include/llvm/MC/MCExpr.h @@ -216,7 +216,9 @@ public: VK_Mips_GOT_HI16, VK_Mips_GOT_LO16, VK_Mips_CALL_HI16, - VK_Mips_CALL_LO16 + VK_Mips_CALL_LO16, + + VK_COFF_IMGREL32 // symbol@imgrel (image-relative) }; private: diff --git a/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h b/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h index 11df5749d45..f13e7d54802 100644 --- a/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h +++ b/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h @@ -11,7 +11,9 @@ #define LLVM_MC_MCWINCOFFOBJECTWRITER_H namespace llvm { + class MCFixup; class MCObjectWriter; + class MCValue; class raw_ostream; class MCWinCOFFObjectTargetWriter { @@ -24,7 +26,9 @@ namespace llvm { virtual ~MCWinCOFFObjectTargetWriter() {} unsigned getMachine() const { return Machine; } - virtual unsigned getRelocType(unsigned FixupKind) const = 0; + virtual unsigned getRelocType(const MCValue &Target, + const MCFixup &Fixup, + bool IsCrossSection) const = 0; }; /// \brief Construct a new Win COFF writer instance. |