[llvm-objcopy] [COFF] Fix a misconception about debug directory payloads
authorMartin Storsjö <martin@martin.st>
Mon, 27 Apr 2020 11:30:42 +0000 (14:30 +0300)
committerMartin Storsjö <martin@martin.st>
Wed, 29 Apr 2020 17:35:36 +0000 (20:35 +0300)
commit23e35f7c88549de8c76ee5b0643ce5116062563c
treef66a08ab77475a2d7ae4b92845a568b348099cf7
parent239fcda22deef2e36b36a17a310d9eb48b1794d8
[llvm-objcopy] [COFF] Fix a misconception about debug directory payloads

The debug directory payload is not located directly after the
debug directory entry itself, but can essentially be located anywhere
in the binary (even outside of mapped sections, although we don't
handle that case).

Differential Revision: https://reviews.llvm.org/D78921
llvm/test/tools/llvm-objcopy/COFF/debug-dir-unmapped.test [new file with mode: 0644]
llvm/test/tools/llvm-objcopy/COFF/patch-debug-dir2.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/COFF/Writer.cpp
llvm/tools/llvm-objcopy/COFF/Writer.h