mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 19:42:54 +02:00
Make isDynamicLibrary detect more than just an ELF file.
llvm-svn: 35874
This commit is contained in:
parent
a422b454ae
commit
e580735108
@ -103,8 +103,16 @@ Path::isArchive() const {
|
||||
|
||||
bool
|
||||
Path::isDynamicLibrary() const {
|
||||
if (canRead())
|
||||
return hasMagicNumber("\177ELF");
|
||||
if (canRead()) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user