Lines Matching +full:in +full:- +full:built

1 #!/usr/bin/gawk -f
2 # SPDX-License-Identifier: GPL-2.0
16 if (fn in omod)
27 mod = substr(s, RSTART + 16, RLENGTH - 16);
30 mod = substr(s, RSTART + 13, RLENGTH - 13);
39 if (!(mod in mods))
44 gsub(/-/, "_", mod);
53 # Update the ranges entry for the given module 'mod' in section 'osect'.
65 entries[idx] = sprintf("%s %08x-%08x %s", sect, soff, eoff, mod);
69 # (1) Build a lookup map of built-in module names.
74 # kernel/crypto/lzo-rle.ko
75 # and we record the object name "crypto/lzo-rle".
89 # We collect the base address of the section in order to convert all addresses
90 # in the section into offset values.
92 # We collect the address of the anchor (or first symbol in the section if there
94 # ranges based on the actual load address of the section in the running kernel.
96 # We collect the start address of any sub-section (section included in the top
98 # done using vmlinux.a because then the list of objects contained in each
99 # section is to be obtained from vmlinux.o.map. The offset of the sub-section
120 # ->
123 ARGIND == 2 && map_is_lld && NF == 5 && /[0-9] [^ ]+$/ {
130 # ->
140 # ->
156 # ->
159 ARGIND == 2 && map_is_lld && sect && !anchor && NF == 5 && $5 ~ /^[_A-Za-z][_A-Za-z0-9]*$/ {
165 ARGIND == 2 && map_is_lld && /^[0-9a-f]{16} / {
170 # need to have the next line pulled in to determine whether it is a
195 # Beginning a new section - done with the previous one (if any).
201 # Process a loadable section (we only care about .-sections).
204 # We also record the raw (non-stripped) address of the section because it can
211 # to strip off is stored in addr_prefix as a regexp, so further clauses can
219 # Sections with a 0-address can be ignored as well.
239 # If we are not in a section we care about, we ignore the record.
251 anchor = sprintf("%s %08x-%08x = %s", sect, 0, 0, $2);
261 # in the section as anchor.
266 addr = strtonum(addr) - base;
267 anchor = sprintf("%s %08x-%08x = %s", sect, addr, addr, $2);
276 # The first occurrence of a section name in an object record establishes the
278 # sections that get combined in the final linking of vmlinux (e.g. .head.text
284 ARGIND == 2 && sect && NF == 4 && /^ [^ \*]/ && !($1 in sect_addend) {
285 if (!($1 in sect_base)) {
295 sect_addend[$1] = addr - sect_base[$1];
299 printf "[%s] ADDEND %016x - %016x = %016x\n", $1, addr, base, sect_addend[$1] >"/dev/stderr";
307 # (3) Collect offset ranges (relative to the section base address) for built-in
325 # - If the current object belongs to the same module(s), update the range data
327 # - Otherwise, ensure that the end offset of the range is valid.
329 # If the current object does not belong to a built-in module, ignore it.
331 # If it does, we add a new built-in module offset range record.
334 if (!(sect in sect_base))
340 soff = strtonum(soff) - sect_base[sect];
343 # Determine which (if any) built-in modules the object belongs to.
346 # If we are processing a built-in module:
347 # - If the current object is within the same module, we update its
349 # - Otherwise:
353 # listed with an incorrect size in the linker map)
374 # If we encountered an object that is not part of a built-in module, we
379 # At this point, we encountered the start of a new built-in module.
397 # (3) Collect offset ranges (relative to the section base address) for built-in
408 if (!(sect in sect_addend))
417 # If we do not know an addend for the object's section, we are interested in
420 # Determine the top-level section that the object's section was included in
425 # procedure outlined in (3a).
429 if (!(osect in sect_addend))
441 # Determine which (if any) built-in modules the object belongs to.
444 # If we are processing a built-in module:
445 # - If the current object is within the same module, we update its
447 # - Otherwise:
451 # listed with an incorrect size in the linker map)
472 # If we encountered an object that is not part of a built-in module, we
477 # At this point, we encountered the start of a new built-in module.
491 # ensure they come first in the second records (see update_entry() above for
495 # parsed in strict ascending address order.
498 for (sect in count) {
499 if (sect in sect_anchor) {