Re: mach-o: why is code placed towards the end of a page?
Re: mach-o: why is code placed towards the end of a page?
- Subject: Re: mach-o: why is code placed towards the end of a page?
- From: Terry Lambert <email@hidden>
- Date: Thu, 8 Jan 2009 17:18:45 -0800
On Jan 8, 2009, at 4:04 PM, Joel Reymont wrote:
On Jan 8, 2009, at 11:56 PM, Andrew Myrick wrote:
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.
I apologize, I meant at the beginning of a new page. I'm placing the
code right after headers, aligned on a 16-byte boundary (just in
case).
Is this layout preventing you from doing something?
No, I don't think so. I was just wondering if pushing text towards
the end of the page was a must. I see that it's not.
It's not, if you pad to page boundaries on disk to avoid writes to
data pages affecting code page contents, and avoid data acting as code
opportunistically.
FreeBSD and Linux ELF plays similar tricks.
-- Terry
_______________________________________________
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