linkmap中存放的是app可执行文件Mach-O格式组织的各类数据的清单,根据LinkMap展开对Mach-O文件及dyld加载Mach-O可执行文件的细节
Mach-O文件解析
这部分着重对Mach-O分析工具及分析进行注解
Mach-O文件分析工具:
XCode自带的/usr/bin/pagestuff , lipo , file , otool , nm
-
jtool
命令行中用man命令可以分别查询到上述各工具的作用,比如可以按逻辑页数查看Mach-O文件(比如app名字为name)内容的pagestuff命令pagestuff name.app/name {pagenum} //如果pagenum为0,输出一般是:File Page 0 contains Mach-O headers pagestuff name.app/name -a //会把所有页中内容信息全部输出
由一个Demo工程展开对Mach-O文件的分析
Xcode 8.3创建一个Single View Application, 不修改AppDelegate及ViewController类,新增SampleObject类并修改main.m
代码如下:
//ViewController.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
//SampleObject.h
#import <Foundation/Foundation.h>
@interface SampleObject : NSObject
@property (nonatomic,strong) NSObject* propertyObj;
- (void)getSomeResultWithString:(NSString*)inputString number:(NSNumber*)number;
@end
//SampleObject.mm
#import "SampleObject.h"
#import <stdio.h>
const NSString* cntstr = @"SampleObjectKey";
@interface SampleObject()
@property (nonatomic,strong) NSString* sampleName;
@property (nonatomic,assign) NSUInteger sampleId;
@end
@implementation SampleObject
- (void)getSomeResultWithString:(NSString*)inputString number:(NSNumber*)number
{
NSString* currentStr = [NSString stringWithFormat:@"%@:%@",inputString,number];
NSUInteger stackNum = 123;
__block NSString* blockString = nil;
dispatch_async(dispatch_get_main_queue(), ^{
NSString* compositedString = [NSString stringWithFormat:@"%@:%@:%lul",cntstr,currentStr,stackNum];
NSLog(@"composite string:%@,succeeded",compositedString);
puts(compositedString.UTF8String);
blockString = compositedString;
});
}
//main.m
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "SampleObject.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
SampleObject* obj = [SampleObject new];
obj.propertyObj = [NSObject new];
[obj getSomeResultWithString:@"ab" number:@2];
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
@end
Mach-O文件格式
所得LinkMap文件输出如下:
# Path: /Users/fangyang/Library/Developer/Xcode/DerivedData/SampleApp-diymabslfgbdgvfhsqdnmmqngnqx/Build/Products/Debug-iphonesimulator/SampleApp.app/SampleApp
# Arch: x86_64
# Object files:
[ 0] linker synthesized
[ 1] /Users/fangyang/Library/Developer/Xcode/DerivedData/SampleApp-diymabslfgbdgvfhsqdnmmqngnqx/Build/Intermediates/SampleApp.build/Debug-iphonesimulator/SampleApp.build/SampleApp.app.xcent
[ 2] /Users/fangyang/Library/Developer/Xcode/DerivedData/SampleApp-diymabslfgbdgvfhsqdnmmqngnqx/Build/Intermediates/SampleApp.build/Debug-iphonesimulator/SampleApp.build/Objects-normal/x86_64/ViewController.o
[ 3] /Users/fangyang/Library/Developer/Xcode/DerivedData/SampleApp-diymabslfgbdgvfhsqdnmmqngnqx/Build/Intermediates/SampleApp.build/Debug-iphonesimulator/SampleApp.build/Objects-normal/x86_64/AppDelegate.o
[ 4] /Users/fangyang/Library/Developer/Xcode/DerivedData/SampleApp-diymabslfgbdgvfhsqdnmmqngnqx/Build/Intermediates/SampleApp.build/Debug-iphonesimulator/SampleApp.build/Objects-normal/x86_64/SampleObject.o
[ 5] /Users/fangyang/Library/Developer/Xcode/DerivedData/SampleApp-diymabslfgbdgvfhsqdnmmqngnqx/Build/Intermediates/SampleApp.build/Debug-iphonesimulator/SampleApp.build/Objects-normal/x86_64/main.o
[ 6] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks//Foundation.framework/Foundation
[ 7] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/usr/lib/libobjc.dylib
[ 8] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/usr/lib/libSystem.dylib
[ 9] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk/System/Library/Frameworks//UIKit.framework/UIKit
# Sections:
# Address Size Segment Section
0x100000D80 0x00000A59 __TEXT __text
0x1000017DA 0x0000006C __TEXT __stubs
0x100001848 0x000000C4 __TEXT __stub_helper
0x10000190C 0x00000AD2 __TEXT __objc_methname
0x1000023DE 0x0000004B __TEXT __objc_classname
0x100002429 0x0000084F __TEXT __objc_methtype
0x100002C78 0x0000012F __TEXT __cstring
0x100002DA8 0x00000074 __TEXT __gcc_except_tab
0x100002E1C 0x0000016A __TEXT __entitlements
0x100002F88 0x00000074 __TEXT __unwind_info
0x100003000 0x00000010 __DATA __nl_symbol_ptr
0x100003010 0x00000020 __DATA __got
0x100003030 0x00000090 __DATA __la_symbol_ptr
0x1000030C0 0x00000030 __DATA __const
0x1000030F0 0x000000A0 __DATA __cfstring
0x100003190 0x00000018 __DATA __objc_classlist
0x1000031A8 0x00000010 __DATA __objc_protolist
0x1000031B8 0x00000008 __DATA __objc_imageinfo
0x1000031C0 0x00000DD8 __DATA __objc_const
0x100003F98 0x00000048 __DATA __objc_selrefs
0x100003FE0 0x00000028 __DATA __objc_classrefs
0x100004008 0x00000008 __DATA __objc_superrefs
0x100004010 0x00000020 __DATA __objc_ivar
0x100004030 0x000000F0 __DATA __objc_data
0x100004120 0x000000C8 __DATA __data
# Symbols:
# Address Size File Name
0x100000D80 0x00000040 [ 2] -[ViewController viewDidLoad]
0x100000DC0 0x0000003C [ 2] -[ViewController didReceiveMemoryWarning]
0x100000E00 0x00000080 [ 3] -[AppDelegate application:didFinishLaunchingWithOptions:]
0x100000E80 0x00000040 [ 3] -[AppDelegate applicationWillResignActive:]
0x100000EC0 0x00000040 [ 3] -[AppDelegate applicationDidEnterBackground:]
0x100000F00 0x00000040 [ 3] -[AppDelegate applicationWillEnterForeground:]
0x100000F40 0x00000040 [ 3] -[AppDelegate applicationDidBecomeActive:]
0x100000F80 0x00000040 [ 3] -[AppDelegate applicationWillTerminate:]
0x100000FC0 0x00000020 [ 3] -[AppDelegate window]
0x100000FE0 0x00000040 [ 3] -[AppDelegate setWindow:]
0x100001020 0x00000033 [ 3] -[AppDelegate .cxx_destruct]
0x100001060 0x00000250 [ 4] -[SampleObject getSomeResultWithString:number:]
0x1000012B0 0x00000060 [ 4] ___Block_byref_object_copy_
0x100001310 0x00000030 [ 4] ___Block_byref_object_dispose_
0x100001340 0x00000120 [ 4] ___47-[SampleObject getSomeResultWithString:number:]_block_invoke
0x100001460 0x00000070 [ 4] ___copy_helper_block_
0x1000014D0 0x00000040 [ 4] ___destroy_helper_block_
0x100001510 0x00000020 [ 4] -[SampleObject propertyObj]
0x100001530 0x00000040 [ 4] -[SampleObject setPropertyObj:]
0x100001570 0x00000020 [ 4] -[SampleObject sampleName]
0x100001590 0x00000040 [ 4] -[SampleObject setSampleName:]
0x1000015D0 0x00000020 [ 4] -[SampleObject sampleId]
0x1000015F0 0x00000030 [ 4] -[SampleObject setSampleId:]
0x100001620 0x00000054 [ 4] -[SampleObject .cxx_destruct]
0x100001680 0x00000159 [ 5] _main
0x1000017DA 0x00000006 [ 6] _NSLog
0x1000017E0 0x00000006 [ 6] _NSStringFromClass
0x1000017E6 0x00000006 [ 9] _UIApplicationMain
0x1000017EC 0x00000006 [ 8] __Block_object_assign
0x1000017F2 0x00000006 [ 8] __Block_object_dispose
0x1000017F8 0x00000006 [ 8] __Unwind_Resume
0x1000017FE 0x00000006 [ 8] _dispatch_async
0x100001804 0x00000006 [ 7] _objc_autoreleasePoolPop
0x10000180A 0x00000006 [ 7] _objc_autoreleasePoolPush
0x100001810 0x00000006 [ 7] _objc_msgSend
0x100001816 0x00000006 [ 7] _objc_msgSendSuper2
0x10000181C 0x00000006 [ 7] _objc_release
0x100001822 0x00000006 [ 7] _objc_retain
0x100001828 0x00000006 [ 7] _objc_retainAutorelease
0x10000182E 0x00000006 [ 7] _objc_retainAutoreleaseReturnValue
0x100001834 0x00000006 [ 7] _objc_retainAutoreleasedReturnValue
0x10000183A 0x00000006 [ 7] _objc_storeStrong
0x100001840 0x00000006 [ 8] _puts
0x100001848 0x00000010 [ 0] helper helper
0x100001858 0x0000000A [ 6] _NSLog
0x100001862 0x0000000A [ 6] _NSStringFromClass
0x10000186C 0x0000000A [ 7] _objc_autoreleasePoolPop
0x100001876 0x0000000A [ 7] _objc_autoreleasePoolPush
0x100001880 0x0000000A [ 7] _objc_msgSend
0x10000188A 0x0000000A [ 7] _objc_msgSendSuper2
0x100001894 0x0000000A [ 7] _objc_release
0x10000189E 0x0000000A [ 7] _objc_retain
0x1000018A8 0x0000000A [ 7] _objc_retainAutorelease
0x1000018B2 0x0000000A [ 7] _objc_retainAutoreleaseReturnValue
0x1000018BC 0x0000000A [ 7] _objc_retainAutoreleasedReturnValue
0x1000018C6 0x0000000A [ 7] _objc_storeStrong
0x1000018D0 0x0000000A [ 8] __Block_object_assign
0x1000018DA 0x0000000A [ 8] __Block_object_dispose
0x1000018E4 0x0000000A [ 8] __Unwind_Resume
0x1000018EE 0x0000000A [ 8] _dispatch_async
0x1000018F8 0x0000000A [ 8] _puts
0x100001902 0x0000000A [ 9] _UIApplicationMain
0x10000190C 0x0000000C [ 2] literal string: viewDidLoad
0x100001918 0x00000018 [ 2] literal string: didReceiveMemoryWarning
0x100001930 0x0000001F [ 3] literal string: applicationDidFinishLaunching:
0x10000194F 0x0000002C [ 3] literal string: application:willFinishLaunchingWithOptions:
0x10000197B 0x0000002B [ 3] literal string: application:didFinishLaunchingWithOptions:
0x1000019A6 0x0000001C [ 3] literal string: applicationDidBecomeActive:
0x1000019C2 0x0000001D [ 3] literal string: applicationWillResignActive:
0x1000019DF 0x0000001B [ 3] literal string: application:handleOpenURL:
0x1000019FA 0x00000032 [ 3] literal string: application:openURL:sourceApplication:annotation:
0x100001A2C 0x0000001D [ 3] literal string: application:openURL:options:
0x100001A49 0x00000024 [ 3] literal string: applicationDidReceiveMemoryWarning:
0x100001A6D 0x0000001A [ 3] literal string: applicationWillTerminate:
0x100001A87 0x00000022 [ 3] literal string: applicationSignificantTimeChange:
0x100001AA9 0x00000035 [ 3] literal string: application:willChangeStatusBarOrientation:duration:
0x100001ADE 0x0000002B [ 3] literal string: application:didChangeStatusBarOrientation:
0x100001B09 0x00000026 [ 3] literal string: application:willChangeStatusBarFrame:
0x100001B2F 0x00000025 [ 3] literal string: application:didChangeStatusBarFrame:
0x100001B54 0x00000031 [ 3] literal string: application:didRegisterUserNotificationSettings:
0x100001B85 0x0000003E [ 3] literal string: application:didRegisterForRemoteNotificationsWithDeviceToken:
0x100001BC3 0x0000003E [ 3] literal string: application:didFailToRegisterForRemoteNotificationsWithError:
0x100001C01 0x0000002A [ 3] literal string: application:didReceiveRemoteNotification:
0x100001C2B 0x00000029 [ 3] literal string: application:didReceiveLocalNotification:
0x100001C54 0x0000004F [ 3] literal string: application:handleActionWithIdentifier:forLocalNotification:completionHandler:
0x100001CA3 0x00000061 [ 3] literal string: application:handleActionWithIdentifier:forRemoteNotification:withResponseInfo:completionHandler:
0x100001D04 0x00000050 [ 3] literal string: application:handleActionWithIdentifier:forRemoteNotification:completionHandler:
0x100001D54 0x00000060 [ 3] literal string: application:handleActionWithIdentifier:forLocalNotification:withResponseInfo:completionHandler:
0x100001DB4 0x00000041 [ 3] literal string: application:didReceiveRemoteNotification:fetchCompletionHandler:
0x100001DF5 0x0000002F [ 3] literal string: application:performFetchWithCompletionHandler:
0x100001E24 0x0000003C [ 3] literal string: application:performActionForShortcutItem:completionHandler:
0x100001E60 0x00000043 [ 3] literal string: application:handleEventsForBackgroundURLSession:completionHandler:
0x100001EA3 0x00000032 [ 3] literal string: application:handleWatchKitExtensionRequest:reply:
0x100001ED5 0x0000002D [ 3] literal string: applicationShouldRequestHealthAuthorization:
0x100001F02 0x0000001F [ 3] literal string: applicationDidEnterBackground:
0x100001F21 0x00000020 [ 3] literal string: applicationWillEnterForeground:
0x100001F41 0x0000002F [ 3] literal string: applicationProtectedDataWillBecomeUnavailable:
0x100001F70 0x0000002C [ 3] literal string: applicationProtectedDataDidBecomeAvailable:
0x100001F9C 0x00000035 [ 3] literal string: application:supportedInterfaceOrientationsForWindow:
0x100001FD1 0x00000031 [ 3] literal string: application:shouldAllowExtensionPointIdentifier:
0x100002002 0x0000003F [ 3] literal string: application:viewControllerWithRestorationIdentifierPath:coder:
0x100002041 0x00000028 [ 3] literal string: application:shouldSaveApplicationState:
0x100002069 0x0000002B [ 3] literal string: application:shouldRestoreApplicationState:
0x100002094 0x00000030 [ 3] literal string: application:willEncodeRestorableStateWithCoder:
0x1000020C4 0x0000002F [ 3] literal string: application:didDecodeRestorableStateWithCoder:
0x1000020F3 0x0000002E [ 3] literal string: application:willContinueUserActivityWithType:
0x100002121 0x00000035 [ 3] literal string: application:continueUserActivity:restorationHandler:
0x100002156 0x00000039 [ 3] literal string: application:didFailToContinueUserActivityWithType:error:
0x10000218F 0x00000023 [ 3] literal string: application:didUpdateUserActivity:
0x1000021B2 0x00000034 [ 3] literal string: application:userDidAcceptCloudKitShareWithMetadata:
0x1000021E6 0x00000007 [ 3] literal string: window
0x1000021ED 0x0000000B [ 3] literal string: setWindow:
0x1000021F8 0x00000009 [ 3] literal string: isEqual:
0x100002201 0x00000006 [ 3] literal string: class
0x100002207 0x00000005 [ 3] literal string: self
0x10000220C 0x00000011 [ 3] literal string: performSelector:
0x10000221D 0x0000001C [ 3] literal string: performSelector:withObject:
0x100002239 0x00000027 [ 3] literal string: performSelector:withObject:withObject:
0x100002260 0x00000008 [ 3] literal string: isProxy
0x100002268 0x0000000F [ 3] literal string: isKindOfClass:
0x100002277 0x00000011 [ 3] literal string: isMemberOfClass:
0x100002288 0x00000014 [ 3] literal string: conformsToProtocol:
0x10000229C 0x00000014 [ 3] literal string: respondsToSelector:
0x1000022B0 0x00000007 [ 3] literal string: retain
0x1000022B7 0x00000008 [ 3] literal string: release
0x1000022BF 0x0000000C [ 3] literal string: autorelease
0x1000022CB 0x0000000C [ 3] literal string: retainCount
0x1000022D7 0x00000005 [ 3] literal string: zone
0x1000022DC 0x00000005 [ 3] literal string: hash
0x1000022E1 0x0000000B [ 3] literal string: superclass
0x1000022EC 0x0000000C [ 3] literal string: description
0x1000022F8 0x00000011 [ 3] literal string: debugDescription
0x100002309 0x0000000E [ 3] literal string: .cxx_destruct
0x100002317 0x00000008 [ 3] literal string: _window
0x10000231F 0x00000012 [ 4] literal string: stringWithFormat:
0x100002331 0x0000000B [ 4] literal string: UTF8String
0x10000233C 0x00000020 [ 4] literal string: getSomeResultWithString:number:
0x10000235C 0x0000000C [ 4] literal string: propertyObj
0x100002368 0x00000010 [ 4] literal string: setPropertyObj:
0x100002378 0x0000000B [ 4] literal string: sampleName
0x100002383 0x0000000F [ 4] literal string: setSampleName:
0x100002392 0x00000009 [ 4] literal string: sampleId
0x10000239B 0x0000000D [ 4] literal string: setSampleId:
0x1000023A8 0x0000000D [ 4] literal string: _propertyObj
0x1000023B5 0x0000000C [ 4] literal string: _sampleName
0x1000023C1 0x0000000A [ 4] literal string: _sampleId
0x1000023CB 0x00000004 [ 5] literal string: new
0x1000023CF 0x0000000F [ 5] literal string: numberWithInt:
0x1000023DE 0x0000000F [ 2] literal string: ViewController
0x1000023ED 0x0000000C [ 3] literal string: AppDelegate
0x1000023F9 0x00000016 [ 3] literal string: UIApplicationDelegate
0x10000240F 0x00000009 [ 3] literal string: NSObject
0x100002418 0x00000002 [ 3] literal string: �
0x10000241A 0x0000000D [ 4] literal string: SampleObject
0x100002427 0x00000002 [ 4] literal string: �
0x100002429 0x00000008 [ 2] literal string: v16@0:8
0x100002431 0x0000000B [ 3] literal string: v24@0:8@16
0x10000243C 0x0000001A [ 3] literal string: v24@0:8@"UIApplication"16
0x100002456 0x0000000E [ 3] literal string: B32@0:8@16@24
0x100002464 0x0000002B [ 3] literal string: B32@0:8@"UIApplication"16@"NSDictionary"24
0x10000248F 0x00000024 [ 3] literal string: B32@0:8@"UIApplication"16@"NSURL"24
0x1000024B3 0x00000014 [ 3] literal string: B48@0:8@16@24@32@40
0x1000024C7 0x00000034 [ 3] literal string: B48@0:8@"UIApplication"16@"NSURL"24@"NSString"32@40
0x1000024FB 0x00000011 [ 3] literal string: B40@0:8@16@24@32
0x10000250C 0x00000035 [ 3] literal string: B40@0:8@"UIApplication"16@"NSURL"24@"NSDictionary"32
0x100002541 0x00000011 [ 3] literal string: v40@0:8@16q24d32
0x100002552 0x00000020 [ 3] literal string: v40@0:8@"UIApplication"16q24d32
0x100002572 0x0000000E [ 3] literal string: v32@0:8@16q24
0x100002580 0x0000001D [ 3] literal string: v32@0:8@"UIApplication"16q24
0x10000259D 0x0000002D [ 3] literal string: v56@0:8@16{CGRect={CGPoint=dd}{CGSize=dd}}24
0x1000025CA 0x0000003C [ 3] literal string: v56@0:8@"UIApplication"16{CGRect={CGPoint=dd}{CGSize=dd}}24
0x100002606 0x0000000E [ 3] literal string: v32@0:8@16@24
0x100002614 0x00000039 [ 3] literal string: v32@0:8@"UIApplication"16@"UIUserNotificationSettings"24
0x10000264D 0x00000025 [ 3] literal string: v32@0:8@"UIApplication"16@"NSData"24
0x100002672 0x00000026 [ 3] literal string: v32@0:8@"UIApplication"16@"NSError"24
0x100002698 0x0000002B [ 3] literal string: v32@0:8@"UIApplication"16@"NSDictionary"24
0x1000026C3 0x00000032 [ 3] literal string: v32@0:8@"UIApplication"16@"UILocalNotification"24
0x1000026F5 0x00000015 [ 3] literal string: v48@0:8@16@24@32@?40
0x10000270A 0x00000048 [ 3] literal string: v48@0:8@"UIApplication"16@"NSString"24@"UILocalNotification"32@?<v@?>40
0x100002752 0x00000018 [ 3] literal string: v56@0:8@16@24@32@40@?48
0x10000276A 0x00000052 [ 3] literal string: v56@0:8@"UIApplication"16@"NSString"24@"NSDictionary"32@"NSDictionary"40@?<v@?>48
0x1000027BC 0x00000041 [ 3] literal string: v48@0:8@"UIApplication"16@"NSString"24@"NSDictionary"32@?<v@?>40
0x1000027FD 0x00000059 [ 3] literal string: v56@0:8@"UIApplication"16@"NSString"24@"UILocalNotification"32@"NSDictionary"40@?<v@?>48
0x100002856 0x00000012 [ 3] literal string: v40@0:8@16@24@?32
0x100002868 0x00000035 [ 3] literal string: v40@0:8@"UIApplication"16@"NSDictionary"24@?<v@?Q>32
0x10000289D 0x0000000F [ 3] literal string: v32@0:8@16@?24
0x1000028AC 0x00000024 [ 3] literal string: v32@0:8@"UIApplication"16@?<v@?Q>24
0x1000028D0 0x00000042 [ 3] literal string: v40@0:8@"UIApplication"16@"UIApplicationShortcutItem"24@?<v@?B>32
0x100002912 0x00000030 [ 3] literal string: v40@0:8@"UIApplication"16@"NSString"24@?<v@?>32
0x100002942 0x00000043 [ 3] literal string: v40@0:8@"UIApplication"16@"NSDictionary"24@?<v@?@"NSDictionary">32
0x100002985 0x0000000E [ 3] literal string: Q32@0:8@16@24
0x100002993 0x00000027 [ 3] literal string: Q32@0:8@"UIApplication"16@"UIWindow"24
0x1000029BA 0x00000027 [ 3] literal string: B32@0:8@"UIApplication"16@"NSString"24
0x1000029E1 0x00000011 [ 3] literal string: @40@0:8@16@24@32
0x1000029F2 0x00000044 [ 3] literal string: @"UIViewController"40@0:8@"UIApplication"16@"NSArray"24@"NSCoder"32
0x100002A36 0x00000026 [ 3] literal string: B32@0:8@"UIApplication"16@"NSCoder"24
0x100002A5C 0x00000026 [ 3] literal string: v32@0:8@"UIApplication"16@"NSCoder"24
0x100002A82 0x00000012 [ 3] literal string: B40@0:8@16@24@?32
0x100002A94 0x00000040 [ 3] literal string: B40@0:8@"UIApplication"16@"NSUserActivity"24@?<v@?@"NSArray">32
0x100002AD4 0x00000011 [ 3] literal string: v40@0:8@16@24@32
0x100002AE5 0x00000033 [ 3] literal string: v40@0:8@"UIApplication"16@"NSString"24@"NSError"32
0x100002B18 0x0000002D [ 3] literal string: v32@0:8@"UIApplication"16@"NSUserActivity"24
0x100002B45 0x0000002E [ 3] literal string: v32@0:8@"UIApplication"16@"CKShareMetadata"24
0x100002B73 0x00000008 [ 3] literal string: @16@0:8
0x100002B7B 0x00000012 [ 3] literal string: @"UIWindow"16@0:8
0x100002B8D 0x00000015 [ 3] literal string: v24@0:8@"UIWindow"16
0x100002BA2 0x0000000B [ 3] literal string: B24@0:8@16
0x100002BAD 0x00000008 [ 3] literal string: #16@0:8
0x100002BB5 0x0000000B [ 3] literal string: @24@0:8:16
0x100002BC0 0x0000000E [ 3] literal string: @32@0:8:16@24
0x100002BCE 0x00000011 [ 3] literal string: @40@0:8:16@24@32
0x100002BDF 0x00000008 [ 3] literal string: B16@0:8
0x100002BE7 0x0000000B [ 3] literal string: B24@0:8#16
0x100002BF2 0x00000015 [ 3] literal string: B24@0:8@"Protocol"16
0x100002C07 0x0000000B [ 3] literal string: B24@0:8:16
0x100002C12 0x00000009 [ 3] literal string: Vv16@0:8
0x100002C1B 0x00000008 [ 3] literal string: Q16@0:8
0x100002C23 0x00000012 [ 3] literal string: ^{_NSZone=}16@0:8
0x100002C35 0x00000012 [ 3] literal string: @"NSString"16@0:8
0x100002C47 0x0000000C [ 3] literal string: @"UIWindow"
0x100002C53 0x0000000B [ 4] literal string: v24@0:8Q16
0x100002C5E 0x0000000C [ 4] literal string: @"NSObject"
0x100002C6A 0x0000000C [ 4] literal string: @"NSString"
0x100002C76 0x00000002 [ 4] literal string: Q
0x100002C78 0x00000005 [ 3] literal string: hash
0x100002C7D 0x00000005 [ 3] literal string: TQ,R
0x100002C82 0x0000000B [ 3] literal string: superclass
0x100002C8D 0x00000005 [ 3] literal string: T#,R
0x100002C92 0x0000000C [ 3] literal string: description
0x100002C9E 0x00000011 [ 3] literal string: T@"NSString",R,C
0x100002CAF 0x00000011 [ 3] literal string: debugDescription
0x100002CC0 0x00000007 [ 3] literal string: window
0x100002CC7 0x00000011 [ 3] literal string: T@"UIWindow",&,N
0x100002CD8 0x0000001A [ 3] literal string: T@"UIWindow",&,N,V_window
0x100002CF2 0x00000010 [ 4] literal string: SampleObjectKey
0x100002D02 0x00000006 [ 4] literal string: %@:%@
0x100002D08 0x0000000B [ 4] literal string: %@:%@:%lul
0x100002D13 0x0000001E [ 4] literal string: composite string:%@,succeeded
0x100002D31 0x00000006 [ 4] literal string: v8@?0
0x100002D37 0x0000000B [ 4] literal string: sampleName
0x100002D42 0x0000001E [ 4] literal string: T@"NSString",&,N,V_sampleName
0x100002D60 0x00000009 [ 4] literal string: sampleId
0x100002D69 0x00000010 [ 4] literal string: TQ,N,V_sampleId
0x100002D79 0x0000000C [ 4] literal string: propertyObj
0x100002D85 0x0000001F [ 4] literal string: T@"NSObject",&,N,V_propertyObj
0x100002DA4 0x00000003 [ 5] literal string: ab
0x100002DA8 0x0000002C [ 4] GCC_except_table0
0x100002DD4 0x00000048 [ 4] GCC_except_table3
0x100002E1C 0x0000016A [ 1] opaque_section
0x100002F88 0x00000074 [ 0] compact unwind info
0x100003000 0x00000008 [ 0] non-lazy-pointer-to-local: dyld_stub_binder
0x100003008 0x00000008 [ 0] non-lazy-pointer
0x100003010 0x00000008 [ 0] non-lazy-pointer-to-local: __NSConcreteStackBlock
0x100003018 0x00000008 [ 0] non-lazy-pointer-to-local: ___gxx_personality_v0
0x100003020 0x00000008 [ 0] non-lazy-pointer-to-local: __dispatch_main_q
0x100003028 0x00000008 [ 0] non-lazy-pointer-to-local: _objc_msgSend
0x100003030 0x00000008 [ 6] _NSLog
0x100003038 0x00000008 [ 6] _NSStringFromClass
0x100003040 0x00000008 [ 9] _UIApplicationMain
0x100003048 0x00000008 [ 8] __Block_object_assign
0x100003050 0x00000008 [ 8] __Block_object_dispose
0x100003058 0x00000008 [ 8] __Unwind_Resume
0x100003060 0x00000008 [ 8] _dispatch_async
0x100003068 0x00000008 [ 7] _objc_autoreleasePoolPop
0x100003070 0x00000008 [ 7] _objc_autoreleasePoolPush
0x100003078 0x00000008 [ 7] _objc_msgSend
0x100003080 0x00000008 [ 7] _objc_msgSendSuper2
0x100003088 0x00000008 [ 7] _objc_release
0x100003090 0x00000008 [ 7] _objc_retain
0x100003098 0x00000008 [ 7] _objc_retainAutorelease
0x1000030A0 0x00000008 [ 7] _objc_retainAutoreleaseReturnValue
0x1000030A8 0x00000008 [ 7] _objc_retainAutoreleasedReturnValue
0x1000030B0 0x00000008 [ 7] _objc_storeStrong
0x1000030B8 0x00000008 [ 8] _puts
0x1000030C0 0x00000030 [ 4] ___block_descriptor_tmp
0x1000030F0 0x00000020 [ 4] CFString
0x100003110 0x00000020 [ 4] CFString
0x100003130 0x00000020 [ 4] CFString
0x100003150 0x00000020 [ 4] CFString
0x100003170 0x00000020 [ 5] CFString
0x100003190 0x00000008 [ 2] anon
0x100003198 0x00000008 [ 3] anon
0x1000031A0 0x00000008 [ 4] anon
0x1000031A8 0x00000008 [ 3] l_OBJC_LABEL_PROTOCOL_$_NSObject
0x1000031B0 0x00000008 [ 3] l_OBJC_LABEL_PROTOCOL_$_UIApplicationDelegate
0x1000031B8 0x00000008 [ 0] objc image info
0x1000031C0 0x00000048 [ 2] l_OBJC_METACLASS_RO_$_ViewController
0x100003208 0x00000038 [ 2] l_OBJC_$_INSTANCE_METHODS_ViewController
0x100003240 0x00000048 [ 2] l_OBJC_CLASS_RO_$_ViewController
0x100003288 0x000001D0 [ 3] l_OBJC_$_PROTOCOL_INSTANCE_METHODS_NSObject
0x100003458 0x00000020 [ 3] l_OBJC_$_PROTOCOL_INSTANCE_METHODS_OPT_NSObject
0x100003478 0x00000048 [ 3] l_OBJC_$_PROP_LIST_NSObject
0x1000034C0 0x000000A0 [ 3] l_OBJC_$_PROTOCOL_METHOD_TYPES_NSObject
0x100003560 0x00000018 [ 3] l_OBJC_$_PROTOCOL_REFS_UIApplicationDelegate
0x100003578 0x00000488 [ 3] l_OBJC_$_PROTOCOL_INSTANCE_METHODS_OPT_UIApplicationDelegate
0x100003A00 0x00000018 [ 3] l_OBJC_$_PROP_LIST_UIApplicationDelegate
0x100003A18 0x00000180 [ 3] l_OBJC_$_PROTOCOL_METHOD_TYPES_UIApplicationDelegate
0x100003B98 0x00000018 [ 3] l_OBJC_CLASS_PROTOCOLS_$_AppDelegate
0x100003BB0 0x00000048 [ 3] l_OBJC_METACLASS_RO_$_AppDelegate
0x100003BF8 0x000000E0 [ 3] l_OBJC_$_INSTANCE_METHODS_AppDelegate
0x100003CD8 0x00000028 [ 3] l_OBJC_$_INSTANCE_VARIABLES_AppDelegate
0x100003D00 0x00000058 [ 3] l_OBJC_$_PROP_LIST_AppDelegate
0x100003D58 0x00000048 [ 3] l_OBJC_CLASS_RO_$_AppDelegate
0x100003DA0 0x00000048 [ 4] l_OBJC_METACLASS_RO_$_SampleObject
0x100003DE8 0x000000C8 [ 4] l_OBJC_$_INSTANCE_METHODS_SampleObject
0x100003EB0 0x00000068 [ 4] l_OBJC_$_INSTANCE_VARIABLES_SampleObject
0x100003F18 0x00000038 [ 4] l_OBJC_$_PROP_LIST_SampleObject
0x100003F50 0x00000048 [ 4] l_OBJC_CLASS_RO_$_SampleObject
0x100003F98 0x00000008 [ 2] pointer-to-literal-cstring
0x100003FA0 0x00000008 [ 2] pointer-to-literal-cstring
0x100003FA8 0x00000008 [ 4] pointer-to-literal-cstring
0x100003FB0 0x00000008 [ 4] pointer-to-literal-cstring
0x100003FB8 0x00000008 [ 5] pointer-to-literal-cstring
0x100003FC0 0x00000008 [ 5] pointer-to-literal-cstring
0x100003FC8 0x00000008 [ 5] pointer-to-literal-cstring
0x100003FD0 0x00000008 [ 5] pointer-to-literal-cstring
0x100003FD8 0x00000008 [ 5] pointer-to-literal-cstring
0x100003FE0 0x00000008 [ 4] objc-class-ref
0x100003FE8 0x00000008 [ 5] objc-class-ref
0x100003FF0 0x00000008 [ 5] objc-class-ref
0x100003FF8 0x00000008 [ 5] objc-class-ref
0x100004000 0x00000008 [ 5] objc-class-ref
0x100004008 0x00000008 [ 2] anon
0x100004010 0x00000008 [ 3] _OBJC_IVAR_$_AppDelegate._window
0x100004018 0x00000008 [ 4] _OBJC_IVAR_$_SampleObject._propertyObj
0x100004020 0x00000008 [ 4] _OBJC_IVAR_$_SampleObject._sampleName
0x100004028 0x00000008 [ 4] _OBJC_IVAR_$_SampleObject._sampleId
0x100004030 0x00000028 [ 2] _OBJC_CLASS_$_ViewController
0x100004058 0x00000028 [ 2] _OBJC_METACLASS_$_ViewController
0x100004080 0x00000028 [ 3] _OBJC_METACLASS_$_AppDelegate
0x1000040A8 0x00000028 [ 3] _OBJC_CLASS_$_AppDelegate
0x1000040D0 0x00000028 [ 4] _OBJC_METACLASS_$_SampleObject
0x1000040F8 0x00000028 [ 4] _OBJC_CLASS_$_SampleObject
0x100004120 0x00000060 [ 3] l_OBJC_PROTOCOL_$_NSObject
0x100004180 0x00000060 [ 3] l_OBJC_PROTOCOL_$_UIApplicationDelegate
0x1000041E0 0x00000008 [ 4] _cntstr
# Dead Stripped Symbols:
# Size File Name
<<dead>> 0x00000018 [ 2] CIE
<<dead>> 0x00000008 [ 3] literal string: v16@0:8
<<dead>> 0x00000018 [ 3] CIE
<<dead>> 0x0000000E [ 4] literal string: .cxx_destruct
<<dead>> 0x0000000E [ 4] literal string: v32@0:8@16@24
<<dead>> 0x00000008 [ 4] literal string: v16@0:8
<<dead>> 0x00000008 [ 4] literal string: @16@0:8
<<dead>> 0x0000000B [ 4] literal string: v24@0:8@16
<<dead>> 0x00000008 [ 4] literal string: Q16@0:8
<<dead>> 0x00000020 [ 4] CIE
<<dead>> 0x00000018 [ 4] CIE
<<dead>> 0x00000010 [ 5] literal string: setPropertyObj:
<<dead>> 0x00000020 [ 5] literal string: getSomeResultWithString:number:
<<dead>> 0x00000006 [ 5] literal string: class
<<dead>> 0x00000018 [ 5] CIE
使用反汇编工具对执行文件进行反汇编可以对Mach-O文件有一个直观的认识:
bogon:Downloads fangyang$ otool -tV SampleApp.app/SampleApp
SampleApp.app/SampleApp:
(__TEXT,__text) section
-[ViewController viewDidLoad]:
0000000100000d80 pushq %rbp
0000000100000d81 movq %rsp, %rbp
0000000100000d84 subq $0x20, %rsp
0000000100000d88 leaq -0x20(%rbp), %rax
0000000100000d8c movq %rdi, -0x8(%rbp)
0000000100000d90 movq %rsi, -0x10(%rbp)
0000000100000d94 movq -0x8(%rbp), %rsi
0000000100000d98 movq %rsi, -0x20(%rbp)
0000000100000d9c movq 0x3265(%rip), %rsi ## Objc class ref: ViewController
0000000100000da3 movq %rsi, -0x18(%rbp)
0000000100000da7 movq 0x31ea(%rip), %rsi ## Objc selector ref: viewDidLoad
0000000100000dae movq %rax, %rdi
0000000100000db1 callq 0x100001816 ## Objc message: -[[%rdi super] viewDidLoad]
0000000100000db6 addq $0x20, %rsp
0000000100000dba popq %rbp
0000000100000dbb retq
0000000100000dbc nopl (%rax)
-[ViewController didReceiveMemoryWarning]:
0000000100000dc0 pushq %rbp
0000000100000dc1 movq %rsp, %rbp
0000000100000dc4 subq $0x20, %rsp
0000000100000dc8 leaq -0x20(%rbp), %rax
0000000100000dcc movq %rdi, -0x8(%rbp)
0000000100000dd0 movq %rsi, -0x10(%rbp)
0000000100000dd4 movq -0x8(%rbp), %rsi
0000000100000dd8 movq %rsi, -0x20(%rbp)
0000000100000ddc movq 0x3225(%rip), %rsi ## Objc class ref: ViewController
0000000100000de3 movq %rsi, -0x18(%rbp)
0000000100000de7 movq 0x31b2(%rip), %rsi ## Objc selector ref: didReceiveMemoryWarning
0000000100000dee movq %rax, %rdi
0000000100000df1 callq 0x100001816 ## Objc message: -[[%rdi super] didReceiveMemoryWarning]
0000000100000df6 addq $0x20, %rsp
0000000100000dfa popq %rbp
0000000100000dfb retq
0000000100000dfc nop
0000000100000dfd nop
0000000100000dfe nop
0000000100000dff nop
-[AppDelegate application:didFinishLaunchingWithOptions:]:
0000000100000e00 pushq %rbp
0000000100000e01 movq %rsp, %rbp
0000000100000e04 subq $0x30, %rsp
0000000100000e08 leaq -0x18(%rbp), %rax
0000000100000e0c movq %rdi, -0x8(%rbp)
0000000100000e10 movq %rsi, -0x10(%rbp)
0000000100000e14 movq $0x0, -0x18(%rbp)
0000000100000e1c movq %rax, %rdi
0000000100000e1f movq %rdx, %rsi
0000000100000e22 movq %rcx, -0x28(%rbp)
0000000100000e26 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000e2b leaq -0x20(%rbp), %rax
0000000100000e2f movq $0x0, -0x20(%rbp)
0000000100000e37 movq -0x28(%rbp), %rcx
0000000100000e3b movq %rax, %rdi
0000000100000e3e movq %rcx, %rsi
0000000100000e41 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000e46 xorl %r8d, %r8d
0000000100000e49 movl %r8d, %esi
0000000100000e4c leaq -0x20(%rbp), %rax
0000000100000e50 movq %rax, %rdi
0000000100000e53 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000e58 xorl %r8d, %r8d
0000000100000e5b movl %r8d, %esi
0000000100000e5e leaq -0x18(%rbp), %rax
0000000100000e62 movq %rax, %rdi
0000000100000e65 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000e6a movb $0x1, %r9b
0000000100000e6d andb $0x1, %r9b
0000000100000e71 movzbl %r9b, %eax
0000000100000e75 addq $0x30, %rsp
0000000100000e79 popq %rbp
0000000100000e7a retq
0000000100000e7b nopl (%rax,%rax)
-[AppDelegate applicationWillResignActive:]:
0000000100000e80 pushq %rbp
0000000100000e81 movq %rsp, %rbp
0000000100000e84 subq $0x20, %rsp
0000000100000e88 leaq -0x18(%rbp), %rax
0000000100000e8c movq %rdi, -0x8(%rbp)
0000000100000e90 movq %rsi, -0x10(%rbp)
0000000100000e94 movq $0x0, -0x18(%rbp)
0000000100000e9c movq %rax, %rdi
0000000100000e9f movq %rdx, %rsi
0000000100000ea2 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000ea7 xorl %ecx, %ecx
0000000100000ea9 movl %ecx, %esi
0000000100000eab leaq -0x18(%rbp), %rax
0000000100000eaf movq %rax, %rdi
0000000100000eb2 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000eb7 addq $0x20, %rsp
0000000100000ebb popq %rbp
0000000100000ebc retq
0000000100000ebd nopl (%rax)
-[AppDelegate applicationDidEnterBackground:]:
0000000100000ec0 pushq %rbp
0000000100000ec1 movq %rsp, %rbp
0000000100000ec4 subq $0x20, %rsp
0000000100000ec8 leaq -0x18(%rbp), %rax
0000000100000ecc movq %rdi, -0x8(%rbp)
0000000100000ed0 movq %rsi, -0x10(%rbp)
0000000100000ed4 movq $0x0, -0x18(%rbp)
0000000100000edc movq %rax, %rdi
0000000100000edf movq %rdx, %rsi
0000000100000ee2 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000ee7 xorl %ecx, %ecx
0000000100000ee9 movl %ecx, %esi
0000000100000eeb leaq -0x18(%rbp), %rax
0000000100000eef movq %rax, %rdi
0000000100000ef2 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000ef7 addq $0x20, %rsp
0000000100000efb popq %rbp
0000000100000efc retq
0000000100000efd nopl (%rax)
-[AppDelegate applicationWillEnterForeground:]:
0000000100000f00 pushq %rbp
0000000100000f01 movq %rsp, %rbp
0000000100000f04 subq $0x20, %rsp
0000000100000f08 leaq -0x18(%rbp), %rax
0000000100000f0c movq %rdi, -0x8(%rbp)
0000000100000f10 movq %rsi, -0x10(%rbp)
0000000100000f14 movq $0x0, -0x18(%rbp)
0000000100000f1c movq %rax, %rdi
0000000100000f1f movq %rdx, %rsi
0000000100000f22 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000f27 xorl %ecx, %ecx
0000000100000f29 movl %ecx, %esi
0000000100000f2b leaq -0x18(%rbp), %rax
0000000100000f2f movq %rax, %rdi
0000000100000f32 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000f37 addq $0x20, %rsp
0000000100000f3b popq %rbp
0000000100000f3c retq
0000000100000f3d nopl (%rax)
-[AppDelegate applicationDidBecomeActive:]:
0000000100000f40 pushq %rbp
0000000100000f41 movq %rsp, %rbp
0000000100000f44 subq $0x20, %rsp
0000000100000f48 leaq -0x18(%rbp), %rax
0000000100000f4c movq %rdi, -0x8(%rbp)
0000000100000f50 movq %rsi, -0x10(%rbp)
0000000100000f54 movq $0x0, -0x18(%rbp)
0000000100000f5c movq %rax, %rdi
0000000100000f5f movq %rdx, %rsi
0000000100000f62 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000f67 xorl %ecx, %ecx
0000000100000f69 movl %ecx, %esi
0000000100000f6b leaq -0x18(%rbp), %rax
0000000100000f6f movq %rax, %rdi
0000000100000f72 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000f77 addq $0x20, %rsp
0000000100000f7b popq %rbp
0000000100000f7c retq
0000000100000f7d nopl (%rax)
-[AppDelegate applicationWillTerminate:]:
0000000100000f80 pushq %rbp
0000000100000f81 movq %rsp, %rbp
0000000100000f84 subq $0x20, %rsp
0000000100000f88 leaq -0x18(%rbp), %rax
0000000100000f8c movq %rdi, -0x8(%rbp)
0000000100000f90 movq %rsi, -0x10(%rbp)
0000000100000f94 movq $0x0, -0x18(%rbp)
0000000100000f9c movq %rax, %rdi
0000000100000f9f movq %rdx, %rsi
0000000100000fa2 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000fa7 xorl %ecx, %ecx
0000000100000fa9 movl %ecx, %esi
0000000100000fab leaq -0x18(%rbp), %rax
0000000100000faf movq %rax, %rdi
0000000100000fb2 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100000fb7 addq $0x20, %rsp
0000000100000fbb popq %rbp
0000000100000fbc retq
0000000100000fbd nopl (%rax)
-[AppDelegate window]:
0000000100000fc0 pushq %rbp
0000000100000fc1 movq %rsp, %rbp
0000000100000fc4 movq %rdi, -0x8(%rbp)
0000000100000fc8 movq %rsi, -0x10(%rbp)
0000000100000fcc movq -0x8(%rbp), %rsi
0000000100000fd0 movq _OBJC_IVAR_$_AppDelegate._window(%rip), %rdi
0000000100000fd7 movq (%rsi,%rdi), %rax
0000000100000fdb popq %rbp
0000000100000fdc retq
0000000100000fdd nopl (%rax)
-[AppDelegate setWindow:]:
0000000100000fe0 pushq %rbp
0000000100000fe1 movq %rsp, %rbp
0000000100000fe4 subq $0x20, %rsp
0000000100000fe8 movq %rdi, -0x8(%rbp)
0000000100000fec movq %rsi, -0x10(%rbp)
0000000100000ff0 movq %rdx, -0x18(%rbp)
0000000100000ff4 movq -0x18(%rbp), %rdx
0000000100000ff8 movq -0x8(%rbp), %rsi
0000000100000ffc movq _OBJC_IVAR_$_AppDelegate._window(%rip), %rdi
0000000100001003 addq %rdi, %rsi
0000000100001006 movq %rsi, %rdi
0000000100001009 movq %rdx, %rsi
000000010000100c callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100001011 addq $0x20, %rsp
0000000100001015 popq %rbp
0000000100001016 retq
0000000100001017 nopw (%rax,%rax)
-[AppDelegate .cxx_destruct]:
0000000100001020 pushq %rbp
0000000100001021 movq %rsp, %rbp
0000000100001024 subq $0x10, %rsp
0000000100001028 xorl %eax, %eax
000000010000102a movl %eax, %ecx
000000010000102c movq %rdi, -0x8(%rbp)
0000000100001030 movq %rsi, -0x10(%rbp)
0000000100001034 movq -0x8(%rbp), %rsi
0000000100001038 movq _OBJC_IVAR_$_AppDelegate._window(%rip), %rdi
000000010000103f addq %rdi, %rsi
0000000100001042 movq %rsi, %rdi
0000000100001045 movq %rcx, %rsi
0000000100001048 callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000104d addq $0x10, %rsp
0000000100001051 popq %rbp
0000000100001052 retq
0000000100001053 nop
0000000100001054 nop
0000000100001055 nop
0000000100001056 nop
0000000100001057 nop
0000000100001058 nop
0000000100001059 nop
000000010000105a nop
000000010000105b nop
000000010000105c nop
000000010000105d nop
000000010000105e nop
000000010000105f nop
-[SampleObject getSomeResultWithString:number:]:
0000000100001060 pushq %rbp
0000000100001061 movq %rsp, %rbp
0000000100001064 subq $0xe0, %rsp
000000010000106b movq %rdi, -0x8(%rbp)
000000010000106f movq %rsi, -0x10(%rbp)
0000000100001073 movq $0x0, -0x18(%rbp)
000000010000107b leaq -0x18(%rbp), %rdi
000000010000107f movq %rdx, %rsi
0000000100001082 movq %rcx, -0xb0(%rbp)
0000000100001089 callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000108e movq $0x0, -0x20(%rbp)
0000000100001096 leaq -0x20(%rbp), %rdi
000000010000109a movq -0xb0(%rbp), %rsi
00000001000010a1 callq 0x10000183a ## symbol stub for: _objc_storeStrong
00000001000010a6 movq 0x2f33(%rip), %rdi ## Objc class ref: _OBJC_CLASS_$_NSString
00000001000010ad movq -0x18(%rbp), %rcx
00000001000010b1 movq -0x20(%rbp), %r8
00000001000010b5 movq 0x2eec(%rip), %rsi ## Objc selector ref: stringWithFormat:
00000001000010bc leaq 0x204d(%rip), %rdx ## Objc cfstring ref: @"%@:%@"
00000001000010c3 movq 0x1f5e(%rip), %rax ## Objc message: +[NSString stringWithFormat:]
00000001000010ca xorl %r9d, %r9d
00000001000010cd movb %r9b, %r10b
00000001000010d0 movq %rax, -0xb8(%rbp)
00000001000010d7 movb %r10b, %al
00000001000010da movq -0xb8(%rbp), %r11
00000001000010e1 callq *%r11
00000001000010e4 movq %rax, -0xc0(%rbp)
00000001000010eb jmp 0x1000010f0
00000001000010f0 movq -0xc0(%rbp), %rdi
00000001000010f7 callq 0x100001834 ## symbol stub for: _objc_retainAutoreleasedReturnValue
00000001000010fc movq 0x1f1d(%rip), %rdi ## literal pool symbol address: __dispatch_main_q
0000000100001103 leaq -0xa8(%rbp), %rcx
000000010000110a leaq -0x70(%rbp), %rdx
000000010000110e leaq ___Block_byref_object_dispose_(%rip), %rsi
0000000100001115 leaq ___Block_byref_object_copy_(%rip), %r8
000000010000111c movq %rax, -0x28(%rbp)
0000000100001120 movq $0x7b, -0x40(%rbp)
0000000100001128 movq $0x0, -0x70(%rbp)
0000000100001130 movq %rdx, -0x68(%rbp)
0000000100001134 movl $0x32000000, -0x60(%rbp)
000000010000113b movl $0x30, -0x5c(%rbp)
0000000100001142 movq %r8, -0x58(%rbp)
0000000100001146 movq %rsi, -0x50(%rbp)
000000010000114a movq $0x0, -0x48(%rbp)
0000000100001152 addq $0x28, %rdx
0000000100001156 addq $0x20, %rcx
000000010000115a movq %rdx, -0xc8(%rbp)
0000000100001161 movq %rcx, -0xd0(%rbp)
0000000100001168 callq 0x10000182e ## symbol stub for: _objc_retainAutoreleaseReturnValue
000000010000116d movq %rax, %rdi
0000000100001170 callq 0x100001834 ## symbol stub for: _objc_retainAutoreleasedReturnValue
0000000100001175 leaq ___block_descriptor_tmp(%rip), %rcx
000000010000117c leaq "___47-[SampleObject getSomeResultWithString:number:]_block_invoke"(%rip), %rdx
0000000100001183 movq 0x1e86(%rip), %rsi ## literal pool symbol address: __NSConcreteStackBlock
000000010000118a movq %rsi, -0xa8(%rbp)
0000000100001191 movl $0xc2000000, -0xa0(%rbp)
000000010000119b movl $0x0, -0x9c(%rbp)
00000001000011a5 movq %rdx, -0x98(%rbp)
00000001000011ac movq %rcx, -0x90(%rbp)
00000001000011b3 movq -0x28(%rbp), %rcx
00000001000011b7 movq %rcx, %rdi
00000001000011ba movq %rax, -0xd8(%rbp)
00000001000011c1 callq 0x100001822 ## symbol stub for: _objc_retain
00000001000011c6 leaq -0xa8(%rbp), %rcx
00000001000011cd leaq -0x70(%rbp), %rdx
00000001000011d1 movq %rax, -0x88(%rbp)
00000001000011d8 movq -0x40(%rbp), %rax
00000001000011dc movq %rax, -0x78(%rbp)
00000001000011e0 movq %rdx, -0x80(%rbp)
00000001000011e4 movq -0xd8(%rbp), %rdi
00000001000011eb movq %rcx, %rsi
00000001000011ee callq 0x1000017fe ## symbol stub for: _dispatch_async
00000001000011f3 movq -0xd8(%rbp), %rax
00000001000011fa movq %rax, %rdi
00000001000011fd callq 0x10000181c ## symbol stub for: _objc_release
0000000100001202 xorl %r9d, %r9d
0000000100001205 movl %r9d, %esi
0000000100001208 movq -0xd0(%rbp), %rax
000000010000120f movq %rax, %rdi
0000000100001212 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100001217 movl $0x8, %esi
000000010000121c leaq -0x70(%rbp), %rax
0000000100001220 movq %rax, %rdi
0000000100001223 callq 0x1000017f2 ## symbol stub for: __Block_object_dispose
0000000100001228 xorl %esi, %esi
000000010000122a movq -0xc8(%rbp), %rax
0000000100001231 movq %rax, %rdi
0000000100001234 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100001239 xorl %r9d, %r9d
000000010000123c movl %r9d, %esi
000000010000123f leaq -0x28(%rbp), %rax
0000000100001243 movq %rax, %rdi
0000000100001246 callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000124b xorl %r9d, %r9d
000000010000124e movl %r9d, %esi
0000000100001251 leaq -0x20(%rbp), %rax
0000000100001255 movq %rax, %rdi
0000000100001258 callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000125d xorl %r9d, %r9d
0000000100001260 movl %r9d, %esi
0000000100001263 leaq -0x18(%rbp), %rax
0000000100001267 movq %rax, %rdi
000000010000126a callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000126f addq $0xe0, %rsp
0000000100001276 popq %rbp
0000000100001277 retq
0000000100001278 xorl %ecx, %ecx
000000010000127a movl %ecx, %esi
000000010000127c leaq -0x20(%rbp), %rdi
0000000100001280 movl %edx, %ecx
0000000100001282 movq %rax, -0x30(%rbp)
0000000100001286 movl %ecx, -0x34(%rbp)
0000000100001289 callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000128e xorl %ecx, %ecx
0000000100001290 movl %ecx, %esi
0000000100001292 leaq -0x18(%rbp), %rax
0000000100001296 movq %rax, %rdi
0000000100001299 callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000129e movq -0x30(%rbp), %rdi
00000001000012a2 callq 0x1000017f8 ## symbol stub for: __Unwind_Resume
00000001000012a7 nopw (%rax,%rax)
___Block_byref_object_copy_:
00000001000012b0 pushq %rbp
00000001000012b1 movq %rsp, %rbp
00000001000012b4 subq $0x20, %rsp
00000001000012b8 movq %rdi, -0x8(%rbp)
00000001000012bc movq %rsi, -0x10(%rbp)
00000001000012c0 movq -0x8(%rbp), %rsi
00000001000012c4 movq %rsi, %rdi
00000001000012c7 addq $0x28, %rdi
00000001000012cb movq -0x10(%rbp), %rax
00000001000012cf movq %rax, %rcx
00000001000012d2 addq $0x28, %rcx
00000001000012d6 movq 0x28(%rax), %rax
00000001000012da movq $0x0, 0x28(%rsi)
00000001000012e2 movq %rax, %rsi
00000001000012e5 movq %rcx, -0x18(%rbp)
00000001000012e9 callq 0x10000183a ## symbol stub for: _objc_storeStrong
00000001000012ee xorl %edx, %edx
00000001000012f0 movl %edx, %esi
00000001000012f2 movq -0x18(%rbp), %rax
00000001000012f6 movq %rax, %rdi
00000001000012f9 callq 0x10000183a ## symbol stub for: _objc_storeStrong
00000001000012fe addq $0x20, %rsp
0000000100001302 popq %rbp
0000000100001303 retq
0000000100001304 nopw %cs:(%rax,%rax)
___Block_byref_object_dispose_:
0000000100001310 pushq %rbp
0000000100001311 movq %rsp, %rbp
0000000100001314 subq $0x10, %rsp
0000000100001318 xorl %eax, %eax
000000010000131a movl %eax, %esi
000000010000131c movq %rdi, -0x8(%rbp)
0000000100001320 movq -0x8(%rbp), %rdi
0000000100001324 addq $0x28, %rdi
0000000100001328 callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000132d addq $0x10, %rsp
0000000100001331 popq %rbp
0000000100001332 retq
0000000100001333 nopw %cs:(%rax,%rax)
___47-[SampleObject getSomeResultWithString:number:]_block_invoke:
0000000100001340 pushq %rbp
0000000100001341 movq %rsp, %rbp
0000000100001344 pushq %rbx
0000000100001345 subq $0x68, %rsp
0000000100001349 movq %rdi, -0x10(%rbp)
000000010000134d movq %rdi, %rax
0000000100001350 movq %rdi, -0x18(%rbp)
0000000100001354 movq 0x2c85(%rip), %rcx ## Objc class ref: _OBJC_CLASS_$_NSString
000000010000135b movq _cntstr(%rip), %rdx
0000000100001362 movq 0x20(%rdi), %r8
0000000100001366 movq 0x30(%rdi), %r9
000000010000136a movq 0x2c37(%rip), %rsi ## Objc selector ref: stringWithFormat:
0000000100001371 leaq 0x1db8(%rip), %rdi ## Objc cfstring ref: @"%@:%@:%lul"
0000000100001378 movq 0x1ca9(%rip), %r10 ## Objc message: +[NSString stringWithFormat:]
000000010000137f xorl %r11d, %r11d
0000000100001382 movb %r11b, %bl
0000000100001385 movq %rdi, -0x38(%rbp)
0000000100001389 movq %rcx, %rdi
000000010000138c movq -0x38(%rbp), %rcx
0000000100001390 movq %rdx, -0x40(%rbp)
0000000100001394 movq %rcx, %rdx
0000000100001397 movq -0x40(%rbp), %rcx
000000010000139b movq %rax, -0x48(%rbp)
000000010000139f movb %bl, %al
00000001000013a1 movb %bl, -0x49(%rbp)
00000001000013a4 callq *%r10
00000001000013a7 movq %rax, %rdi
00000001000013aa callq 0x100001834 ## symbol stub for: _objc_retainAutoreleasedReturnValue
00000001000013af movq %rax, -0x20(%rbp)
00000001000013b3 leaq 0x1d96(%rip), %rdi ## Objc cfstring ref: @"composite string:%@,succeeded"
00000001000013ba movq %rax, %rsi
00000001000013bd movb -0x49(%rbp), %al
00000001000013c0 callq 0x1000017da ## symbol stub for: _NSLog
00000001000013c5 jmp 0x1000013ca
00000001000013ca movq -0x20(%rbp), %rdi
00000001000013ce callq 0x100001828 ## symbol stub for: _objc_retainAutorelease
00000001000013d3 movq 0x2bd6(%rip), %rsi ## Objc selector ref: UTF8String
00000001000013da movq 0x1c47(%rip), %rdi ## Objc message: -[%rdi UTF8String]
00000001000013e1 movq %rdi, -0x58(%rbp)
00000001000013e5 movq %rax, %rdi
00000001000013e8 movq -0x58(%rbp), %rax
00000001000013ec callq *%rax
00000001000013ee movq %rax, -0x60(%rbp)
00000001000013f2 jmp 0x1000013f7
00000001000013f7 movq -0x60(%rbp), %rdi
00000001000013fb callq 0x100001840 ## symbol stub for: _puts
0000000100001400 movl %eax, -0x64(%rbp)
0000000100001403 jmp 0x100001408
0000000100001408 movq -0x20(%rbp), %rax
000000010000140c movq -0x48(%rbp), %rcx
0000000100001410 movq 0x28(%rcx), %rdx
0000000100001414 movq 0x8(%rdx), %rdx
0000000100001418 addq $0x28, %rdx
000000010000141c movq %rdx, %rdi
000000010000141f movq %rax, %rsi
0000000100001422 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100001427 xorl %r8d, %r8d
000000010000142a movl %r8d, %esi
000000010000142d leaq -0x20(%rbp), %rax
0000000100001431 movq %rax, %rdi
0000000100001434 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100001439 addq $0x68, %rsp
000000010000143d popq %rbx
000000010000143e popq %rbp
000000010000143f retq
0000000100001440 xorl %ecx, %ecx
0000000100001442 movl %ecx, %esi
0000000100001444 leaq -0x20(%rbp), %rdi
0000000100001448 movl %edx, %ecx
000000010000144a movq %rax, -0x28(%rbp)
000000010000144e movl %ecx, -0x2c(%rbp)
0000000100001451 callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100001456 movq -0x28(%rbp), %rdi
000000010000145a callq 0x1000017f8 ## symbol stub for: __Unwind_Resume
000000010000145f nop
___copy_helper_block_:
0000000100001460 pushq %rbp
0000000100001461 movq %rsp, %rbp
0000000100001464 subq $0x20, %rsp
0000000100001468 movq %rdi, -0x8(%rbp)
000000010000146c movq %rsi, -0x10(%rbp)
0000000100001470 movq -0x10(%rbp), %rsi
0000000100001474 movq -0x8(%rbp), %rdi
0000000100001478 movq %rdi, %rax
000000010000147b movq %rax, %rcx
000000010000147e addq $0x20, %rcx
0000000100001482 movq 0x20(%rsi), %rdx
0000000100001486 movq $0x0, 0x20(%rdi)
000000010000148e movq %rcx, %rdi
0000000100001491 movq %rsi, -0x18(%rbp)
0000000100001495 movq %rdx, %rsi
0000000100001498 movq %rax, -0x20(%rbp)
000000010000149c callq 0x10000183a ## symbol stub for: _objc_storeStrong
00000001000014a1 movl $0x8, %edx
00000001000014a6 movq -0x20(%rbp), %rax
00000001000014aa addq $0x28, %rax
00000001000014ae movq -0x18(%rbp), %rcx
00000001000014b2 movq 0x28(%rcx), %rsi
00000001000014b6 movq %rax, %rdi
00000001000014b9 callq 0x1000017ec ## symbol stub for: __Block_object_assign
00000001000014be addq $0x20, %rsp
00000001000014c2 popq %rbp
00000001000014c3 retq
00000001000014c4 nopw %cs:(%rax,%rax)
___destroy_helper_block_:
00000001000014d0 pushq %rbp
00000001000014d1 movq %rsp, %rbp
00000001000014d4 subq $0x10, %rsp
00000001000014d8 xorl %eax, %eax
00000001000014da movl %eax, %esi
00000001000014dc movq %rdi, -0x8(%rbp)
00000001000014e0 movq -0x8(%rbp), %rdi
00000001000014e4 movq %rdi, %rcx
00000001000014e7 addq $0x20, %rcx
00000001000014eb movq %rdi, -0x10(%rbp)
00000001000014ef movq %rcx, %rdi
00000001000014f2 callq 0x10000183a ## symbol stub for: _objc_storeStrong
00000001000014f7 movl $0x8, %esi
00000001000014fc movq -0x10(%rbp), %rcx
0000000100001500 movq 0x28(%rcx), %rdi
0000000100001504 callq 0x1000017f2 ## symbol stub for: __Block_object_dispose
0000000100001509 addq $0x10, %rsp
000000010000150d popq %rbp
000000010000150e retq
000000010000150f nop
-[SampleObject propertyObj]:
0000000100001510 pushq %rbp
0000000100001511 movq %rsp, %rbp
0000000100001514 movq %rdi, -0x8(%rbp)
0000000100001518 movq %rsi, -0x10(%rbp)
000000010000151c movq -0x8(%rbp), %rsi
0000000100001520 movq _OBJC_IVAR_$_SampleObject._propertyObj(%rip), %rdi
0000000100001527 movq (%rsi,%rdi), %rax
000000010000152b popq %rbp
000000010000152c retq
000000010000152d nopl (%rax)
-[SampleObject setPropertyObj:]:
0000000100001530 pushq %rbp
0000000100001531 movq %rsp, %rbp
0000000100001534 subq $0x20, %rsp
0000000100001538 movq %rdi, -0x8(%rbp)
000000010000153c movq %rsi, -0x10(%rbp)
0000000100001540 movq %rdx, -0x18(%rbp)
0000000100001544 movq -0x18(%rbp), %rdx
0000000100001548 movq -0x8(%rbp), %rsi
000000010000154c movq _OBJC_IVAR_$_SampleObject._propertyObj(%rip), %rdi
0000000100001553 addq %rdi, %rsi
0000000100001556 movq %rsi, %rdi
0000000100001559 movq %rdx, %rsi
000000010000155c callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100001561 addq $0x20, %rsp
0000000100001565 popq %rbp
0000000100001566 retq
0000000100001567 nopw (%rax,%rax)
-[SampleObject sampleName]:
0000000100001570 pushq %rbp
0000000100001571 movq %rsp, %rbp
0000000100001574 movq %rdi, -0x8(%rbp)
0000000100001578 movq %rsi, -0x10(%rbp)
000000010000157c movq -0x8(%rbp), %rsi
0000000100001580 movq _OBJC_IVAR_$_SampleObject._sampleName(%rip), %rdi
0000000100001587 movq (%rsi,%rdi), %rax
000000010000158b popq %rbp
000000010000158c retq
000000010000158d nopl (%rax)
-[SampleObject setSampleName:]:
0000000100001590 pushq %rbp
0000000100001591 movq %rsp, %rbp
0000000100001594 subq $0x20, %rsp
0000000100001598 movq %rdi, -0x8(%rbp)
000000010000159c movq %rsi, -0x10(%rbp)
00000001000015a0 movq %rdx, -0x18(%rbp)
00000001000015a4 movq -0x18(%rbp), %rdx
00000001000015a8 movq -0x8(%rbp), %rsi
00000001000015ac movq _OBJC_IVAR_$_SampleObject._sampleName(%rip), %rdi
00000001000015b3 addq %rdi, %rsi
00000001000015b6 movq %rsi, %rdi
00000001000015b9 movq %rdx, %rsi
00000001000015bc callq 0x10000183a ## symbol stub for: _objc_storeStrong
00000001000015c1 addq $0x20, %rsp
00000001000015c5 popq %rbp
00000001000015c6 retq
00000001000015c7 nopw (%rax,%rax)
-[SampleObject sampleId]:
00000001000015d0 pushq %rbp
00000001000015d1 movq %rsp, %rbp
00000001000015d4 movq %rdi, -0x8(%rbp)
00000001000015d8 movq %rsi, -0x10(%rbp)
00000001000015dc movq -0x8(%rbp), %rsi
00000001000015e0 movq _OBJC_IVAR_$_SampleObject._sampleId(%rip), %rdi
00000001000015e7 movq (%rsi,%rdi), %rax
00000001000015eb popq %rbp
00000001000015ec retq
00000001000015ed nopl (%rax)
-[SampleObject setSampleId:]:
00000001000015f0 pushq %rbp
00000001000015f1 movq %rsp, %rbp
00000001000015f4 movq %rdi, -0x8(%rbp)
00000001000015f8 movq %rsi, -0x10(%rbp)
00000001000015fc movq %rdx, -0x18(%rbp)
0000000100001600 movq -0x18(%rbp), %rdx
0000000100001604 movq -0x8(%rbp), %rsi
0000000100001608 movq _OBJC_IVAR_$_SampleObject._sampleId(%rip), %rdi
000000010000160f movq %rdx, (%rsi,%rdi)
0000000100001613 popq %rbp
0000000100001614 retq
0000000100001615 nopw %cs:(%rax,%rax)
-[SampleObject .cxx_destruct]:
0000000100001620 pushq %rbp
0000000100001621 movq %rsp, %rbp
0000000100001624 subq $0x20, %rsp
0000000100001628 xorl %eax, %eax
000000010000162a movl %eax, %ecx
000000010000162c movq %rdi, -0x8(%rbp)
0000000100001630 movq %rsi, -0x10(%rbp)
0000000100001634 movq -0x8(%rbp), %rsi
0000000100001638 movq _OBJC_IVAR_$_SampleObject._sampleName(%rip), %rdi
000000010000163f movq %rsi, %rdx
0000000100001642 addq %rdi, %rdx
0000000100001645 movq %rdx, %rdi
0000000100001648 movq %rsi, -0x18(%rbp)
000000010000164c movq %rcx, %rsi
000000010000164f callq 0x10000183a ## symbol stub for: _objc_storeStrong
0000000100001654 xorl %eax, %eax
0000000100001656 movl %eax, %esi
0000000100001658 movq _OBJC_IVAR_$_SampleObject._propertyObj(%rip), %rcx
000000010000165f movq -0x18(%rbp), %rdx
0000000100001663 addq %rcx, %rdx
0000000100001666 movq %rdx, %rdi
0000000100001669 callq 0x10000183a ## symbol stub for: _objc_storeStrong
000000010000166e addq $0x20, %rsp
0000000100001672 popq %rbp
0000000100001673 retq
0000000100001674 nop
0000000100001675 nop
0000000100001676 nop
0000000100001677 nop
0000000100001678 nop
0000000100001679 nop
000000010000167a nop
000000010000167b nop
000000010000167c nop
000000010000167d nop
000000010000167e nop
000000010000167f nop
_main:
0000000100001680 pushq %rbp
0000000100001681 movq %rsp, %rbp
0000000100001684 subq $0x60, %rsp
0000000100001688 movl $0x0, -0x4(%rbp)
000000010000168f movl %edi, -0x8(%rbp)
0000000100001692 movq %rsi, -0x10(%rbp)
0000000100001696 callq 0x10000180a ## symbol stub for: _objc_autoreleasePoolPush
000000010000169b movq 0x2946(%rip), %rsi ## Objc class ref: SampleObject
00000001000016a2 movq 0x290f(%rip), %rcx ## Objc selector ref: new
00000001000016a9 movq %rsi, %rdi
00000001000016ac movq %rcx, %rsi
00000001000016af movq %rax, -0x20(%rbp)
00000001000016b3 callq 0x100001810 ## Objc message: +[SampleObject new]
00000001000016b8 movq %rax, -0x18(%rbp)
00000001000016bc movq -0x18(%rbp), %rax
00000001000016c0 movq 0x2929(%rip), %rcx ## Objc class ref: _OBJC_CLASS_$_NSObject
00000001000016c7 movq 0x28ea(%rip), %rsi ## Objc selector ref: new
00000001000016ce movq %rcx, %rdi
00000001000016d1 movq %rax, -0x28(%rbp)
00000001000016d5 callq 0x100001810 ## Objc message: +[NSObject new]
00000001000016da movq 0x28df(%rip), %rsi ## Objc selector ref: setPropertyObj:
00000001000016e1 movq -0x28(%rbp), %rcx
00000001000016e5 movq %rcx, %rdi
00000001000016e8 movq %rax, %rdx
00000001000016eb movq %rax, -0x30(%rbp)
00000001000016ef callq 0x100001810 ## Objc message: -[%rdi setPropertyObj:]
00000001000016f4 movq -0x30(%rbp), %rax
00000001000016f8 movq %rax, %rdi
00000001000016fb callq 0x10000181c ## symbol stub for: _objc_release
0000000100001700 movl $0x2, %edx
0000000100001705 movq -0x18(%rbp), %rax
0000000100001709 movq 0x28e8(%rip), %rcx ## Objc class ref: _OBJC_CLASS_$_NSNumber
0000000100001710 movq 0x28b1(%rip), %rsi ## Objc selector ref: numberWithInt:
0000000100001717 movq %rcx, %rdi
000000010000171a movq %rax, -0x38(%rbp)
000000010000171e callq 0x100001810 ## Objc message: +[NSNumber numberWithInt:]
0000000100001723 movq %rax, %rdi
0000000100001726 callq 0x100001834 ## symbol stub for: _objc_retainAutoreleasedReturnValue
000000010000172b leaq 0x1a3e(%rip), %rcx ## Objc cfstring ref: @"ab"
0000000100001732 movq 0x2897(%rip), %rsi ## Objc selector ref: getSomeResultWithString:number:
0000000100001739 movq -0x38(%rbp), %rdi
000000010000173d movq %rcx, %rdx
0000000100001740 movq %rax, %rcx
0000000100001743 movq %rax, -0x40(%rbp)
0000000100001747 callq 0x100001810 ## Objc message: -[%rdi getSomeResultWithString:number:]
000000010000174c movq -0x40(%rbp), %rax
0000000100001750 movq %rax, %rdi
0000000100001753 callq 0x10000181c ## symbol stub for: _objc_release
0000000100001758 movl -0x8(%rbp), %edi
000000010000175b movq -0x10(%rbp), %rsi
000000010000175f movq 0x289a(%rip), %rax ## Objc class ref: AppDelegate
0000000100001766 movq 0x286b(%rip), %rcx ## Objc selector ref: class
000000010000176d movl %edi, -0x44(%rbp)
0000000100001770 movq %rax, %rdi
0000000100001773 movq %rsi, -0x50(%rbp)
0000000100001777 movq %rcx, %rsi
000000010000177a callq 0x100001810 ## Objc message: +[AppDelegate class]
000000010000177f movq %rax, %rdi
0000000100001782 callq 0x1000017e0 ## symbol stub for: _NSStringFromClass
0000000100001787 movq %rax, %rdi
000000010000178a callq 0x100001834 ## symbol stub for: _objc_retainAutoreleasedReturnValue
000000010000178f xorl %r8d, %r8d
0000000100001792 movl %r8d, %edx
0000000100001795 movl -0x44(%rbp), %edi
0000000100001798 movq -0x50(%rbp), %rsi
000000010000179c movq %rax, %rcx
000000010000179f movq %rax, -0x58(%rbp)
00000001000017a3 callq 0x1000017e6 ## symbol stub for: _UIApplicationMain
00000001000017a8 movl %eax, -0x4(%rbp)
00000001000017ab movq -0x58(%rbp), %rcx
00000001000017af movq %rcx, %rdi
00000001000017b2 callq 0x10000181c ## symbol stub for: _objc_release
00000001000017b7 xorl %eax, %eax
00000001000017b9 movl %eax, %esi
00000001000017bb leaq -0x18(%rbp), %rcx
00000001000017bf movq %rcx, %rdi
00000001000017c2 callq 0x10000183a ## symbol stub for: _objc_storeStrong
00000001000017c7 movq -0x20(%rbp), %rdi
00000001000017cb callq 0x100001804 ## symbol stub for: _objc_autoreleasePoolPop
00000001000017d0 movl -0x4(%rbp), %eax
00000001000017d3 addq $0x60, %rsp
00000001000017d7 popq %rbp
00000001000017d8 retq
Mach-O文件中方便DYLD进行链接和绑定符号的段为__LINKEDIT段,使用otool -lv可以查看
//略去了前面的TEXT和DATA段
Load command 3
cmd LC_SEGMENT_64
cmdsize 72
segname __LINKEDIT
vmaddr 0x0000000100005000
vmsize 0x0000000000005000
fileoff 20480
filesize 19136
maxprot rwx
initprot r--
nsects 0
flags (none)
Load command 4
cmd LC_DYLD_INFO_ONLY
cmdsize 48
rebase_off 20480
rebase_size 232
bind_off 20712
bind_size 528
weak_bind_off 0
weak_bind_size 0
lazy_bind_off 21240
lazy_bind_size 472
export_off 21712
export_size 224
Load command 5
cmd LC_SYMTAB
cmdsize 24
symoff 21968
nsyms 205
stroff 25416
strsize 4400
Load command 6
cmd LC_DYSYMTAB
cmdsize 80
ilocalsym 0
nlocalsym 164
iextdefsym 164
nextdefsym 9
iundefsym 173
nundefsym 32
tocoff 0
ntoc 0
modtaboff 0
nmodtab 0
extrefsymoff 0
nextrefsyms 0
indirectsymoff 25248
nindirectsyms 42
extreloff 0
nextrel 0
locreloff 0
nlocrel 0
Load command 7
cmd LC_LOAD_DYLINKER
cmdsize 32
name /usr/lib/dyld (offset 12)
Load command 8
cmd LC_UUID
cmdsize 24
uuid 35B44905-3939-3540-92C8-9B1204DA2B6A
Load command 9
cmd LC_VERSION_MIN_IPHONEOS
cmdsize 16
version 10.3
sdk 10.3
Load command 10
cmd LC_SOURCE_VERSION
cmdsize 16
version 0.0
Load command 11
cmd LC_MAIN
cmdsize 24
entryoff 5760
stacksize 0
Load command 12
cmd LC_LOAD_DYLIB
cmdsize 88
name /System/Library/Frameworks/Foundation.framework/Foundation (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 1349.55.0
compatibility version 300.0.0
Load command 13
cmd LC_LOAD_DYLIB
cmdsize 56
name /usr/lib/libobjc.A.dylib (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 228.0.0
compatibility version 1.0.0
Load command 14
cmd LC_LOAD_DYLIB
cmdsize 48
name /usr/lib/libc++.1.dylib (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 307.5.0
compatibility version 1.0.0
Load command 15
cmd LC_LOAD_DYLIB
cmdsize 56
name /usr/lib/libSystem.dylib (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 1238.50.2
compatibility version 1.0.0
Load command 16
cmd LC_LOAD_DYLIB
cmdsize 96
name /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 1349.56.0
compatibility version 150.0.0
Load command 17
cmd LC_LOAD_DYLIB
cmdsize 80
name /System/Library/Frameworks/UIKit.framework/UIKit (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 3600.7.47
compatibility version 1.0.0
Load command 18
cmd LC_LOAD_DYLIB
cmdsize 56
name /usr/lib/libc++abi.dylib (offset 24)
time stamp 2 Thu Jan 1 08:00:02 1970
current version 307.2.0
compatibility version 1.0.0
Load command 19
cmd LC_RPATH
cmdsize 40
path @executable_path/Frameworks (offset 12)
Load command 20
cmd LC_FUNCTION_STARTS
cmdsize 16
dataoff 21936
datasize 32
Load command 21
cmd LC_DATA_IN_CODE
cmdsize 16
dataoff 21968
datasize 0
Load command 22
cmd LC_CODE_SIGNATURE
cmdsize 16
dataoff 29824
datasize 9792
关于Mach-O文件被dyld加载进内存涉及的数据结构,可以参考mach-o/loader.h中mach_header , segment_command的注释
对整个dyld加载及linkmap中各段涵义的解释会在篇二中进行