[PATCH] D54946: [yaml2obj] [COFF] Subtract the image base for section virtual addresses

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 10:53:54 PST 2018


zturner added a comment.

Maybe I'm misunderstanding something.  In `COFFYAML.cpp` we have this code:

  IO.mapOptional("VirtualAddress", Sec.Header.VirtualAddress, 0U);

So, we write out the virtual address exactly as it is in the binary header file.  So why, when going the other direction, do we subtract the image base?  I don't have a strong preference on whether we store the VA or the RVA (I have a mild preference for storing the value exactly as it is in the object file), but whatever we do, yaml2obj and obj2yaml at least need to agree with other, right?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54946/new/

https://reviews.llvm.org/D54946





More information about the llvm-commits mailing list