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";
18 size = strtonum("0x" $5);
21 gsub(/[()]/, "", version);
23 if (version == "GLIBC_PRIVATE") next;
25 if (type == "D" && $4 == ".tbss") {
26 print symbol, version, weak, "TLS", size | outpipe;
28 else if (type == "D" && $4 == ".opd") {
29 print symbol, version, weak, "FDESC" | outpipe;
31 else if (type == "DO" && $4 == "*ABS*") {
32 print symbol, version, weak, "ABS" | outpipe;
34 else if (type == "DO") {
35 print symbol, version, weak, "DATA", size | outpipe;
37 else if (type == "DF") {
38 print symbol, version, weak, "FUNC" | outpipe;
41 print symbol, version, weak, "UNEXPECTED", type, $4, $5;
48 NF == 0 || /DYNAMIC SYMBOL TABLE/ || /file format/ { next }
51 print "Don't grok this line:", $0