[llvm-bugs] [Bug 43491] New: invalid DW_AT_linkage_name generated for cos<int>

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Sep 28 04:21:03 PDT 2019


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

            Bug ID: 43491
           Summary: invalid DW_AT_linkage_name generated for cos<int>
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mail at milianw.de
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22597
  --> https://bugs.llvm.org/attachment.cgi?id=22597&action=edit
source code to reproduce issue, compile with `clang++ -O2 -g -static`

take the attached code and compile it with `clang++ -O2 -g -static` then look
at the DWARF data e.g. with dwarfdump or similar. You'll notice this:

```
< 2><0x00001b6e>      DW_TAG_subprogram
                        DW_AT_linkage_name         
_ZSt3cosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
                        DW_AT_name                  cos<int>
                        DW_AT_decl_file             0x00000015
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.1.0/../../../../include/c++/9.1.0/cmath
                        DW_AT_decl_line             0x000000c4
                        DW_AT_type                  <0x000026b1>
                        DW_AT_external              yes(1)
                        DW_AT_inline                DW_INL_inlined
```

Now let's use the DW_AT_linkage_name with c++filt or cxxabi's demangle function
and nothing will happen:

```
c++filt
_ZSt3cosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
_ZSt3cosIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_
```

Apparently this isn't a valid mangled name? I don't have enough knowledge of
the format to say why it's not properly demangled, I can only report that it
doesn't work as expected...

-- 
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/20190928/2d178e8f/attachment-0001.html>


More information about the llvm-bugs mailing list