Check that COFF .obj files have sections with zero virtual address spaces.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Jul 2015 14:26:07 +0000 (14:26 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Jul 2015 14:26:07 +0000 (14:26 +0000)
commit159946938f1ea5181bfd1353ee0ad6c064850dbb
tree7c8a5cc121f5b77c367499b27a62c6b606df3613
parentff55c29f5485a8ee48199c4155edcdc5f4dd21cc
Check that COFF .obj files have sections with zero virtual address spaces.

When talking about the virtual address of sections the coff spec says:
  ... for simplicity, compilers should set this to zero. Otherwise, it is an
  arbitrary value that is subtracted from offsets during relocation.

We don't currently subtract it, so check that it is zero.

If some producer does create such files, we can change getRelocationOffset
instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241447 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Object/COFFObjectFile.cpp
test/Object/Inputs/invalid-bad-section-address.coff [new file with mode: 0644]
test/Object/coff-invalid.test [new file with mode: 0644]
tools/llvm-readobj/COFFDumper.cpp