This is an archive of the discontinued LLVM Phabricator instance.

[MC] Add support for the .rva assembler directive for COFF targets
ClosedPublic

Authored by mstorsjo on Jul 25 2018, 2:22 PM.

Details

Summary

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".

Diff Detail

Repository
rL LLVM

Event Timeline

mstorsjo created this revision.Jul 25 2018, 2:22 PM
majnemer added inline comments.
lib/MC/MCParser/COFFAsmParser.cpp
515 ↗(On Diff #157361)

Quoting C++ expressions in an error message is not very user friend, I'd stick in -2147483648

516 ↗(On Diff #157361)

2147483647

mstorsjo updated this revision to Diff 157376.Jul 25 2018, 2:52 PM

Updated the error message to feature literal numbers

rnk accepted this revision.Jul 26 2018, 10:50 AM

lgtm

This revision is now accepted and ready to land.Jul 26 2018, 10:50 AM
This revision was automatically updated to reflect the committed changes.