]> granicus.if.org Git - llvm/commit
Let llvm-cvtres (and lld-link) report duplicate resources
authorNico Weber <nicolasweber@gmx.de>
Wed, 24 Apr 2019 11:42:59 +0000 (11:42 +0000)
committerNico Weber <nicolasweber@gmx.de>
Wed, 24 Apr 2019 11:42:59 +0000 (11:42 +0000)
commit97ae15dc0f0351bb63c8efe0b7db1319eb994193
tree5e339eab9262149389790a41d67352d0b3b0d523
parent8b62c4ddd9d44ff5a6c6cb6f1e1dbbbfe775dbb8
Let llvm-cvtres (and lld-link) report duplicate resources

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.

Differential Revision: https://reviews.llvm.org/D61049

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359083 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/WindowsResource.h
lib/Object/WindowsResource.cpp
test/tools/llvm-cvtres/Inputs/id.rc [new file with mode: 0644]
test/tools/llvm-cvtres/Inputs/id.res [new file with mode: 0644]
test/tools/llvm-cvtres/Inputs/name.rc [new file with mode: 0644]
test/tools/llvm-cvtres/Inputs/name.res [new file with mode: 0644]
test/tools/llvm-cvtres/duplicate.test [new file with mode: 0644]