[LLVMdev] MSVC-style RTTI and LLVM IR

David Majnemer david.majnemer at gmail.com
Fri Jan 3 18:13:32 PST 2014


Apologies, I meant IMAGE_REL_AMD64_ADDR32NB instead
of IMAGE_REL_AMD64_ADDR32.


On Fri, Jan 3, 2014 at 5:51 PM, David Majnemer <david.majnemer at gmail.com>wrote:

> Hello all,
>
> MSVC-style RTTI when targeting x86_64 requires creating references to
> symbols using image-base relative relocations (IMAGE_REL_AMD64_ADDR32 in
> PE/COFF, similar to ELF's R_X86_64_RELATIVE).  This is currently supported
> at the MC layer, one may have:
>
> .data
> foo:
>     .quad foo at imgrel
>
> This would create a symbol which points to it's own image-relative offset.
>
> To my knowledge, LLVM IR gives no way to refer to the address of a symbol
> using a relocation and thus the above result cannot be obtained.
>
> Seeing as how we want to support MSVC-style RTTI from clang, how should we
> represent image-relative relocations in the IR?
>
> Thanks
>
> --
> David Majnemer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140103/f1a24f34/attachment.html>


More information about the llvm-dev mailing list