OSDN Git Service
(root)
/
android-x86
/
external-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9f1b2d
)
Make isDynamicLibrary detect more than just an ELF file.
author
Reid Spencer
<rspencer@reidspencer.com>
Wed, 11 Apr 2007 00:49:39 +0000
(
00:49
+0000)
committer
Reid Spencer
<rspencer@reidspencer.com>
Wed, 11 Apr 2007 00:49:39 +0000
(
00:49
+0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35874
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/System/Path.cpp
patch
|
blob
|
history
diff --git
a/lib/System/Path.cpp
b/lib/System/Path.cpp
index
b599c9c
..
0bd4849
100644
(file)
--- a/
lib/System/Path.cpp
+++ b/
lib/System/Path.cpp
@@
-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;
}