diff -urN source/mac2elf.cpp source-mod/mac2elf.cpp --- source/mac2elf.cpp 2008-09-20 13:09:20.000000000 +0200 +++ source-mod/mac2elf.cpp 2009-05-16 23:38:34.000000000 +0200 @@ -480,6 +480,12 @@ } } else { + if (sym.st_shndx == 0) + { + // This is an external + sym.st_type = STT_NOTYPE; + } + else // This is a data definition record if (NewSectionHeaders[NewSectionIndex].sh_flags & SHF_EXECINSTR) { // Code section, assume this is a function @@ -975,6 +981,17 @@ break; } } + if (relp->r_length == 2) { + NewRelocEntry.r_addend = *inlinep; + *inlinep = 0; + } + else if (relp->r_length == 3) { + NewRelocEntry.r_addend = *(int64*)inlinep; + *(int64*)inlinep = 0; + } + else { + err.submit(2044); // wrong size + } // Put relocation record into table NewSections[newsecr].Push(&NewRelocEntry, sizeof(NewRelocEntry)); } diff -urN source/main.cpp source-mod/main.cpp --- source/main.cpp 2009-01-22 21:47:54.000000000 +0100 +++ source-mod/main.cpp 2009-05-08 21:14:58.000000000 +0200 @@ -547,11 +547,11 @@ // Check sectionname options if (cmd.SegmentDot && cmd.OutputType != 0) { if (cmd.SegmentDot == CMDL_SECTIONDOT_CHANGE) { - if (FileType == FILETYPE_ELF && cmd.OutputType == FILETYPE_COFF) { + if (FileType == FILETYPE_ELF && (cmd.OutputType == FILETYPE_COFF || FileType == FILETYPE_MACHO_LE)) { // Change leading '.' to '_' in nonstandard section names cmd.SegmentDot = CMDL_SECTIONDOT_DOT2U; } - else if (FileType == FILETYPE_COFF && cmd.OutputType == FILETYPE_ELF ) { + else if ((FileType == FILETYPE_COFF || FileType == FILETYPE_MACHO_LE) && cmd.OutputType == FILETYPE_ELF ) { // Change leading '_' to '.' in nonstandard section names cmd.SegmentDot = CMDL_SECTIONDOT_U2DOT; }