Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: file offset of __DATA, __bss and __common
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file offset of __DATA, __bss and __common



Yes, they do answer your question. Did you follow both pieces of advise? You would have seen the S_ZEROFILL section attribute with otool -lv, which you then could have looked up in the Mach-O file format reference. 

Or, after reading the chapter on Segments, you'd see:

Segments that require more memory at runtime than they do at build time can specify a larger in-memory size than they actually have on disk. For example, the__PAGEZERO segment generated by the linker for PowerPC executable files has a virtual memory size of one page but an on-disk size of 0. Because __PAGEZEROcontains no data, there is no need for it to occupy any space in the executable file.

Note: Sections that are to be filled with zeros must always be placed at the end of the segment. Otherwise, the standard tools will not be able to successfully manipulate the Mach-O file.



Please try at least following the helpful information that people post.


Shantonu Sen

Sent from my Mac Pro

On Nov 5, 2009, at 8:25 AM, Joel Reymont wrote:

While I much appreciate the pointers so far, they don't answer my question.

Empirically, it looks like __DATA, __data = __bss + __common.

Thanks, Joel

P.S. Here's a pointer of my own (wrote this a while ago):

http://tinyco.de/2009/01/26/creating-mac-binaries-on-any-platform.html

On Nov 5, 2009, at 4:21 PM, Shantonu Sen wrote:

<http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html>

Shantonu Sen
email@hidden

Sent from my Mac Pro

On Nov 5, 2009, at 7:57 AM, Rustam Muginov wrote:

Had you tried "otool -lV"?

---
firefox for android!
http://wagerlabs.com


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >file offset of __DATA, __bss and __common (From: Joel Reymont <email@hidden>)
 >Re: file offset of __DATA, __bss and __common (From: Rustam Muginov <email@hidden>)
 >Re: file offset of __DATA, __bss and __common (From: Shantonu Sen <email@hidden>)
 >Re: file offset of __DATA, __bss and __common (From: Joel Reymont <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.