[llvm-bugs] [Bug 32664] New: [ELF] - LLD segfaults when assigns absolute value of symbol

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 14 08:42:16 PDT 2017


            Bug ID: 32664
           Summary: [ELF] - LLD segfaults when assigns absolute value of
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: unassignedbugs at nondot.org
          Reporter: grimar at accesssoftek.com
                CC: llvm-bugs at lists.llvm.org

Reduced testcase reproducing crash is:

# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: echo "SECTIONS { aaa = ABSOLUTE(bbb); };" > %t.script
# RUN: ld.lld -o %t --script %t.script %t.o

.section .text
.globl bbb

LLD crashes here:
uint64_t ExprValue::getValue() const {
  if (Sec)
    return Sec->getOffset(Val) + Sec->getOutputSection()->Addr; // <-HERE
  return Val;

Sec->getOutputSection() is nullptr;

Testcase reduced from linux kernel.

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/20170414/c8c45bdf/attachment.html>

More information about the llvm-bugs mailing list