Lines Matching +full:sub +full:- +full:system

1 #!/usr/bin/gawk -f
2 # SPDX-License-Identifier: GPL-2.0
6 # Usage: verify_builtin_ranges.awk modules.builtin.ranges System.map \
27 mod = substr(s, RSTART + 16, RLENGTH - 16);
30 mod = substr(s, RSTART + 13, RLENGTH - 13);
52 gsub(/-/, "_", mod);
64 # strip off the first 6 hex digits before performing the hex-to-dec conversion,
68 sub(/^0x/, "", val);
78 print "Syntax: verify_builtin_ranges.awk <ranges-file> <system-map>\n" \
79 " <builtin-file> <vmlinux-map> <vmlinux-o-map>\n" \
86 # (1) Load the built-in module address range data.
94 # (2) Annotate System.map symbols with module names.
105 sect_base = addr - sect_off;
107 …printf "[%s] BASE (%s) %016x - %016x = %016x\n", sect_name, sect_symb, addr, sect_off, sect_base >…
115 sub(/-/, " ");
117 sub(/-/, " ");
121 sub(/^ +/, "");
133 idx = addr"-"name;
140 # Once we are done annotating the System.map, we no longer need the ranges data.
146 # (3) Build a lookup map of built-in module names.
149 # kernel/crypto/lzo-rle.ko
150 # and we record the object name "crypto/lzo-rle".
153 sub(/kernel\//, ""); # strip off "kernel/" prefix
154 sub(/\.ko$/, ""); # strip off .ko suffix
184 ARGIND >= 4 && map_is_lld && NF == 5 && /[0-9] [^ ]+$/ {
195 sub(/:\(/, " ");
196 sub(/ vmlinux\.a\(/, " ");
202 ARGIND >= 4 && map_is_lld && NF == 5 && $5 ~ /^[A-Za-z_][A-Za-z0-9_]*$/ {
208 ARGIND >= 4 && map_is_lld && /^[0-9a-f]{16} / {
220 # Next section - previous one is done.
233 # Sections with a 0-address can be ignored as well (in vmlinux.map).
259 # If the object is vmlinux.o, we need to consult vmlinux.o.map for per-object
300 # - For all symbols in a given object:
301 # - If the symbol is annotated with the same module name(s) that the object
303 # - Otherwise:
304 # - If the symbol is known to have duplicates of which at least one is
305 # in a built-in module, disregard it.
306 # - If the symbol us not annotated with any module name(s) AND the
307 # object belongs to built-in modules, count it as missing.
308 # - Otherwise, count it as a mismatch.
317 # Handle the rare but annoying case where a 0-size symbol is placed at
321 # start of another built-in module, so the only safe thing to do is to
332 idx = addr"-"$2;