cat a.c
#pragma weak a = bad
#pragma weak b = bad
#pragma weak c = bad
void bad(int *info ) { *info = 0 ; }
clang a.c -c
readelf -sW a.o
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000000000 0 FILE LOCAL DEFAULT ABS a.c
2: 0000000000000000 32 FUNC WEAK DEFAULT 2 a
3: 0000000000000000 32 FUNC GLOBAL DEFAULT 2 bad
Note that, the symbol b and c are missing.
This is gcc behavior:
8: 0000000000000000 52 FUNC GLOBAL DEFAULT 1 bad
9: 0000000000000000 52 FUNC WEAK DEFAULT 1 a
10: 0000000000000000 52 FUNC WEAK DEFAULT 1 b
11: 0000000000000000 52 FUNC WEAK DEFAULT 1 c
clang -v
clang version 3.9.0 (trunk 264998) (llvm/trunk 264997)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4