[LLVMbugs] [Bug 23102] New: Typeinfo references not merged

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 1 13:31:55 PDT 2015


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

            Bug ID: 23102
           Summary: Typeinfo references not merged
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Given

test.cpp:
------------------------
void f();
void g() {
  try {
    f();
  } catch (int x) {
  }
}
-------------------------

test2.cpp:
--------------------------
void f();
void h() {
  try {
    f();
  } catch (int x) {
  }
}
------------------------------

With gcc

$ gcc test.cpp test2.cpp -O3 -fPIC -shared -o test.so
$ readelf  -r test.so | grep ZTI
000000001c88  000b00000001 R_X86_64_64       0000000000000000 _ZTIi + 0

with clang:

$ clang test.cpp test2.cpp -O3 -fPIC -shared -o test.so
$ readelf  -r test.so | grep ZTI
000000001bf0  000700000001 R_X86_64_64       0000000000000000 _ZTIi + 0
000000001bf8  000700000001 R_X86_64_64       0000000000000000 _ZTIi + 0

The difference is that gcc puts the reference to the typeinfo in a comdat
section:

.section        .data.DW.ref._ZTIi,"awG", at progbits,DW.ref._ZTIi,comdat
...
 .quad   _ZTIi

-- 
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/20150401/caa747fe/attachment.html>


More information about the llvm-bugs mailing list