=========================================================================
a.c
----------------------------------
void main (int argc, char **argv) {
printf ("Salve, Munde!\n");
printf ("Vale!\n");
exit();
}
=========================================================================
dyldinfo -lazy_bind a
----------------------------------
lazy binding information (from lazy_bind part of dyld info):
segment section address index dylib symbol
__DATA __la_symbol_ptr 0x100001010 0x0000 libSystem _exit
__DATA __la_symbol_ptr 0x100001018 0x000C libSystem _printf
=========================================================================
otool -p _main -tV
----------------------------------
a:
(__TEXT,__text) section
_main:
0000000100000f10 pushq %rbp
0000000100000f11 movq %rsp, %rbp
0000000100000f14 subq $0x20, %rsp
0000000100000f18 leaq 0x61(%rip), %rax ## literal pool for: "Salve, Munde!
"
0000000100000f1f movl %edi, -0x4(%rbp)
0000000100000f22 movq %rsi, -0x10(%rbp)
0000000100000f26 movq %rax, %rdi
0000000100000f29 movb $0x0, %al
0000000100000f2b callq 0x100000f54 ## symbol stub for: _printf <------
0000000100000f30 leaq 0x58(%rip), %rdi ## literal pool for: "Vale!
"
0000000100000f37 movl %eax, -0x14(%rbp)
0000000100000f3a movb $0x0, %al
0000000100000f3c callq 0x100000f54 ## symbol stub for: _printf <------
0000000100000f41 movl $0x0, %edi
0000000100000f46 movl %eax, -0x18(%rbp)
0000000100000f49 callq 0x100000f4e ## symbol stub for: _exit <------
=========================================================================
otool -l -V a
----------------------------------
a:
Load command
cmd LC_SEGMENT_64
cmdsize
segname __PAGEZERO
vmaddr 0x0000000000000000
vmsize 0x0000000100000000
fileoff
filesize
maxprot ---
initprot ---
nsects
flags (none)
Load command
cmd LC_SEGMENT_64
cmdsize
segname __TEXT
vmaddr 0x0000000100000000
vmsize 0x0000000000001000
fileoff
filesize
maxprot rwx
initprot r-x
nsects
flags (none)
Section
sectname __text
segname __TEXT
addr 0x0000000100000f10
size 0x000000000000003e
offset
align ^ ()
reloff
nreloc
type S_REGULAR
attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
reserved1
reserved2
Section
sectname __stubs
segname __TEXT
addr 0x0000000100000f4e <------
size 0x000000000000000c
offset
align ^ ()
reloff
nreloc
type S_SYMBOL_STUBS
attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
reserved1 (index into indirect symbol table)
reserved2 (size of stubs)
Section
sectname __stub_helper
segname __TEXT
addr 0x0000000100000f5c
size 0x0000000000000024
offset
align ^ ()
reloff
nreloc
type S_REGULAR
attributes PURE_INSTRUCTIONS SOME_INSTRUCTIONS
reserved1
reserved2
Section
sectname __cstring
segname __TEXT
addr 0x0000000100000f80
size 0x0000000000000016
offset
align ^ ()
reloff
nreloc
type S_CSTRING_LITERALS
attributes (none)
reserved1
reserved2
Section
sectname __unwind_info
segname __TEXT
addr 0x0000000100000f96
size 0x0000000000000048
offset
align ^ ()
reloff
nreloc
type S_REGULAR
attributes (none)
reserved1
reserved2
Section
sectname __eh_frame
segname __TEXT
addr 0x0000000100000fe0
size 0x0000000000000018
offset
align ^ ()
reloff
nreloc
type S_REGULAR
attributes (none)
reserved1
reserved2
Load command
cmd LC_SEGMENT_64
cmdsize
segname __DATA
vmaddr 0x0000000100001000
vmsize 0x0000000000001000
fileoff
filesize
maxprot rwx
initprot rw-
nsects
flags (none)
Section
sectname __nl_symbol_ptr
segname __DATA
addr 0x0000000100001000
size 0x0000000000000010
offset
align ^ ()
reloff
nreloc
type S_NON_LAZY_SYMBOL_POINTERS
attributes (none)
reserved1 (index into indirect symbol table)
reserved2
Section
sectname __la_symbol_ptr
segname __DATA
addr 0x0000000100001010
size 0x0000000000000010
offset
align ^ ()
reloff
nreloc
type S_LAZY_SYMBOL_POINTERS
attributes (none)
reserved1 (index into indirect symbol table)
reserved2
Load command
cmd LC_SEGMENT_64
cmdsize
segname __LINKEDIT
vmaddr 0x0000000100002000
vmsize 0x0000000000001000
fileoff
filesize
maxprot rwx
initprot r--
nsects
flags (none)
Load command
cmd LC_DYLD_INFO_ONLY
cmdsize
rebase_off
rebase_size
bind_off
bind_size
weak_bind_off
weak_bind_size
lazy_bind_off
lazy_bind_size
export_off
export_size
Load command
cmd LC_SYMTAB
cmdsize
symoff
nsyms
stroff
strsize
Load command
cmd LC_DYSYMTAB
cmdsize
ilocalsym
nlocalsym
iextdefsym
nextdefsym
iundefsym
nundefsym
tocoff
ntoc
modtaboff
nmodtab
extrefsymoff
nextrefsyms
indirectsymoff
nindirectsyms
extreloff
nextrel
locreloff
nlocrel
Load command
cmd LC_LOAD_DYLINKER
cmdsize
name /usr/lib/dyld (offset )
Load command
cmd LC_UUID
cmdsize
uuid AAF0A21D-08BD-30FB-BB08-2A3352D9D4B9
Load command
cmd LC_VERSION_MIN_MACOSX
cmdsize
version .
sdk .
Load command
cmd LC_SOURCE_VERSION
cmdsize
version .
Load command
cmd LC_MAIN
cmdsize
entryoff
stacksize
Load command
cmd LC_LOAD_DYLIB
cmdsize
name /usr/lib/libSystem.B.dylib (offset )
time stamp Thu Jan ::
current version ..
compatibility version ..
Load command
cmd LC_FUNCTION_STARTS
cmdsize
dataoff
datasize
Load command
cmd LC_DATA_IN_CODE
cmdsize
dataoff
datasize
Load command
cmd LC_DYLIB_CODE_SIGN_DRS
cmdsize
dataoff
datasize
=========================================================================
nm a | grep "U "
----------------------------------
U _exit
U _printf
U dyld_stub_binder
=========================================================================
nm a | wc -l
---------------------------------- =========================================================================
x/2i 0x100000f4e
----------------------------------
0x100000f4e <dyld_stub_exit>: jmpq *0xbc(%rip) # 0x100001010 <------
0x100000f54 <dyld_stub_printf>: jmpq *0xbe(%rip) # 0x100001018 <------
=========================================================================
x/g 0x100001010
----------------------------------
0x100001010: 0x0000000100000f6c <------
=========================================================================
x/g 0x100001018
----------------------------------
0x100001018: 0x0000000100000f76 <------
=========================================================================
x/2i 0x0000000100000f6c <------
----------------------------------
0x100000f6c: pushq $0x0
0x100000f71: jmpq 0x100000f5c <------
=========================================================================
x/2i 0x0000000100000f76 <------
----------------------------------
0x100000f76: pushq $0xc
0x100000f7b: jmpq 0x100000f5c <------
=========================================================================
x/3i 0x100000f5c
----------------------------------
0x100000f5c: lea 0xa5(%rip),%r11 # 0x100001008
0x100000f63: push %r11
0x100000f65: jmpq *0x95(%rip) # 0x100001000 <------
=========================================================================
x/2g 0x100001000
----------------------------------
0x100001000: 0x0000000000000000 0x0000000000000000
=========================================================================
b main
----------------------------------
r
----------------------------------
x/2g 0x100001000
----------------------------------
0x100001000: 0x00007fff8a2bc210 <------ 0x0000000000000000
=========================================================================
disass 0x00007fff8a2bc210
----------------------------------
Dump of assembler code for function dyld_stub_binder:
0x00007fff8a2bc210 <dyld_stub_binder+>: push %rbp
0x00007fff8a2bc211 <dyld_stub_binder+>: mov %rsp,%rbp
0x00007fff8a2bc214 <dyld_stub_binder+>: sub $0x140,%rsp
0x00007fff8a2bc21b <dyld_stub_binder+>: mov %rdi,(%rsp)
0x00007fff8a2bc21f <dyld_stub_binder+>: mov %rsi,0x8(%rsp)
0x00007fff8a2bc224 <dyld_stub_binder+>: mov %rdx,0x10(%rsp)
0x00007fff8a2bc229 <dyld_stub_binder+>: mov %rcx,0x18(%rsp)
0x00007fff8a2bc22e <dyld_stub_binder+>: mov %r8,0x20(%rsp)
0x00007fff8a2bc233 <dyld_stub_binder+>: mov %r9,0x28(%rsp)
0x00007fff8a2bc238 <dyld_stub_binder+>: mov %rax,0x30(%rsp)
End of assembler dump.
=========================================================================
x/i dyld_stub_exit
----------------------------------
0x100000f4e <dyld_stub_exit>: jmpq *0xbc(%rip) # 0x100001010
=========================================================================
x/i dyld_stub_printf
----------------------------------
0x100000f54 <dyld_stub_printf>: jmpq *0xbe(%rip) # 0x100001018
=========================================================================
x/g 0x100001018
----------------------------------
0x100001018: 0x0000000100000f76
=========================================================================
x/2i 0x0000000100000f76
----------------------------------
0x100000f76: pushq $0xc
0x100000f7b: jmpq 0x100000f5c
=========================================================================
b *0x0000000100000f2b
b *0x0000000100000f3c
=========================================================================
x/g 0x100001018
----------------------------------
0x100001018: 0x0000000100000f76
=========================================================================
x/2i 0x0000000100000f76
----------------------------------
0x100000f76: pushq $0xc
0x100000f7b: jmpq 0x100000f5c
=========================================================================
x/g 0x100001018
----------------------------------
0x100001018: 0x00007fff883ba8a8
=========================================================================
x/2i 0x00007fff883ba8a8
----------------------------------
0x7fff883ba8a8 <printf>: push %rbp
0x7fff883ba8a9 <printf+>: mov %rsp,%rbp
=========================================================================

