mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-21 05:50:55 +08:00
ASan's instrumented globals ride ELF section groups; archives built from shared runtime objects carry groups with REPEATED signatures, so a process linking two runtime-localized sanitized archives kept one archive's group and discarded the other's — whose now-local references then dangled at the embedder's link. Resolving the groups into the combined relocatable member (ld -r --force-group-allocation) keeps every archive's copies; the localization step then demotes them per archive exactly like unsanitized state. Plain builds carry no section groups, so the flag is inert there. With the groups resolved, ELF surfaces the same deliberate exception Mach-O already documented: the image-wide registration guard COMMON stays shared so the final image registers its ASan globals exactly once — M1/M7 now pin that spelling on both platforms. The explicit ASan pairing (M8) additionally points Linux LSan away from contractually thread-lifetime instance state, exactly as the sanitized suite lanes do.