[PATCH] D51652: lld-link: Write an empty "repro" debug directory entry if /Brepro is passed
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 4 12:48:05 PDT 2018
thakis created this revision.
thakis added a reviewer: rnk.
Herald added a subscriber: hiraditya.
If the coff timestamp is set to a hash, like lld-link does if /Brepro is passed, the coff spec suggests that a IMAGE_DEBUG_TYPE_REPRO entry is in the debug directory. This lets lld-link write such a section. See bug for details.
link.exe creates a zero-length repro debug directory entry with `/debug /Brepro`/ Without debug, it puts a longer hash in the repro section. This here lets lld-link always write a zero-length repro debug directory entry.
If the repro entry is the only debug directory entry, it's now no longer guaranteed that DebugDirectoryStart + DataEntry->Size is within a section, so also tweak initDebugDirectoryPtr() to look like initBaseRelocPtr(). Also fix llvm-readobj to not error out when dumping the contents of a zero-length debug directory entry. Both these llvm changes are needed to get llvm-readobj working for the new lld test in this patch.
Fixes PR38429.
https://reviews.llvm.org/D51652
Files:
lld/COFF/Writer.cpp
lld/test/COFF/rsds.test
llvm/lib/Object/COFFObjectFile.cpp
llvm/tools/llvm-readobj/COFFDumper.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51652.163886.patch
Type: text/x-patch
Size: 7011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180904/6e2d332a/attachment.bin>
More information about the llvm-commits
mailing list