diff options
author | Chris Lattner <sabre@nondot.org> | 2007-04-11 03:15:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-04-11 03:15:35 +0000 |
commit | ade7592085cbb3d37a7cc9701c4c07c9c58a87c5 (patch) | |
tree | 8302751f5350191eea2e042569ed1bd701c454a0 /lib | |
parent | 18da0720887527ed570e9703ae5f290beb491ee1 (diff) | |
download | external_llvm-ade7592085cbb3d37a7cc9701c4c07c9c58a87c5.zip external_llvm-ade7592085cbb3d37a7cc9701c4c07c9c58a87c5.tar.gz external_llvm-ade7592085cbb3d37a7cc9701c4c07c9c58a87c5.tar.bz2 |
Hack to get sys::Path to recognize macho dylibs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35878 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/System/Path.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/System/Path.cpp b/lib/System/Path.cpp index a028696..66436ae 100644 --- a/lib/System/Path.cpp +++ b/lib/System/Path.cpp @@ -68,12 +68,14 @@ sys::IdentifyFileType(const char*magic, unsigned length) { } break; - case 0xCE: - case 0xCF: + case 0xCA: // This is complicated by an overlap with Java class files. // See the Mach-O section in /usr/share/file/magic for details. - if (magic[1] == char(0xFA) && magic[2] == char(0xED) && - magic[3] == char(0xFE)) + if (magic[1] == char(0xFE) && magic[2] == char(0xBA) && + magic[3] == char(0xBE)) { + return Mach_O_DynamicallyLinkedSharedLib_FileType; + + // FIXME: How does this work? if (length >= 14 && magic[13] == 0) switch (magic[12]) { default: break; @@ -87,6 +89,7 @@ sys::IdentifyFileType(const char*magic, unsigned length) { case 8: return Mach_O_Bundle_FileType; case 9: return Mach_O_DynamicallyLinkedSharedLibStub_FileType; } + } break; case 0xF0: // PowerPC Windows |