]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Revert "objtool: Warn on functions with ambiguous -ffunction-sections section names"
authorJosh Poimboeuf <jpoimboe@kernel.org>
Thu, 20 Nov 2025 20:14:21 +0000 (12:14 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 21 Nov 2025 09:04:10 +0000 (10:04 +0100)
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
tools/objtool/Documentation/objtool.txt
tools/objtool/check.c

index f88f8d28513ad7f792a2881630f994d45f9e7bfa..9e97fc25b2d8a2972990e8f3fe1c7f83eee40dd7 100644 (file)
@@ -456,13 +456,6 @@ the objtool maintainers.
     these special names and does not use module_init() / module_exit()
     macros to create them.
 
-13. file.o: warning: func() function name creates ambiguity with -ffunctions-sections
-
-    Functions named startup(), exit(), split(), unlikely(), hot(), and
-    unknown() are not allowed due to the ambiguity of their section
-    names when compiled with -ffunction-sections.  For more information,
-    see the comment above TEXT_MAIN in include/asm-generic/vmlinux.lds.h.
-
 
 If the error doesn't seem to make sense, it could be a bug in objtool.
 Feel free to ask objtool maintainers for help.
index 1a20ff89df742f1f1710850b7bc31e01f8f61a2d..490cf78029b5929d1a69c762ae9df29c55b8c052 100644 (file)
@@ -2642,37 +2642,6 @@ static int decode_sections(struct objtool_file *file)
        return 0;
 }
 
-/*
- * Certain function names are disallowed due to section name ambiguities
- * introduced by -ffunction-sections.
- *
- * See the comment above TEXT_MAIN in include/asm-generic/vmlinux.lds.h.
- */
-static int validate_function_names(struct objtool_file *file)
-{
-       struct symbol *func;
-       int warnings = 0;
-
-       for_each_sym(file->elf, func) {
-               if (!is_func_sym(func))
-                       continue;
-
-               if (!strcmp(func->name, "startup")      || strstarts(func->name, "startup.")    ||
-                   !strcmp(func->name, "exit")         || strstarts(func->name, "exit.")       ||
-                   !strcmp(func->name, "split")        || strstarts(func->name, "split.")      ||
-                   !strcmp(func->name, "unlikely")     || strstarts(func->name, "unlikely.")   ||
-                   !strcmp(func->name, "hot")          || strstarts(func->name, "hot.")        ||
-                   !strcmp(func->name, "unknown")      || strstarts(func->name, "unknown.")) {
-
-                       WARN("%s() function name creates ambiguity with -ffunction-sections",
-                            func->name);
-                       warnings++;
-               }
-       }
-
-       return warnings;
-}
-
 static bool is_special_call(struct instruction *insn)
 {
        if (insn->type == INSN_CALL) {
@@ -4942,8 +4911,6 @@ int check(struct objtool_file *file)
        if (!nr_insns)
                goto out;
 
-       warnings += validate_function_names(file);
-
        if (opts.retpoline)
                warnings += validate_retpoline(file);