Andreas Klebinger pushed to branch wip/andreask/linker_fix at Glasgow Haskell Compiler / GHC Commits: 61f0b4c5 by Andreas Klebinger at 2026-02-04T12:06:09+01:00 check for mac sections - - - - - 1 changed file: - rts/linker/LoadArchive.c Changes: ===================================== rts/linker/LoadArchive.c ===================================== @@ -510,6 +510,17 @@ HsInt loadArchive_ (pathchar *path) DEBUG_LOG("Found member file `%s'\n", fileName); bool is_symbol_table = strcmp("", fileName) == 0; +#if defined(OBJFORMAT_MACHO) + if (!is_symbol_table) { + /* Darwin ranlib symbol tables are named __.SYMDEF* */ + if (strncmp(fileName, "__.SYMDEF", sizeof("__.SYMDEF")) == 0 || + strncmp(fileName, "__.SYMDEF SORTED", sizeof("__.SYMDEF SORTED")) == 0 || + strncmp(fileName, "__.SYMDEF_64", sizeof("__.SYMDEF_64")) == 0 || + strncmp(fileName, "__.SYMDEF_64 SORTED", sizeof("__.SYMDEF_64 SORTED")) == 0) { + is_symbol_table = true; + } + } +#endif ///////////////////////////////////////////////// // We found the member file. Load it into memory. @@ -596,6 +607,7 @@ HsInt loadArchive_ (pathchar *path) #endif if (isThin) { if (!readThinArchiveMember(memberSize, path, fileName, image)) { + errorBelch("Failed to read thin member %" PATH_FMT"\n", path); goto fail; } } @@ -630,6 +642,7 @@ HsInt loadArchive_ (pathchar *path) IF_DEBUG(linker, ocDebugBelch(oc, "Faild to verify ... skipping.")); errorBelch("Faild to verify ... skipping."); freeObjectCode( oc ); + //TODO: Unmap or free image continue; } @@ -752,4 +765,3 @@ bool isArchive (pathchar *path) } return strncmp(ARCHIVE_HEADER, buffer, sizeof(ARCHIVE_HEADER)-1) == 0; } - View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/61f0b4c59de631590642b444b9e01d0a... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/61f0b4c59de631590642b444b9e01d0a... You're receiving this email because of your account on gitlab.haskell.org.