Issue 146658
Summary [lld] crash linking OSS https://github.com/Ranchero-Software/NetNewsWire
Labels lld
Assignees
Reporter johnno1962
    Hi,

I'm seeing a crash linking this Open Source project https://github.com/Ranchero-Software/NetNewsWire during linking. The crash occurs here in `lld/MachO/SyntheticSections.cpp` building of main. `*reloc` is returned nil inside the loop. I'm working with the source at the moment, if you have any suggestions I could try or information I can gather let me know as I'd like to see if I can fix this.
```
void ObjCMethListSection::setUp() {
  for (const ConcatInputSection *isec : inputs) {
    uint32_t structSizeAndFlags = 0, structCount = 0;
 readMethodListHeader(isec->data.data(), structSizeAndFlags, structCount);
 uint32_t originalStructSize = structSizeAndFlags & structSizeMask;
    // Method name is immediately after header
    uint32_t methodNameOff = methodListHeaderSize;

    // Loop through all methods, and ensure a selref for each of them exists.
    while (methodNameOff < isec->data.size()) {
 const Reloc *reloc = isec->getRelocAt(methodNameOff);
      assert(reloc && "Relocation expected at method list name slot");

      StringRef methname = reloc->getReferentString();
      if (!ObjCSelRefsHelper::getSelRef(methname))
 ObjCSelRefsHelper::makeSelRef(methname);

      // Jump to method name offset in next struct
      methodNameOff += originalStructSize;
    }
 }
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to