For what is XNU kernel stored in mach-o binary format?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

For what is XNU kernel stored in mach-o binary format?

Post by Roman »

Why not to just store it in a flat binary, load and jump to it? What benefits would I get with a binary format?
Attachments
Снимок экрана 2014-06-18 в 16.43.22.png
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: For what is XNU kernel stored in mach-o binary format?

Post by Combuster »

The reason you normally don't want a flat binary is because it can't provide you with extra load information, such as where certain parts should be loaded. Trying to embed symbols or relocation information into a flat binary so you can print informative stackdumps at runtime becomes seriously troublesome to do.

You might get away with it, but it tends to bite later.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply