site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Joel, Is this layout preventing you from doing something? -Andrew _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I neglected to reply to the list. Here is my complete reply for context: The linker always places code on a power-of-2 boundary towards the end of the page. Is there a reason for this? The Mach-O headers are indeed at the beginning of the file, but when they are mapped into a program's address space, those headers are placed at the start of the __TEXT segment, and the actual text follows those headers. When the text is smaller than the available remaining space in the first page, it is placed at the end of the page as you have noticed. When the text is larger than the remaining space, it will begin at the end of the headers and continue on into the next page. I can't say for certain why it is implemented this way, but I can speculate that it is so that the text is adjacent to the __DATA segment on the following page. Can the code be placed at the beginning of the page instead? The headers are always placed at the beginning of the __TEXT segment, so the actual code will never be at the first byte of that segment, regardless of whether the text is placed at the end of the headers or the end of the page. This email sent to site_archiver@lists.apple.com