[llvm-bugs] [Bug 30988] New: Wrong diagnostic for undefined ELF temporary label

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Nov 11 12:43:50 PST 2016


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

            Bug ID: 30988
           Summary: Wrong diagnostic for undefined ELF temporary label
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: MC
          Assignee: unassignedbugs at nondot.org
          Reporter: davide at freebsd.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

[davide at cupiditate bin]$ cat patatino.s
.text
        jmp .Lblah

[davide at cupiditate bin]$ ./llvm-mc patatino.s -filetype=obj -o patatino
<unknown>:0: error: Undefined temporary symbol

The reason why this happens is that we don't have a SM location, as this error
isn't diagnosed until we reach the ELFObjectWriter.
```
    if (Symbol.isTemporary() && Symbol.isUndefined()) {
      Ctx.reportError(SMLoc(), "Undefined temporary symbol");
      continue;
```

Couple of notes:
-> This used to be a fatal error, then it was converted to `reportError`.
->  GNU as doesn't seem to care about undefined labels, and assemble that
snippet just fine. The resulting assembly is:

$ objdump -t ./foo |grep blah
0000000000000000         *UND*  0000000000000000 .Lblah

$ objdump -d ./foo
0000000000000000 <.text>:
   0:   e9 00 00 00 00          jmpq   0x5

Rafael pointed out this is an area that could use some love, and pointed out
https://llvm.org/bugs/show_bug.cgi?id=23933

-- 
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/20161111/ced9be83/attachment.html>


More information about the llvm-bugs mailing list