MC: Support COFF image-relative MCSymbolRefs
authorNico Rieck <nico.rieck@gmail.com>
Wed, 10 Apr 2013 23:28:17 +0000 (23:28 +0000)
committerNico Rieck <nico.rieck@gmail.com>
Wed, 10 Apr 2013 23:28:17 +0000 (23:28 +0000)
commit1da4529b15ed80e5d6c0b21d3ac46538fbcad87f
treee8405a0153ee13919176b470d5febec56dee98e3
parent51f6fb9a189fc62694d30f54322c9007168e1844
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
llvm/docs/Extensions.rst [new file with mode: 0644]
llvm/docs/index.rst
llvm/include/llvm/MC/MCExpr.h
llvm/include/llvm/MC/MCWinCOFFObjectWriter.h
llvm/lib/MC/MCExpr.cpp
llvm/lib/MC/WinCOFFObjectWriter.cpp
llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp
llvm/test/MC/COFF/relocation-imgrel.s [new file with mode: 0644]