Lines Matching +full:step +full:- +full:up
2 # SPDX-License-Identifier: GPL-2.0-only
5 # recordmcount.pl - makes a section called __mcount_loc that holds
9 # What we want to end up with this is that each object file will have a
13 # Later on boot up, the kernel will read this list, save the locations and turn
31 # referring a function symbol in this section. During the link step, 'ld' will
58 # .quad func2 - 0x10
81 # the original object, we will end up with two symbols for func1:
82 # one local, one global. After final compile, we will end up with
99 # 4) Do we have to deal with local functions? If not, go to step 8.
145 # Acceptable section-prefixes to record.
150 # Note: we are nice to C-programmers here, thus we skip the '||='-idiom.
189 $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
190 $weak_regex = "^[0-9a-fA-F]+\\s+([wW])\\s+(\\S+)";
192 $function_regex = "^([0-9a-fA-F]+)\\s+<([^^]*?)>:";
193 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s(mcount|__fentry__)\$";
199 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s(mcount|__fentry__)([+-]0x[0-9a-zA-Z]+)?\$";
202 $mcount_adjust = -1;
205 $ld .= " -m elf_x86_64";
206 $objdump .= " -M x86-64";
207 $objcopy .= " -O elf64-x86-64";
208 $cc .= " -m64";
212 $mcount_adjust = -1;
215 $ld .= " -m elf_i386";
216 $objdump .= " -M i386";
217 $objcopy .= " -O elf32-i386";
218 $cc .= " -m32";
221 if ($cc =~ /-DCC_USING_HOTPATCH/) {
222 …$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^…
227 $ld .= " -m elf64_s390";
228 $cc .= " -m64";
234 $ld .= " -m shlelf_linux";
236 $objcopy .= " -O elf32-shbig-linux";
238 $objcopy .= " -O elf32-sh-linux";
244 $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
246 $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?\\w*?)>:";
247 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
250 $cc .= " -mbig-endian ";
251 $ld .= " -EB ";
254 $cc .= " -mlittle-endian ";
255 $ld .= " -EL ";
260 $cc .= " -m64 ";
261 $ld .= " -m elf64".$ldemulation." ";
263 $cc .= " -m32 ";
264 $ld .= " -m elf32".$ldemulation." ";
270 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_ARM_(CALL|PC24|THM_CALL)" .
276 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_AARCH64_CALL26\\s+_mcount\$";
280 # 0000000000000000 <igmp_net_exit-0x18>:
288 $function_regex = "^([0-9a-fA-F]+)\\s+<(\\w*?)>:";
291 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
295 $ld .= " -m elf64_sparc";
296 $cc .= " -m64";
297 $objcopy .= " -O elf64-sparc";
299 # To enable module support, we need to enable the -mlong-calls option
328 $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_26\\s+_mcount\$";
330 $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_HI16\\s+_mcount\$";
332 $objdump .= " -Melf-trad".$endian."mips ";
335 $endian = " -EB ";
336 $ld .= " -melf".$bits."btsmip";
338 $endian = " -EL ";
339 $ld .= " -melf".$bits."ltsmip";
342 $cc .= " -mno-abicalls -fno-pic -mabi=" . $bits . $endian;
347 "^([0-9a-fA-F]+)\\s+<(.|[^\$]L.*?|\$[^L].*?|[^\$][^L].*?)>:";
352 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
354 $function_regex = "^([0-9a-fA-F]+)\\s+<([^.0-9][0-9a-zA-Z_\\.]+)>:";
355 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\sR_RISCV_CALL(_PLT)?\\s_mcount\$";
359 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_CKCORE_PCREL_JSR_IMM26BY2\\s+_mcount\$";
395 # Step 1: find all the local (static functions) and weak symbols.
413 # update_funcs - print out the current mcount callers
443 printf FILE "\t%s %s + %d\n", $type, $ref_func, $cur_offset - $offset;
448 # Step 2: find the sections and mcount call sites
450 open(IN, "LC_ALL=C $objdump -hdr $inputfile|") || die "error running $objdump";
472 exit(-1);
537 # Step 3: Compile the file that holds the list of call sites to mcount.
539 `$cc -o $mcount_o -c $mcount_s`;
544 # Step 4: Do we have sections that started with local functions?
551 $globallist .= " --globalize-symbol $con";
552 $locallist .= " --localize-symbol $con";
559 # Step 5: set up each local function as a global
564 # Step 6: Link the global version to our list.
566 `$ld -r $globalobj $mcount_o -o $globalmix`;
569 # Step 7: Convert the local functions back into local symbols
581 # Step 8: Link the object with our list of call sites object.
583 `$ld -r $inputfile $mcount_o -o $mix`;
586 # Step 9: Move the result back to the original object.
591 # Clean up the temp files