[PATCH] [llvm-objcopy][COFF] Fix test for debug dir presence
authorAlfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
Fri, 10 Sep 2021 08:55:26 +0000 (09:55 +0100)
committerSylvestre Ledru <sylvestre@debian.org>
Fri, 22 Jul 2022 13:10:20 +0000 (14:10 +0100)
commita286f81a95a6d2bc85431a9836d141fb57d11b5a
tree04f37522ed79498c9061d4dc0c5dda35229ee6af
parent5bf68abbe4cc61e1d295be4003fb7a6611c2e069
[PATCH] [llvm-objcopy][COFF] Fix test for debug dir presence

If the number of directories was 6 (equal to the DEBUG_DIRECTORY
index), patchDebugDirectory() was run even though the debug directory
is actually the 7th entry. Use <= in the comparison to fix that.

This fixes https://llvm.org/PR51243

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

Reviewed by: jhenderson

Gbp-Pq: Name llvm-objcopy-COFF-Fix-test-for-debug-dir-presence.patch
llvm/test/tools/llvm-objcopy/COFF/check-debug-dir-present.test [new file with mode: 0644]
llvm/tools/llvm-objcopy/COFF/Writer.cpp