aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WindowsResource.cpp
diff options
context:
space:
mode:
authorEric Beckmann <ecbeckmann@google.com>2017-07-07 23:23:53 +0000
committerEric Beckmann <ecbeckmann@google.com>2017-07-07 23:23:53 +0000
commit7c865f004b86475cc07342a6fbd0b5f57ced1801 (patch)
treeed1b2ee7c9b14fa5937c8186fe5c9d86c85e9eda /llvm/lib/Object/WindowsResource.cpp
parentbb4069e439d89c25eae2d0de8749e144291c1c84 (diff)
downloadllvm-7c865f004b86475cc07342a6fbd0b5f57ced1801.zip
llvm-7c865f004b86475cc07342a6fbd0b5f57ced1801.tar.gz
llvm-7c865f004b86475cc07342a6fbd0b5f57ced1801.tar.bz2
Add name offset flags, for parity with cvtres.exe.
Summary: The original cvtres.exe sets the high bit when an identifier offset points to a string. Even though this is not mentioned in the spec, and in fact does not seem to cause errors with most cases, for some reason this causes a failure in Chromium where the new resource file is not verified as a new version. This patch sets this high bit flag, and also adds a test case to check that the output of our library is always identical to original cvtres. Reviewers: zturner, ruiu Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D35099 llvm-svn: 307452
Diffstat (limited to 'llvm/lib/Object/WindowsResource.cpp')
-rw-r--r--llvm/lib/Object/WindowsResource.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Object/WindowsResource.cpp b/llvm/lib/Object/WindowsResource.cpp
index b0cd6c8..be767a1 100644
--- a/llvm/lib/Object/WindowsResource.cpp
+++ b/llvm/lib/Object/WindowsResource.cpp
@@ -616,8 +616,8 @@ void WindowsResourceCOFFWriter::writeDirectoryTree() {
for (auto const &Child : StringChildren) {
auto *Entry = reinterpret_cast<coff_resource_dir_entry *>(BufferStart +
CurrentOffset);
- Entry->Identifier.NameOffset =
- StringTableOffsets[Child.second->getStringIndex()];
+ Entry->Identifier.setNameOffset(
+ StringTableOffsets[Child.second->getStringIndex()]);
if (Child.second->checkIsDataNode()) {
Entry->Offset.DataEntryOffset = NextLevelOffset;
NextLevelOffset += sizeof(coff_resource_data_entry);