[llvm-bugs] [Bug 39557] New: AsmParser cannot recognize function types without definitions

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 5 00:01:13 PST 2018


            Bug ID: 39557
           Summary: AsmParser cannot recognize function types without
           Product: libraries
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: WebAssembly
          Assignee: unassignedbugs at nondot.org
          Reporter: aheejin at gmail.com
                CC: llvm-bugs at lists.llvm.org

Created attachment 21082
  --> https://bugs.llvm.org/attachment.cgi?id=21082&action=edit
Test case .ll file

When there is a function call to a function that does not have a definition, if
we generate .s file using `llc` and generate .o file from it using `llvm-mc`,
the function symbol is recognized as not a function but a data.

Commands that reproduce the bug:
llc -filetype=asm -asm-verbose=false test.ll -o test.s
llvm-mc -triple=wasm32-unknown-unknown -filetype=obj test.s -o test_from_s.o
obj2yaml test_from_s.o > test_from_s.yaml

llc -filetype=obj test.ll -o test.o
obj2yaml test.o > test.yaml

test.yaml and test_from_s.yaml are supposed to be the same, but they are not.
In test_from_s.yaml, foo, which is defined, is listed as a function symbol, but
bar, which is not defined, is listed as data.
      - Index:           0
        Kind:            FUNCTION
        Name:            foo
        Flags:           [ BINDING_LOCAL ]
        Function:        0
      - Index:           1
        Kind:            DATA
        Name:            bar
        Flags:           [ UNDEFINED ]

And consequentially, it has no function import entry in the 'Import' section,
and no type signature entry in 'Type' section as well.

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/20181105/5fee170c/attachment.html>

More information about the llvm-bugs mailing list