3 ms·
If you are familiar with object file formats in general, you may know that this is exactly how MachO works: it is based on atoms. If you want to map ELF to the
by Joky 10y ago
If you are familiar with object file formats in general, you may know that this is exactly how MachO works: it is based on atoms.
If you want to map ELF to the atom model, you need somehow to build with -ffunction-section so that the compiler emits a single function per section (and similarly with -fdata-section) or model it by mapping one section of the object to an atom.
- haberman 10y agoHmm, in my experience with Mach-O, I have never come across atoms. For example, in this file format reference, atoms are not mentioned -- only the more traditional segment/section hierarchy: https://github.com/aidansteele/osx-abi-macho-file-format-reference https://github.com/aidansteele/osx-abi-macho-file-format-ref... What am I missing? I do note that on OS X, -ffunction-sections appears to do nothing.
- Joky 10y agoSorry, I was wrong to characterize the atom being a core part of the MachO object format while it is only a core part of how ld64 works. The compiler is following some convention though that ld64 takes advantages of. Other than ld64 source code (available on opensource.apple.com) I can only point to some design document in the source repo: https://opensource.apple.com/source/ld64/ld64-253.6/doc/design/linker.html https://opensource.apple.com/source/ld64/ld64-253.6/doc/desi...