mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-05 03:46:27 +00:00
Make isDynamicLibrary detect more than just an ELF file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35874 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c9f1b2d4c6
commit
410aa020a2
@ -103,8 +103,16 @@ Path::isArchive() const {
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
Path::isDynamicLibrary() const {
|
Path::isDynamicLibrary() const {
|
||||||
if (canRead())
|
if (canRead()) {
|
||||||
return hasMagicNumber("\177ELF");
|
std::string Magic;
|
||||||
|
if (getMagicNumber(Magic, 64))
|
||||||
|
switch (IdentifyFileType(Magic.c_str(), Magic.length())) {
|
||||||
|
default: return false;
|
||||||
|
case ELF_FileType:
|
||||||
|
case Mach_O_FileType:
|
||||||
|
case COFF_FileType: return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user