Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "objtool: Warn on functions with ambiguous -ffunction-sections section names"

This reverts commit 9c7dc1dd897a1cdcade9566ea4664b03fbabf4a4.

The check-function-names.sh script now provides the function name
checking functionality for all architectures, making the objtool check
redundant.

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/c7d549d4de8bd1490d106b99630eea5efc69a4dd.1763669451.git.jpoimboe@kernel.org

authored by

Josh Poimboeuf and committed by
Peter Zijlstra
11991999 93863f3f

-40
-7
tools/objtool/Documentation/objtool.txt
··· 456 456 these special names and does not use module_init() / module_exit() 457 457 macros to create them. 458 458 459 - 13. file.o: warning: func() function name creates ambiguity with -ffunctions-sections 460 - 461 - Functions named startup(), exit(), split(), unlikely(), hot(), and 462 - unknown() are not allowed due to the ambiguity of their section 463 - names when compiled with -ffunction-sections. For more information, 464 - see the comment above TEXT_MAIN in include/asm-generic/vmlinux.lds.h. 465 - 466 459 467 460 If the error doesn't seem to make sense, it could be a bug in objtool. 468 461 Feel free to ask objtool maintainers for help.
-33
tools/objtool/check.c
··· 2642 2642 return 0; 2643 2643 } 2644 2644 2645 - /* 2646 - * Certain function names are disallowed due to section name ambiguities 2647 - * introduced by -ffunction-sections. 2648 - * 2649 - * See the comment above TEXT_MAIN in include/asm-generic/vmlinux.lds.h. 2650 - */ 2651 - static int validate_function_names(struct objtool_file *file) 2652 - { 2653 - struct symbol *func; 2654 - int warnings = 0; 2655 - 2656 - for_each_sym(file->elf, func) { 2657 - if (!is_func_sym(func)) 2658 - continue; 2659 - 2660 - if (!strcmp(func->name, "startup") || strstarts(func->name, "startup.") || 2661 - !strcmp(func->name, "exit") || strstarts(func->name, "exit.") || 2662 - !strcmp(func->name, "split") || strstarts(func->name, "split.") || 2663 - !strcmp(func->name, "unlikely") || strstarts(func->name, "unlikely.") || 2664 - !strcmp(func->name, "hot") || strstarts(func->name, "hot.") || 2665 - !strcmp(func->name, "unknown") || strstarts(func->name, "unknown.")) { 2666 - 2667 - WARN("%s() function name creates ambiguity with -ffunction-sections", 2668 - func->name); 2669 - warnings++; 2670 - } 2671 - } 2672 - 2673 - return warnings; 2674 - } 2675 - 2676 2645 static bool is_special_call(struct instruction *insn) 2677 2646 { 2678 2647 if (insn->type == INSN_CALL) { ··· 4910 4941 4911 4942 if (!nr_insns) 4912 4943 goto out; 4913 - 4914 - warnings += validate_function_names(file); 4915 4944 4916 4945 if (opts.retpoline) 4917 4946 warnings += validate_retpoline(file);