dyld binding test的更多相关文章

  1. CURL命令报错:dyld: lazy symbol binding failed: Symbol not found: _SSL_load_error_strings解决办法

    Mac OS X 10.11.6, curl 命令报错,错误如下: dyld: lazy symbol binding failed: Symbol not found: _SSL_load_erro ...

  2. dyld: lazy symbol binding failed: Symbol not found: ___sincosf_stret

    This is the error I get: dyld: lazy symbol binding failed: Symbol not found: ___sincosf_stret Refere ...

  3. dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty_nonatomic

    这个错误,一般在高版本设备里面不会出现,而在低版本会出现比如你的项目或者引入的静态库的Deployment Target设置成了ios6.0而你的测试设备是ios5.0甚至更低,就会出现如上错误.因为 ...

  4. dyld

    一.介绍 在 MacOS 和 iOS 上,可执行程序的启动依赖于 xnu 内核进程运作和动态链接加载器 dyld. dyld 全称 the dynamic link editor,即动态链接器,其本质 ...

  5. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): da.huying.usermanag ...

  6. WPF binding 参考

    Introduction This is an article on WPF Binding Cheat Sheet. Some of the Binding won't work for Silve ...

  7. 十五天精通WCF——第一天 三种Binding让你KO80%的业务

    转眼wcf技术已经出现很多年了,也在.net界混的风生水起,同时.net也是一个高度封装的框架,作为在wcf食物链最顶端的我们所能做的任务已经简单的不能再简单了, 再简单的话马路上的大妈也能写wcf了 ...

  8. dyld 加载 Mach-O

    ➠更多技术干货请戳:听云博客 前言 最近看 ObjC的runtime 是怎么实现 +load 钩子函数的实现.进而引申分析了 dyld 处理 Mach-O 的这部分机制. 1.简单分析 Mach-O ...

  9. Binding笔记

    Binding基础  绑定某个对象的属性值到控制上,写法如下: public class Order : INotifyPropertyChanged//只要实现此接口 { public event ...

