[llvm-bugs] [Bug 40482] New: lld creates bogus dwarf info

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jan 26 13:30:52 PST 2019


            Bug ID: 40482
           Summary: lld creates bogus dwarf info
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: mail at milianw.de
                CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org

$ g++ --version
g++ (GCC) 8.2.1 20181127

$ ld --version
LLD 7.0.1 (compatible with GNU linkers)

$ gdb --version
GNU gdb (GDB) 8.2.1

I just tried to switch to ld.lld from ld.gold for performance reasons, but hit
a road block: Apparently the DWARF emitted into the final executable or library
is bogus and leads to issues when trying to load it then in consumers like gdb,
valgrind, bloaty, ...

Here are some examples from a single KDE projects (ki18n). Note that I was so
far not able to reproduce this in a simplified standalone example.

Reading symbols from bin/libKF5I18n.so...Dwarf Error: bad offset
(0xcc08000026980004) in compilation unit header (offset 0x6fbe2 + 6) [in module

Reading symbols from ktranscript.so...Dwarf Error: wrong version in compilation
unit header (is 422, should be 2, 3, 4 or 5) [in module

Reading symbols from ki18n-ktranscripttest...Dwarf Error: wrong version in
compilation unit header (is 1024, should be 2, 3, 4 or 5) [in module

I have seen at least one more variation of the version header issue (version

When I instead link with ld.gold, none of these issues show up.

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/20190126/e684a344/attachment.html>

More information about the llvm-bugs mailing list