From nobody Tue Dec 2 02:05:53 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3477238C3B for ; Thu, 20 Nov 2025 20:15:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763669707; cv=none; b=eqFwvM1d7LPJm7b1pWK+/2mKHMHkXfj1qzs5rfy9fO82s+a1QRovfIRCExcKqLJmQiBYMXFNHdIf8vk4jZKFwe3t/GgB+1au6TlM/BqWXsi2YTF//phb6aZNNUAqILPY8gOXDGKPVDTeu//BduX/4+Qi2vD5pmc9QYPAnjumgc0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763669707; c=relaxed/simple; bh=HhYG+rfbcnKWMpZZvL58X6/XVBb8jmjGxvV/Ge+TPJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q5aQnH9M4i4ZWs/ZXNrHC3ZHiV95emKtncTm/vfIdv5vK9uUU5vG93fYQTJTd33dPK5tkiA+J4Q4uJbH4G5tz57JFSfyWG4cIC8D4xycdoYj5dmIo+SXaCzy+PqhIIMlfZlFPQB84o7kwynGMfRif+VBoi4hiGygMACAmtQnQiw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K3LUcofy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K3LUcofy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19773C116C6; Thu, 20 Nov 2025 20:15:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1763669705; bh=HhYG+rfbcnKWMpZZvL58X6/XVBb8jmjGxvV/Ge+TPJg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K3LUcofyTze8M1eI0tOVc5Q+IUKjzD5CHk1Ehh5R3u6vOSOTGj6Zh3wi9waEsEE4A ApunHPmmLb+BkgKKriIO+1c3qkxsjej8sGqo3w19BIZE+FEEfSMxIzZhfZuzmkQkgk /J5mVrIOBxE8N5wvsl1b/JuMNC29CmYQpnoEwhdb1dsBk8D5901BoGkH8hrKn0WVCF LD340aX4cL8ao0bSi79w8PphTMapdbTYRPUknQz9x9pewS9NyPDouO9ifFNv7oPlVq hEBuUx1XgEmhRSxxui/xuzOOPy6FdC6s4iPDs+8aoupqAAtcj2X+rNXht+sIgY4iUc VgO9DlpmCzO6Q== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Greg Kroah-Hartman , Jiri Slaby , Mauro Carvalho Chehab , Hans de Goede Subject: [PATCH 6/6] Revert "objtool: Warn on functions with ambiguous -ffunction-sections section names" Date: Thu, 20 Nov 2025 12:14:21 -0800 Message-ID: X-Mailer: git-send-email 2.51.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 --- tools/objtool/Documentation/objtool.txt | 7 ------ tools/objtool/check.c | 33 ------------------------- 2 files changed, 40 deletions(-) diff --git a/tools/objtool/Documentation/objtool.txt b/tools/objtool/Docume= ntation/objtool.txt index f88f8d28513a..9e97fc25b2d8 100644 --- a/tools/objtool/Documentation/objtool.txt +++ b/tools/objtool/Documentation/objtool.txt @@ -456,13 +456,6 @@ the objtool maintainers. these special names and does not use module_init() / module_exit() macros to create them. =20 -13. file.o: warning: func() function name creates ambiguity with -ffunctio= ns-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. - =20 If the error doesn't seem to make sense, it could be a bug in objtool. Feel free to ask objtool maintainers for help. diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 72c7f6f03350..57fac6ce3454 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2663,37 +2663,6 @@ static int decode_sections(struct objtool_file *file) return 0; } =20 -/* - * 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 =3D 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 =3D=3D INSN_CALL) { @@ -4963,8 +4932,6 @@ int check(struct objtool_file *file) if (!nr_insns) goto out; =20 - warnings +=3D validate_function_names(file); - if (opts.retpoline) warnings +=3D validate_retpoline(file); =20 --=20 2.51.1