ELF vs Mach-O

  • ELF header (readelf -h)
    • magic
    • version
    • CPU, OS, ABI
    • type
    • phdr offset&size
    • shdr offset&size
    • entry point
  • Program header (readelf -l)
    • PT_PHDR
    • PT_INTERP
    • PT_LOAD
    • PT_LOAD
    • ...
    • PT_DYNAMIC (readelf -d)
      • DT_NEEDED
      • DT_INIT, DT_FINI
      • DT_SYMTAB
      • DT_RELA
      • ...
  • PROGRAM
  • Section header (readelf -S)
    • .interp, .dynsym, .text, ...
    • .symtab
    • .debug_* (DWARF)
  • Mach-O header (otool -h)
    • magic
    • CPU
    • type
    • number&size of commands
  • load commands (otool -l)
    • LC_UNIXTHREAD
    • LC_SEGMENT (__TEXT)
    • LC_SEGMENT (__DATA)
      • __mod_init_func
    • LC_SEGMENT (__LINKEDIT)
    • LC_SEGMENT (__DWARF) (in .dSYM)
      • __debug_*
    • LC_LOAD_DYLINKER
    • LC_LOAD_DYLIB
    • LC_DYLD_INFO_ONLY
      • rebase
      • bind
      • weak_bind
      • lazy_bind
      • export
    • LC_DYSYMTAB
    • LC_SYMTAB
  • PROGRAM