https://bugs.llvm.org/show_bug.cgi?id=38281
Bug ID: 38281
Summary: Fundamental typeinfo should have weak linkage by
default
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: thomasander...@google.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
Compiling the below test.cpp with g++ and clang++ gives different results:
clang generates the fundamental typeinfo with strong linkage, but g++ uses weak
linkage. Clang should switch to using weak linkage to match the gcc behavior.
thomasanderson@thomasanderson:~/test$ cat test.cpp
#include <typeinfo>
namespace __cxxabiv1 {
class __fundamental_type_info : public std::type_info {
public:
virtual ~__fundamental_type_info();
};
__fundamental_type_info::~__fundamental_type_info() {}
}
thomasanderson@thomasanderson:~/test$ g++ test.cpp -c -o main.o
thomasanderson@thomasanderson:~/test$ nm main.o
...
0000000000000000 V _ZTIa
0000000000000000 V _ZTIb
0000000000000000 V _ZTIc
...
thomasanderson@thomasanderson:~/test$ clang++ test.cpp -c -o main.o
thomasanderson@thomasanderson:~/test$ nm main.o
...
0000000000000338 R _ZTIa
0000000000000178 R _ZTIb
0000000000000258 R _ZTIc
...
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs