[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)
committerEmilio Pozuelo Monfort <pochu@debian.org>
Thu, 21 Jul 2022 07:14:44 +0000 (08:14 +0100)
commit689dde915480eef1c451215ad3ef5927ad58e731
tree26bf85cfd4e1023c937eba0977bae40af125a734
parent7e0b8e808cfd10a72fb65da6e18909eb548f7d96
[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