summaryrefslogtreecommitdiff
path: root/docs/Extensions.rst
diff options
context:
space:
mode:
authorNico Rieck <nico.rieck@gmail.com>2013-04-10 23:28:17 +0000
committerNico Rieck <nico.rieck@gmail.com>2013-04-10 23:28:17 +0000
commit18d49acdab79d6f0966b47182b6c3a2ba3d9f80f (patch)
tree627374fd66e65ec88b6ba4f4cfd81c79cf6be35b /docs/Extensions.rst
parentbb5cbd86a4add5944c869836c507d419255d98dc (diff)
downloadllvm-18d49acdab79d6f0966b47182b6c3a2ba3d9f80f.tar.gz
llvm-18d49acdab79d6f0966b47182b6c3a2ba3d9f80f.tar.bz2
llvm-18d49acdab79d6f0966b47182b6c3a2ba3d9f80f.tar.xz
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'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/Extensions.rst')
-rw-r--r--docs/Extensions.rst39
1 files changed, 39 insertions, 0 deletions
diff --git a/docs/Extensions.rst b/docs/Extensions.rst
new file mode 100644
index 0000000000..062804a9fc
--- /dev/null
+++ b/docs/Extensions.rst
@@ -0,0 +1,39 @@
+===============
+LLVM Extensions
+===============
+
+.. contents::
+ :local:
+ :depth: 1
+
+.. toctree::
+ :hidden:
+
+Introduction
+============
+
+This document describes extensions to tools and formats LLVM seeks compatibility
+with.
+
+Machine-specific Assembly Syntax
+================================
+
+X86/COFF-Dependent
+------------------
+
+The following additional relocation type is supported:
+
+**@IMGREL** (AT&T syntax only) generates an image-relative relocation that
+corresponds to the COFF relocation types ``IMAGE_REL_I386_DIR32NB`` (32-bit) or
+``IMAGE_REL_AMD64_ADDR32NB`` (64-bit).
+
+.. code-block:: gas
+
+ .text
+ fun:
+ mov foo@IMGREL(%ebx, %ecx, 4), %eax
+
+ .section .pdata
+ .long fun@IMGREL
+ .long (fun@imgrel + 0x3F)
+ .long $unwind$fun@imgrel