mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-21 18:29:45 +00:00
Fix identify_magic() with mach-o stub dylibs.
The wrong value was returned and the unittest did not cover the stub dylib case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217933 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2b90611892
commit
290c772b6c
@ -999,7 +999,7 @@ file_magic identify_magic(StringRef Magic) {
|
|||||||
case 6: return file_magic::macho_dynamically_linked_shared_lib;
|
case 6: return file_magic::macho_dynamically_linked_shared_lib;
|
||||||
case 7: return file_magic::macho_dynamic_linker;
|
case 7: return file_magic::macho_dynamic_linker;
|
||||||
case 8: return file_magic::macho_bundle;
|
case 8: return file_magic::macho_bundle;
|
||||||
case 9: return file_magic::macho_dynamic_linker;
|
case 9: return file_magic::macho_dynamically_linked_shared_lib_stub;
|
||||||
case 10: return file_magic::macho_dsym_companion;
|
case 10: return file_magic::macho_dsym_companion;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -501,6 +501,8 @@ const char macho_dynamic_linker[] = "\xfe\xed\xfa\xce..........\x00\x07";
|
|||||||
const char macho_bundle[] = "\xfe\xed\xfa\xce..........\x00\x08";
|
const char macho_bundle[] = "\xfe\xed\xfa\xce..........\x00\x08";
|
||||||
const char macho_dsym_companion[] = "\xfe\xed\xfa\xce..........\x00\x0a";
|
const char macho_dsym_companion[] = "\xfe\xed\xfa\xce..........\x00\x0a";
|
||||||
const char windows_resource[] = "\x00\x00\x00\x00\x020\x00\x00\x00\xff";
|
const char windows_resource[] = "\x00\x00\x00\x00\x020\x00\x00\x00\xff";
|
||||||
|
const char macho_dynamically_linked_shared_lib_stub[] =
|
||||||
|
"\xfe\xed\xfa\xce..........\x00\x09";
|
||||||
|
|
||||||
TEST_F(FileSystemTest, Magic) {
|
TEST_F(FileSystemTest, Magic) {
|
||||||
struct type {
|
struct type {
|
||||||
@ -526,6 +528,7 @@ TEST_F(FileSystemTest, Magic) {
|
|||||||
DEFINE(macho_dynamically_linked_shared_lib),
|
DEFINE(macho_dynamically_linked_shared_lib),
|
||||||
DEFINE(macho_dynamic_linker),
|
DEFINE(macho_dynamic_linker),
|
||||||
DEFINE(macho_bundle),
|
DEFINE(macho_bundle),
|
||||||
|
DEFINE(macho_dynamically_linked_shared_lib_stub),
|
||||||
DEFINE(macho_dsym_companion),
|
DEFINE(macho_dsym_companion),
|
||||||
DEFINE(windows_resource)
|
DEFINE(windows_resource)
|
||||||
#undef DEFINE
|
#undef DEFINE
|
||||||
|
Loading…
Reference in New Issue
Block a user