Skip to content

Commit 1199199

Browse files
jpoimboePeter Zijlstra
authored andcommitted
Revert "objtool: Warn on functions with ambiguous -ffunction-sections section names"
This reverts commit 9c7dc1d. 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
1 parent 93863f3 commit 1199199

2 files changed

Lines changed: 0 additions & 40 deletions

File tree

tools/objtool/Documentation/objtool.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -456,13 +456,6 @@ the objtool maintainers.
456456
these special names and does not use module_init() / module_exit()
457457
macros to create them.
458458

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-
466459

467460
If the error doesn't seem to make sense, it could be a bug in objtool.
468461
Feel free to ask objtool maintainers for help.

tools/objtool/check.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,37 +2642,6 @@ static int decode_sections(struct objtool_file *file)
26422642
return 0;
26432643
}
26442644

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-
26762645
static bool is_special_call(struct instruction *insn)
26772646
{
26782647
if (insn->type == INSN_CALL) {
@@ -4942,8 +4911,6 @@ int check(struct objtool_file *file)
49424911
if (!nr_insns)
49434912
goto out;
49444913

4945-
warnings += validate_function_names(file);
4946-
49474914
if (opts.retpoline)
49484915
warnings += validate_retpoline(file);
49494916

0 commit comments

Comments
 (0)