Linker changes in Xcode 16 / macOS 15?

I have existing code in production that links against the mach-o library, and uses the following code:

NSData *data = [NSData dataWithBytes: getsectiondata(&_mh_execute_header, "__TEXT", "__somePlist_plist", &len) length:len];

In order for this to compile with Sequoia Beta 4 and Xcode 16 beta 4, I have to replace _mh_execute_header with _mh_dylib_header.

If I don't, the compiler raises the following error: ld: Undefined symbols: __mh_execute_header, referenced from: -[MyClass init] in MyClass.o clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any idea why the linking behavior might have changed? Should I file a bug?

(I realize this is a C issue, not Objective-C - but didn't find a tag for that)

Thanks!

Answered by DTS Engineer in 797307022

Oh, this seems to be a FAQ right now. See my response on this thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Oh, this seems to be a FAQ right now. See my response on this thread.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

If I have additional questions should I post on the other thread? The interesting thing is that if I use _mh_dylib_header, I get a build error in Xcode 15/macOS 14.

Linker changes in Xcode 16 / macOS 15?
 
 
Q