https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104834
--- Comment #1 from Aleksander Wabik <alex.wabik at gmail dot com> ---
Default visiblity symbols in the object file generated by the compilation:
- in GCC:
$ readelf -sW test.o | grep -v UND | grep -v SECTION | grep DEFAULT
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS test.cc
10: 0000000000000000 40 FUNC LOCAL DEFAULT 21 _Z7PubFuncv.cold
30: 0000000000000000 0 NOTYPE LOCAL DEFAULT 2
_ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN10ThreadTestC4EvEUlvE_EEEEED5Ev
46: 0000000000000000 40 OBJECT WEAK DEFAULT 31
_ZTVNSt6thread11_State_implINS_8_InvokerISt5tupleIJZN10ThreadTestC4EvEUlvE_EEEEEE
51: 0000000000000000 127 FUNC GLOBAL DEFAULT 12 _Z7PubFuncv
60: 0000000000000000 4 FUNC WEAK DEFAULT 24
_ZN3aaa7WrapperI12PublicStructE3getEv
62: 0000000000000000 4 FUNC WEAK DEFAULT 26
_ZN3aaa7WrapperI10ThisIsEnumE3getEv
63: 0000000000000000 4 FUNC WEAK DEFAULT 27
_ZN3aaa7WrapperI10PublicEnumE3getEv
- in clang:
$ readelf -sW test.o | grep -v UND | grep -v SECTION | grep DEFAULT
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS test.cc
2: 0000000000000000 0 NOTYPE LOCAL DEFAULT 4 GCC_except_table0
21: 0000000000000000 151 FUNC GLOBAL DEFAULT 2 _Z7PubFuncv
22: 0000000000000000 4 FUNC WEAK DEFAULT 12
_ZN3aaa7WrapperI10PublicEnumE3getEv
25: 0000000000000000 4 FUNC WEAK DEFAULT 6
_ZN3aaa7WrapperI12PublicStructE3getEv