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.
12 /[^
:]+\.so\.
[0-9.
]+:[ ]+.file format .
*$
/ {
18 sub(/:$
/, "", sofullname
);
20 sub(/^.
*\
//, "", soname
);
21 sub(/\.so\.
[0-9.
]+$
/, "", soname
);
23 suppress =
((filename_regexp
!= "" && sofullname !~ filename_regexp
) \
24 || (libname_regexp
!= "" && soname !~ libname_regexp
));
32 /^
[0-9a
-fA
-F
]+ / { sub(/ /, " - ") }
35 $
4 ==
"*UND*" { next }
40 # If the target uses ST_OTHER, it will be output before the symbol name.
41 $
2 ==
"g" || $
2 ==
"w" && (NF ==
7 || NF ==
8) {
52 gsub(/[()]/, "", version
);
54 # binutils versions up through at least 2.23 have some bugs that
55 # caused STV_HIDDEN symbols to appear in .dynsym, though that is useless.
56 if (NF > 7 && $
7 ==
".hidden") next;
58 if (version ~
/^GLIBC_ABI_
/ && !include_abi_version
) next;
60 if (version ==
"GLIBC_PRIVATE" && !include_private
) next;
63 if (type ==
"D" && ($
4 ==
".tbss" || $
4 ==
".tdata")) {
66 else if (type ==
"D" && $
4 ==
".opd") {
73 else if (type ==
"D" && NF ==
8 && $
7 ==
"0x80") {
74 # Alpha functions avoiding plt entry in users
79 else if ($
4 ==
"*ABS*") {
82 else if (type ==
"D") {
85 else if (type ==
"DO") {
88 else if (type ==
"DF") {
89 if (symbol ~
/^\.
/ && seen_opd
>=
0)
95 else if (type ==
"iD" && ($
4 ==
".text" || $
4 ==
".opd")) {
101 print "ERROR: Unable to handle this type of symbol:", $
0
106 desc = symbol
" " type size
;
109 version = soname
" " version
(combine_fullname ?
" " sofullname
: "");
111 # Append to the string which collects the results.
112 descs = descs version
" " desc
"\n";
117 NF ==
0 || /DYNAMIC SYMBOL TABLE
/ || /file format
/ { next }
120 print "ERROR: Unable to interpret this line:", $
0
125 if (!
end && (combine
|| ! parse_names
|| soname ==
""))
127 tofile = parse_names
&& !combine
;
130 out = prefix soname
".symlist";
131 if (soname in outfiles
)
132 out = out
"." ++outfiles
[soname
];
134 outfiles
[soname
] =
1;
135 outpipe =
"LC_ALL=C sort -u > " out
;
137 outpipe =
"LC_ALL=C sort -u";
140 printf "%s", descs
| outpipe
;
145 print "wrote", out
, "for", sofullname
;