Issue 95891
Summary The compiler generates mangled weak symbol in `extern "C"`
Labels new issue
Assignees
Reporter AllanZyne
    example:
```c++
// weak.cpp
extern "C" {
int __xxx(void) { return 0; }
#pragma weak xxx = __xxx
}
```

```bash
$ clang++ -shared weak.cpp -o libweak.so
$ nm -D libweak.so
                 w __cxa_finalize
 w __gmon_start__
                 w _ITM_deregisterTMCloneTable
                 w _ITM_registerTMCloneTable
0000000000001100 T __xxx
0000000000001100 W _Z3xxxv
```

compare with gcc:

```bash
$ g++ -shared weak.cpp -o libweak_gcc.so
$ nm -D libweak_gcc.so
                 w __cxa_finalize 
                 w __gmon_start__ 
                 w _ITM_deregisterTMCloneTable 
                 w _ITM_registerTMCloneTable 
00000000000010f9 T __xxx 
00000000000010f9 W xxx
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to