[LLVMbugs] [Bug 8205] New: Template function gets wrong visibility, ends up in __textcoal_nt section instead of __text section

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 22 08:32:33 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8205

           Summary: Template function gets wrong visibility, ends up in
                    __textcoal_nt section instead of __text section
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nicolasweber at gmx.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


hummer:delta thakis$ cat string16.ii
typedef long unsigned int size_t;
namespace std {
  template<typename _CharT>
  class basic_string     {
    private:
    struct _Rep {
      void  _M_clone();
    };
  };
  template<typename _CharT>
  void basic_string<_CharT>::_Rep::_M_clone() {}
}
typedef unsigned short char16;
template class std::basic_string<char16>;


With gcc:

hummer:delta thakis$ gcc -c string16.ii -o string16_gcc.o
hummer:delta thakis$ nm -m string16_gcc.o 
0000000000000010 (__TEXT,__eh_frame) non-external EH_frame1
0000000000000000 (__TEXT,__text) external __ZNSbItE4_Rep8_M_cloneEv
0000000000000030 (__TEXT,__eh_frame) external __ZNSbItE4_Rep8_M_cloneEv.eh
                 (undefined) external ___gxx_personality_v0


With clang:

hummer:delta thakis$ ~/src/llvm/Release+Asserts/bin/clang -c string16.ii -o
string16_clang.o
hummer:delta thakis$ nm -m string16_clang.o 
0000000000000010 (__TEXT,__eh_frame) non-external EH_frame0
0000000000000000 (__TEXT,__textcoal_nt) weak external __ZNSbItE4_Rep8_M_cloneEv
0000000000000028 (__TEXT,__eh_frame) weak external __ZNSbItE4_Rep8_M_cloneEv.eh


Note how __ZNSbItE4_Rep8_M_cloneEv is in the real text section with gcc, but in
the __textcoal_nt section with clang.

I think that this is a real problem and that this causes http://crbug.com/56471

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list