diff --git a/lld/MachO/UnwindInfoSection.cpp b/lld/MachO/UnwindInfoSection.cpp --- a/lld/MachO/UnwindInfoSection.cpp +++ b/lld/MachO/UnwindInfoSection.cpp @@ -246,7 +246,6 @@ uint64_t referentVA = UINT64_MAX; // Tombstone value if (auto *referentSym = r.referent.dyn_cast()) { if (!isa(referentSym)) { - assert(referentSym->isInGot()); if (auto *defined = dyn_cast(referentSym)) checkTextSegment(defined->isec); // At this point in the link, we may not yet know the final address of diff --git a/lld/test/MachO/bug_50812.s b/lld/test/MachO/bug_50812.s --- a/lld/test/MachO/bug_50812.s +++ b/lld/test/MachO/bug_50812.s @@ -24,7 +24,7 @@ filesize: 120 maxprot: 7 initprot: 7 - nsects: 2 + nsects: 3 flags: 0 Sections: - sectname: __text @@ -86,6 +86,29 @@ type: 0 scattered: false value: 0 + - sectname: __compact_unwind + segname: __LD + addr: 0x0000000000000058 + size: 32 + offset: 0x00000218 + align: 3 + reloff: 0x00000258 + nreloc: 1 + flags: 0x02000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + content: '0000000000000000120000000000000100000000000000000000000000000000' + relocations: + - address: 0x00000000 + symbolnum: 10 + pcrel: false + length: 3 + extern: true + type: 0 + scattered: false + value: 0 + - cmd: LC_SYMTAB cmdsize: 24 symoff: 608 @@ -104,6 +127,44 @@ n_sect: 2 n_desc: 0 n_value: 48 + + ## syms NOT in GOT + - n_strx: 26 + n_type: 0x64 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 39 + n_type: 0x64 + n_sect: 0 + n_desc: 0 + n_value: 0 + - n_strx: 47 + n_type: 0x66 + n_sect: 3 + n_desc: 1 + n_value: 1625174059 + - n_strx: 1 + n_type: 0x2E + n_sect: 1 + n_desc: 0 + n_value: 0 + - n_strx: 66 + n_type: 0x24 + n_sect: 1 + n_desc: 0 + n_value: 0 + - n_strx: 1 + n_type: 0x24 + n_sect: 0 + n_desc: 0 + n_value: 18 + - n_strx: 1 + n_type: 0x4E + n_sect: 1 + n_desc: 0 + n_value: 18 + - n_strx: 1 n_type: 0x4E n_sect: 1