[compiler-rt] [sanitizer-common] [Darwin] Fix overlapping dyld segment addresses (PR #166005)

Dan Blackwell via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 4 04:06:28 PST 2025


================
@@ -255,23 +256,21 @@ static bool NextSegmentLoad(MemoryMappedSegment *segment,
   layout_data->current_load_cmd_count--;
   if (((const load_command *)lc)->cmd == kLCSegment) {
     const SegmentCommand* sc = (const SegmentCommand *)lc;
-    uptr base_virt_addr, addr_mask;
+    if (strncmp(sc->segname, "__LINKEDIT", sizeof("__LINKEDIT")) == 0) {
+      // The LINKEDIT sections alias, so we ignore these sections to
----------------
DanBlackwell wrote:

Do these always alias, or just for certain modules? Perhaps a better justification is that this segment is for the linker to use internally.

https://github.com/llvm/llvm-project/pull/166005


More information about the llvm-commits mailing list