Files
clang-p2996/llvm/lib/ObjCopy/COFF/COFFReader.cpp
Daan De Meyer 556af19330 [llvm-objcopy] Use getNumberOfSymbols() instead of getRawNumberOfSymbols()
getRawNumberOfSymbols() assumes that a symbol table exists, which isn't
always guaranteed, while getNumberOfSymbols() handles and tolerates objects
without a symbol table. When there is a symbol table, both methods return
the same value.

Also add a test to ensure we don't regress in this regard. The test
generates a basic COFF object with symbols and overrides the symbol table
pointer with zeros to craft the input required to verify llvm-objcopy works
as expected in this scenario.
2023-01-02 13:22:50 +01:00

8.5 KiB