summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-07-26 20:11:26 +0000
committerMartin Storsjo <martin@martin.st>2018-07-26 20:11:26 +0000
commit70e518f523466903fefea9552a427ac67b736c3b (patch)
tree871251d56713be32da11a920945acf421f6b9192 /include
parent1028e2499b54c8d120e3f2088bb8db49400194ce (diff)
[MC] Add support for the .rva assembler directive for COFF targets
Even though gas doesn't document it, it has been supported there for a very long time. This produces the 32 bit relative virtual address (aka image relative address) for a given symbol. ".rva foo" is essentially equal to ".long foo@imgrel". Differential Revision: https://reviews.llvm.org/D49821 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCStreamer.h5
-rw-r--r--include/llvm/MC/MCWinCOFFStreamer.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h
index ff518d2c8ad..0a5d80c6d77 100644
--- a/include/llvm/MC/MCStreamer.h
+++ b/include/llvm/MC/MCStreamer.h
@@ -522,6 +522,11 @@ public:
/// \param Symbol - Symbol the section relative relocation should point to.
virtual void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset);
+ /// Emits a COFF image relative relocation.
+ ///
+ /// \param Symbol - Symbol the image relative relocation should point to.
+ virtual void EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset);
+
/// Emit an ELF .size directive.
///
/// This corresponds to an assembler statement such as:
diff --git a/include/llvm/MC/MCWinCOFFStreamer.h b/include/llvm/MC/MCWinCOFFStreamer.h
index ee91fff70a6..0049d04b4b3 100644
--- a/include/llvm/MC/MCWinCOFFStreamer.h
+++ b/include/llvm/MC/MCWinCOFFStreamer.h
@@ -54,6 +54,7 @@ public:
void EmitCOFFSymbolIndex(MCSymbol const *Symbol) override;
void EmitCOFFSectionIndex(MCSymbol const *Symbol) override;
void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) override;
+ void EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) override;
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
unsigned ByteAlignment) override;
void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,