Questions tagged [mach-o]

Executable file format utilized by Darwin.

Mach-O is the file format used for executables, shared libraries and object files on OS X and iOS. It supports both single-architecture and multiple-architecture ("fat") binaries.

371 questions
17
votes
2 answers

Why do static inline data members not end up in a .bss section on Macos?

Trying out snmalloc on Macos I wondered why all the created binaries are >256MiB. It turns out that zero-initialized static inline data members are lowered in a weird way on Mac OS X, on both ARM64 and x86_64. Even this simple test produces huge…
HHK
  • 4,852
  • 1
  • 23
  • 40
16
votes
5 answers

Linux Mach-O Disassembler

Are there any Linux programs that can disassemble an OSX universal x86/x86_64 fat Mach-O binary like objdump? GNU binutils' objdump supports ELF and Windows PE files but not Mach-O.
Jeff
  • 358
  • 1
  • 3
  • 10
14
votes
2 answers

What is required for a Mach-O executable to load?

I am attempting to hand-write a Mach-O executable. There are three load commands: LC_SEGMENT_64 loading __PAGEZERO LC_SEGMENT_64 loading __TEXT, with a single __text section LC_UNIXTHREAD with an appropriately-set rip Every command matches the…
wirelyre
  • 145
  • 1
  • 7
12
votes
8 answers

Apple Mach-O Linker (Id) error

Got this error for the first time, I have looked around and cannot find a solution to help me, I have cleaned my build and also checked to make sure I am compiling for the latest firmware. This happened after I tired implementing a reachability…
C.Johns
  • 10,185
  • 20
  • 102
  • 156
12
votes
1 answer

Apple Mach-O Linker (id) Error - undefined symbols for architecture i386

I know this type of error has been raised many times before, but I have not found solution of my error. I am using xcode 4.0. I downloaded ASIHTTPRequest zip and copied classes folder along with two files of 'Reachability". After compilation, it is…
NightFury
  • 13,436
  • 6
  • 71
  • 120
12
votes
1 answer

How to insert a LC_LOAD_DYLIB command into a Mach-O binary or join a static library to an existing binary (IOS)

This is the first time I am asking on stackoverflow and I am desperate. My task is to load a dylib or join a static lib to an already existing executable for an IOS device. I will be using the static void __attribute__((constructor))…
Tzahi Fadida
  • 198
  • 1
  • 7
11
votes
1 answer

Crash reading bytes from getsectbyname

UPDATE: Answer below in question, thanks to Greg Parker's pointer… I uploaded a sample project here, but I'll describe it as well: https://github.com/tewha/getsectbyname-crash I get a crash from my my (64-bit only) executable, but not when run from…
Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
11
votes
3 answers

Apple Mach-O-Linker Error CocoaPods

I've been trying to get my app up and running. From what I could tell the app was missing Cocoapods as a dependency. So. I installed and added Cocoapods. But I'm still getting the same error for whatever reason. I'm an inexperienced developer trying…
KFDoom
  • 772
  • 1
  • 6
  • 19
11
votes
1 answer

How do I embed data into a Mac OS X mach-o binary file's TEXT Section?

I have a Mac OS X command-line tool that would benefit from having some data embedded in the binary file itself. I know mach-o files support multiple segments, some of which can be used for storing arbitrary data. But I can't find a command-line…
schwa
  • 11,962
  • 14
  • 43
  • 54
10
votes
1 answer

What's the meaning of dylib files?

My C++ compiler creates "dylib" files which contain dynamic libraries. Whats the difference between .dylib and .so files? And what is the difference between files in Mach-O format and files in an ELF format? I have to build files for later use…
Marc Schlösser
  • 751
  • 2
  • 8
  • 17
10
votes
2 answers

Mach-O's two-level namespace symbol resolution in ELF/linux

Anyone know of an equivalent to Mach-O's two-level namespace symbol resolution in ELF/linux? I want code that links to lib+sym, not sym. I'm trying to do what could best be described as precompilation of what normally would be a JIT compilation. I'd…
Danny Dulai
  • 1,657
  • 12
  • 14
10
votes
2 answers

How to insert a LC_LOAD_DYLIB command into a Mach-O binary (OSX)

I'm looking to patch a piece of abandonware with some code. The software is carbon based, so I can not use an InputManager (at least, I do not think I can). My idea was to add a dylib reference to the mach-o header, and launch a new thread when the…
Moe
10
votes
2 answers

Xcode Apple Mach-O Linker Error 1

after renaming my project whenever I try to build the app I get an Apple Mach-O Linker Error below is the output from Xcode itself Ld…
Josh
  • 111
  • 2
  • 11
10
votes
2 answers

Editing assembly on Mac OS X

I'm currently disassembling a Mach-O executable(the executable runs on Mac OS X, to be specific) in IDA Pro on windows. I have one instruction which I want to change, but it doesn't seem that IDA Pro allows you to do this. So, I tried using otool on…
Mike
  • 23,892
  • 18
  • 70
  • 90
9
votes
1 answer

tools on Linux to read/dump MachO files?

Are there tools available on Linux for read/dump/analyze MachO files? Somethings like readelf or objdump, just for MachO format? This must run on Linux.
zaharpopov
  • 16,882
  • 23
  • 75
  • 93
1
2
3
24 25