[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


https://bugs.llvm.org/show_bug.cgi?id=32664

            Bug ID: 32664
           Summary: [ELF] - LLD segfaults when assigns absolute value of
                    symbol
           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:

# REQUIRES: x86
# 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
bbb:
 nop


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