[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)
committerGianfranco Costamagna <locutusofborg@debian.org>
Sat, 4 Jun 2022 13:30:38 +0000 (14:30 +0100)
commite33876e65ac4ed7b6a89564cd0dd563bab271246
treeca31dd87294f652fba723fa7560556f9ef75644e
parent47fea2767366c88651eac03466017da05fdd2e67
[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