[PATCH] D61049: Let llvm-cvtres (and lld-link) report duplicate resources

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 18:39:38 PDT 2019


thakis created this revision.
thakis added a reviewer: mstorsjo.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

If two .res files contain the same resource, cvtres.exe (and hence
link.exe) reject the input with this message:

  CVTRES : fatal error CVT1100: duplicate resource.  type:STRING, name:101, language:0x0409
  LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

llvm-cvtres (and lld-link) used to silently pick one of the duplicate
resources instead. This patch makes them report an error as well.
We slightly improve on cvtres by printing the name of two .res files
containing duplicate entries as well.


https://reviews.llvm.org/D61049

Files:
  llvm/include/llvm/Object/WindowsResource.h
  llvm/lib/Object/WindowsResource.cpp
  llvm/test/tools/llvm-cvtres/Inputs/id.rc
  llvm/test/tools/llvm-cvtres/Inputs/id.res
  llvm/test/tools/llvm-cvtres/Inputs/name.rc
  llvm/test/tools/llvm-cvtres/Inputs/name.res
  llvm/test/tools/llvm-cvtres/duplicate.test
  llvm/tools/llvm-cvtres/llvm-cvtres.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61049.196362.patch
Type: text/x-patch
Size: 10143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190424/2eebbf02/attachment.bin>


More information about the llvm-commits mailing list