随机推荐

  1. uva10827-Maximum sum on a torus(矩阵最大和的变形)

    题目;uva10827-Maximum sum on a torus(矩阵最大和的变形) 题目大意:就是uva108的变形,矩阵能够连通,就是能够从后面连到前面.这里把矩阵复制三遍,然后又一次生成一个 ...

  2. Android学习----异常(2):Please ensure that adb is correctly located at &#39; ... &#39;

    打开任务管理器,在后台进程中找到 kadb,结束这个进程,重新启动eclipse.

  3. HDU4405-Aeroplane chess(可能性DP需求预期)

    Aeroplane chess Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) ...

  4. C#快递跟踪(基于快递100深度定制)

    本文主要介绍快递跟踪的相关信息.如根据快递单号预测所属快递公司,判断快递是否已被签收,以及改良官方model后可在不用申请授权的情况下实现json,html,xml及text等多种格式以及单行多行,降 ...

  5. Jquery--仿制360右下角弹出窗口

    原文:Jquery--仿制360右下角弹出窗口 先发浏览器效果图,给大家看. 要实现这样的效果,按照思路,第一步,写好CSS布局,将图片放到浏览器右下角的位置 CSS代码很灵活,我写的只是简单的一种而 ...

  6. JqueryAjax异步加载在ASP.NET

    前台代码 <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript">< ...

  7. 分享一个SQLSERVER脚本

    原文:分享一个SQLSERVER脚本 分享一个SQLSERVER脚本 很多时候我们都需要计算数据库中各个表的数据量很每行记录所占用空间 这里共享一个脚本 CREATE TABLE #tablespac ...

  8. Redis 中文入库成功,读取数据写入文件乱码问题

    近期须要用到redis ,可是在编码这个问题上,纠结了非常久.        需求 :每天一个进程将中文文件入库到redis中(不定时更新) ,另外几个进程读取redis中的信息 ,并处理数据结果.使 ...

  9. 如何判断微信内置浏览器(通过User Agent实现)

    在进行微信公众账号开发的时候,其中很大一块是微站点的开发,我们需要知道当前的浏览器是微信内置的浏览器,那么如何判断呢? 微信内置浏览器的 User Agent 如何判断微信内置浏览器,首先需要获取微信 ...

  10. 完整的thinphp+phpexcel实现excel报表的输出(有图有效果)

    准备工作:1.下载phpexcel1.7.6类包:2.解压至TP框架的ThinkPHP\Vendor目录下,改类包文件夹名为PHPExcel176,目录结构如下图:       编写代码(以一个订单汇 ...