Fix detection of COFF executable files.
authorZachary Turner <zturner@google.com>
Thu, 8 Mar 2018 19:45:20 +0000 (19:45 +0000)
committerZachary Turner <zturner@google.com>
Thu, 8 Mar 2018 19:45:20 +0000 (19:45 +0000)
commit9899b5feb69607ff56a14c1eccdc08b8bf1f23d2
tree87e9fe859d7b28ae9406ce65a14a8b57603b1f00
parentb575f46b6d2a1aeb7fdbbebd2654fa24165afae9
Fix detection of COFF executable files.

One overload of this function would try to identify a file
by opening it and using the first 32 bytes to identify the magic
of the file.  This didn't work properly when more than 32 bytes
is actually needed for magic detection to succeed.  So now we
have this overload read in the entire file.

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

llvm-svn: 327050
llvm/lib/BinaryFormat/Magic.cpp