[llvm-bugs] [Bug 27228] New: lld assertion failure linking FreeBSD base system after r265293

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 5 14:32:09 PDT 2016


            Bug ID: 27228
           Summary: lld assertion failure linking FreeBSD base system
                    after r265293
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: emaste at freebsd.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This assertion fails:

(lldb) frame sel 4
frame #4: 0x00000000005b1a74 ld`SymbolBody(this=0x00000008068ea140,
K=SharedKind, Name=StringRef at 0x00007fffffffc798, Binding='\0',
StOther='\0', Type='\0') + 276 at Symbols.h:134
   131        : SymbolKind(K), MustBeInDynSym(false),
   132          Type(Type), Binding(Binding), StOther(StOther),
   133          Name({Name.data(), Name.size()}) {
-> 134      assert(!isLocal());
   135      IsUsedInRegularObj =
   136          K != SharedKind && K != LazyKind && K != DefinedBitcodeKind;
   137    }

The failing symbol is:

(lldb) p Name
(lld::elf::SymbolBody::Str) $1 = (S = "__start_set_kvm_arch", Len = 20)

This is a synthetic symbol generated for section start and stop (for use by
e.g. linker sets), for the "set_kvm_arch" section in a .so that we're linking

It looks like the issue is getSymbolBinding returns only STB_LOCAL for
synthetic symbols:

template <class ELFT>
uint8_t SymbolTableSection<ELFT>::getSymbolBinding(SymbolBody *Body) {
  uint8_t Visibility = Body->getVisibility();
  if (Visibility != STV_DEFAULT && Visibility != STV_PROTECTED)
    return STB_LOCAL;
  if (isa<DefinedSynthetic<ELFT>>(Body))
    return STB_LOCAL;
  return Body->Binding;

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160405/145d7f1a/attachment.html>

More information about the llvm-bugs mailing list