1 # This awk script processes the output of objdump --dynamic-syms
2 # into a simple format that should not change when the ABI is not changing.
4 BEGIN { outpipe = "sort" }
7 /^[0-9a-fA-F]+ / { sub(/ /, " - ") }
10 $4 == "*UND*" { next }
15 $2 == "g" || $2 == "w" && NF == 7 {
16 weak = ($2 == "w") ? "weak" : "strong";
23 gsub(/[()]/, "", version);
25 if (version == "GLIBC_PRIVATE") next;
27 if (type == "D" && $4 == ".tbss") {
28 print symbol, version, weak, "TLS", size | outpipe;
30 else if (type == "D" && $4 == ".opd") {
31 print symbol, version, weak, "FDESC" | outpipe;
33 else if (type == "DO" && $4 == "*ABS*") {
34 print symbol, version, weak, "ABS" | outpipe;
36 else if (type == "DO") {
37 print symbol, version, weak, "DATA", size | outpipe;
39 else if (type == "DF") {
40 print symbol, version, weak, "FUNC" | outpipe;
43 print symbol, version, weak, "UNEXPECTED", type, $4, $5;
50 NF == 0 || /DYNAMIC SYMBOL TABLE/ || /file format/ { next }
53 print "Don't grok this line:", $0