<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"><style>body { line-height: 1.5; }body { font-size: 10.5pt; font-family: ????; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Hello Nick,</div><div><span style="background-color: rgba(0, 0, 0, 0);">    I'm Jalen, a student from SCUT, China. It's very fortunately for me to have the opportunity to contact you. </span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    Before watch your the mail list(</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">http://webcache.googleusercontent.com/search?q=cache:D_s11w9oq3IJ:unix.superglobalmegacorp.com/xnu/newsrc/osfmk/mach-o/loader.h.html+&cd=26&hl=zh-CN&ct=clnk&gl=cn</span><span style="font-size: 10.5pt; line-height: 1.5; background-color: rgba(0, 0, 0, 0);">), </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: rgba(0, 0, 0, 0);">I'm </span><span style="font-size: 10.5pt; line-height: 1.5; background-color: rgba(0, 0, 0, 0);">confused with the lack of "size" of symbol table in the Mach-o file. And I found the solution in the "</span><span style="line-height: normal; white-space: pre-wrap; font-size: 10.5pt; background-color: window;">lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileToAtoms.cpp</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">" you posted in that E-Mail, which note that"</span><span style="line-height: normal; white-space: pre-wrap; font-size: 10.5pt; background-color: window;">Mach-O symbol table does have size in it, so need to scan ahead </span><span style="font-size: 10.5pt; line-height: normal; white-space: pre-wrap; background-color: window;">to find symbol with next highest address.</span><span style="font-size: 10.5pt; line-height: 1.5; background-color: rgba(0, 0, 0, 0);">" </span></div><div><span style="background-color: rgba(0, 0, 0, 0);">    But when I parse out the symbol table in a Mach-O (.dSYM) file (I got the symbol table from the symtab_command and the following nlists) and trying to calculate the size of one global symbol as the same way, I was confused again when I compared the symbol table from the output of dwarfdump (dwarfdump -ae). The end address of the symbol in the symbol table from the dwarfdump is different from the result my program's output. Is there some problem with the symbol table I parsed out? Or is there some other way to work out it? </span></div><div><br></div><div>Some of the output from my program:</div><div><start address> <section index><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    <method></span></div><div><span style="background-color: rgba(0, 0, 0, 0);">0x0006d030</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">1</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">___arclite_objc_autoreleasePoolPop </span></div><div><span style="background-color: rgba(0, 0, 0, 0);">0x0006d048</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">1</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">_patch_lazy_pointers </span></div><div><span style="background-color: rgba(0, 0, 0, 0);">0x0006d1f0</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">     </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">1</span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">    </span><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">___arclite_objc_autoreleasePoolPush</span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;"><br></span></div><div><span style="background-color: rgba(0, 0, 0, 0); font-size: 10.5pt; line-height: 1.5;">The corresponding part of the output from dwarfdmp:</span></div><div><span style="background-color: rgba(0, 0, 0, 0);">0x0014a37b: [0x0006d030 - 0x0006d046) __arclite_objc_autoreleasePoolPop
<br>0x0014a122: [0x0006d048 - 0x0006d1ee) patch_lazy_pointers
<br>0x0014a3a0: [0x0006d1f0 - 0x0006d212) __arclite_objc_autoreleasePoolPush</span></div><div><br></div><div>So if I use the way in the "<span style="line-height: normal; white-space: pre-wrap; font-size: 10.5pt; background-color: window;">MachONormalizedFileToAtoms.cpp" to calculate the end address of the symbol (look ahead to</span><span style="line-height: normal; white-space: pre-wrap; font-size: 10.5pt; background-color: window;"> find symbol with next highest address</span><span style="background-color: window; font-size: 10.5pt; line-height: normal; white-space: pre-wrap;">), the result must be different from the output of dwarfdump. And do you know how dwarfdump calculate it?</span></div><div><span style="line-height: normal; white-space: pre-wrap; font-size: 10.5pt; background-color: window;"><br></span></div><div><span style="line-height: normal; white-space: pre-wrap;">The Mach-O file (dSYM) I tested above is in the appendix.</span></div><div><span style="line-height: normal; white-space: pre-wrap; font-size: 10.5pt; background-color: window;"><br></span></div><div><span style="line-height: normal; white-space: pre-wrap;">Thank you for reading and I'm sincerely looking forward to hear from you soon.</span></div><div><span style="line-height: normal; white-space: pre-wrap; font-size: 10.5pt; background-color: window;"> </span></div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>jalin.cwk@foxmail.com</div></div></span></div>
</body></html>