I'm continuing the work done by Michel Fortin of adding support for "extern (Objective-C)" to D. I've already merged the latest changes of DMD and fixed some minor issues. The problem I now have is when linking some code that calls an Objective-C method. The object file is supposed to contain a section __message_refs, in the __OBJC segment. This section contains pointers to C strings, which contain the names of the Objective-C selectors (methods). The C strings are stored in the __cstring __TEXT section and segment. As far as I can see the these sections looks to have the correct flags and contents.
The problem is I'm getting an assertion in the linker: http://www.opensource.apple.com/source/ld64/ld64-134.9/src/ld/parsers/macho_relocatable_file.cpp Line 5024, in Objc1ClassReferences<A>::targetCString. I'm pretty sure that the value of "fit->binding" should be "ld::Fixup::bindingByContentBound" but instead it is "ld::Fixup::bindingDirectlyBound". The definition of these enums are located here: http://www.opensource.apple.com/source/ld64/ld64-134.9/src/ld/ld.hpp Line 358, in Fixup::TargetBinding. This is the result of "dumpobj" on the D object file that fails to link: http://pastebin.com/uPNZ8DpA This is the dump of a corresponding Objective-C object file: http://pastebin.com/NjbRRdZM The following is a dump of Michel's original pre compiled alpha release from 2011 that does not have this problem: http://pastebin.com/rjjT1LBU -- /Jacob Carlborg _______________________________________________ dmd-internals mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/dmd-internals
