• Home
  • Raw
  • Download

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.
178 # Shut up recordmcount if user has older objcopy
181 $print_warning = 0 if ( -f $quiet_recordmcount);
184 # check_objcopy - whether objcopy supports --globalize-symbols
186 # --globalize-symbols came out in 2.17, we must test the version
191 open (IN, "$objcopy --version |") or die "error running $objcopy";
222 $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\S+)";
223 $weak_regex = "^[0-9a-fA-F]+\\s+([wW])\\s+(\\S+)";
225 $function_regex = "^([0-9a-fA-F]+)\\s+<([^^]*?)>:";
226 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s(mcount|__fentry__)\$";
232 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s(mcount|__fentry__)([+-]0x[0-9a-zA-Z]+)?\$";
235 $mcount_adjust = -1;
238 $ld .= " -m elf_x86_64";
239 $objdump .= " -M x86-64";
240 $objcopy .= " -O elf64-x86-64";
241 $cc .= " -m64";
245 $mcount_adjust = -1;
248 $ld .= " -m elf_i386";
249 $objdump .= " -M i386";
250 $objcopy .= " -O elf32-i386";
251 $cc .= " -m32";
254 if ($cc =~ /-DCC_USING_HOTPATCH/) {
255 …$mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(brcl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^…
258 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
259 $mcount_adjust = -14;
263 $ld .= " -m elf64_s390";
264 $cc .= " -m64";
270 $ld .= " -m shlelf_linux";
272 $objcopy .= " -O elf32-shbig-linux";
274 $objcopy .= " -O elf32-sh-linux";
280 $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)";
282 $function_regex = "^([0-9a-fA-F]+)\\s+<(\\.?\\w*?)>:";
283 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s\\.?_mcount\$";
286 $cc .= " -mbig-endian ";
287 $ld .= " -EB ";
290 $cc .= " -mlittle-endian ";
291 $ld .= " -EL ";
296 $cc .= " -m64 ";
297 $ld .= " -m elf64".$ldemulation." ";
299 $cc .= " -m32 ";
300 $ld .= " -m elf32".$ldemulation." ";
306 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_ARM_(CALL|PC24|THM_CALL)" .
312 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_AARCH64_CALL26\\s+_mcount\$";
315 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
319 $cc .= " -mconstant-gp";
323 # 0000000000000000 <igmp_net_exit-0x18>:
331 $function_regex = "^([0-9a-fA-F]+)\\s+<(\\w*?)>:";
334 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
338 $ld .= " -m elf64_sparc";
339 $cc .= " -m64";
340 $objcopy .= " -O elf64-sparc";
342 # To enable module support, we need to enable the -mlong-calls option
371 $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_26\\s+_mcount\$";
373 $mcount_regex = "^\\s*([0-9a-fA-F]+): R_MIPS_HI16\\s+_mcount\$";
375 $objdump .= " -Melf-trad".$endian."mips ";
378 $endian = " -EB ";
379 $ld .= " -melf".$bits."btsmip";
381 $endian = " -EL ";
382 $ld .= " -melf".$bits."ltsmip";
385 $cc .= " -mno-abicalls -fno-pic -mabi=" . $bits . $endian;
390 "^([0-9a-fA-F]+)\\s+<(.|[^\$]L.*?|\$[^L].*?|[^\$][^L].*?)>:";
395 $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\s_mcount\$";
397 $function_regex = "^([0-9a-fA-F]+)\\s+<([^.0-9][0-9a-zA-Z_\\.]+)>:";
398 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\sR_RISCV_CALL(_PLT)?\\s_?mcount\$";
402 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_NDS32_HI20_RELA\\s+_mcount\$";
405 $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_CKCORE_PCREL_JSR_IMM26BY2\\s+_mcount\$";
443 # Step 1: find all the local (static functions) and weak symbols.
461 # update_funcs - print out the current mcount callers
480 # only use locals if objcopy supports globalize-symbols
496 printf FILE "\t%s %s + %d\n", $type, $ref_func, $cur_offset - $offset;
501 # Step 2: find the sections and mcount call sites
503 open(IN, "LANG=C $objdump -hdr $inputfile|") || die "error running $objdump";
525 exit(-1);
590 # Step 3: Compile the file that holds the list of call sites to mcount.
592 `$cc -o $mcount_o -c $mcount_s`;
597 # Step 4: Do we have sections that started with local functions?
604 $globallist .= " --globalize-symbol $con";
605 $locallist .= " --localize-symbol $con";
612 # Step 5: set up each local function as a global
617 # Step 6: Link the global version to our list.
619 `$ld -r $globalobj $mcount_o -o $globalmix`;
622 # Step 7: Convert the local functions back into local symbols
634 # Step 8: Link the object with our list of call sites object.
636 `$ld -r $inputfile $mcount_o -o $mix`;
639 # Step 9: Move the result back to the original object.
644 # Clean up the temp files