Fix an objtool false positive, and objtool related
build warnings that happens on PIE-enabled architectures such as LoongArch. Signed-off-by: Ingo Molnar <mingo@kernel.org> -----BEGIN PGP SIGNATURE----- iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmfCCV0RHG1pbmdvQGtl cm5lbC5vcmcACgkQEnMQ0APhK1jHsA//RLrKlu/nvMO0l03s9ndWaunz0Nih/Z54 JJm4Ig+NLYY8VWLH+q6xfII8LT0oUeLh4OtmRj1vMhDbi2DnWozzDA1cvh6Fhyfj YG9Xgzej7ZPU43AVlItl80TbG/xfEdD5yxZx8WC6/WUI17XcpTkDC9/NG/NfrUjY 2a+A8nJk/qa/M+qCHf7ugDxMQFrOVRDDtdBSRAUbifqgygKO+AtXCIyeBfbtVkyV GEWusjO4lsyiY1dzG911h+ROIl/hp6Y3B940PSXyiwjs8JFJJplECnrnwROvRhTm xUDFeszEh40i6zHu2dzFf0up9vFCFZGpjzvMTc0Dt50i4Z3OxbxXW+Ust2YjpSms Ux+MHsH850UoXS/4QB7R2RJndqLTvsYkcu8uhOc2izVkWvTORba0+SMguKuTu1xI MDKozZxtH1DPCtMcZtNIgVlQEwsioKaHUS/PgXhdqw8+fg3ur9FEXp8Q2ubUm7XJ VJm6nF0RvFZNiIIDm81O1Z1RmmxUuAlAHWIOREaNzTSHu3ptBjBOtRrBTem2WAMa 9g1n4GoB7HI96TG36ik0/1oZhEAhawEwT/HhehVpPJyKNQooADYqhhPpfysyGJzq mp+oOdf0QYfD0+M4oqmEGN0fhIlNobK7ap2O+t7HPcJwO1Om3h6WCkyijixj6xPt cOuqhG+GKSk= =16p4 -----END PGP SIGNATURE----- Merge tag 'objtool-urgent-2025-02-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fixes from Ingo Molnar: "Fix an objtool false positive, and objtool related build warnings that happens on PIE-enabled architectures such as LoongArch" * tag 'objtool-urgent-2025-02-28' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Add bch2_trans_unlocked_or_in_restart_error() to bcachefs noreturns objtool: Fix C jump table annotations for Clang vmlinux.lds: Ensure that const vars with relocations are mapped R/O
This commit is contained in:
commit
ad69e02128
5 changed files with 8 additions and 7 deletions
|
@ -457,7 +457,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
|
|||
. = ALIGN((align)); \
|
||||
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
|
||||
__start_rodata = .; \
|
||||
*(.rodata) *(.rodata.*) \
|
||||
*(.rodata) *(.rodata.*) *(.data.rel.ro*) \
|
||||
SCHED_DATA \
|
||||
RO_AFTER_INIT_DATA /* Read only after init */ \
|
||||
. = ALIGN(8); \
|
||||
|
|
|
@ -110,7 +110,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
|
|||
/* Unreachable code */
|
||||
#ifdef CONFIG_OBJTOOL
|
||||
/* Annotate a C jump table to allow objtool to follow the code flow */
|
||||
#define __annotate_jump_table __section(".rodata..c_jump_table,\"a\",@progbits #")
|
||||
#define __annotate_jump_table __section(".data.rel.ro.c_jump_table")
|
||||
#else /* !CONFIG_OBJTOOL */
|
||||
#define __annotate_jump_table
|
||||
#endif /* CONFIG_OBJTOOL */
|
||||
|
|
|
@ -2472,13 +2472,14 @@ static void mark_rodata(struct objtool_file *file)
|
|||
*
|
||||
* - .rodata: can contain GCC switch tables
|
||||
* - .rodata.<func>: same, if -fdata-sections is being used
|
||||
* - .rodata..c_jump_table: contains C annotated jump tables
|
||||
* - .data.rel.ro.c_jump_table: contains C annotated jump tables
|
||||
*
|
||||
* .rodata.str1.* sections are ignored; they don't contain jump tables.
|
||||
*/
|
||||
for_each_sec(file, sec) {
|
||||
if (!strncmp(sec->name, ".rodata", 7) &&
|
||||
!strstr(sec->name, ".str1.")) {
|
||||
if ((!strncmp(sec->name, ".rodata", 7) &&
|
||||
!strstr(sec->name, ".str1.")) ||
|
||||
!strncmp(sec->name, ".data.rel.ro", 12)) {
|
||||
sec->rodata = true;
|
||||
found = true;
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
#include <objtool/check.h>
|
||||
#include <objtool/elf.h>
|
||||
|
||||
#define C_JUMP_TABLE_SECTION ".rodata..c_jump_table"
|
||||
#define C_JUMP_TABLE_SECTION ".data.rel.ro.c_jump_table"
|
||||
|
||||
struct special_alt {
|
||||
struct list_head list;
|
||||
|
|
|
@ -19,7 +19,7 @@ NORETURN(__x64_sys_exit_group)
|
|||
NORETURN(arch_cpu_idle_dead)
|
||||
NORETURN(bch2_trans_in_restart_error)
|
||||
NORETURN(bch2_trans_restart_error)
|
||||
NORETURN(bch2_trans_unlocked_error)
|
||||
NORETURN(bch2_trans_unlocked_or_in_restart_error)
|
||||
NORETURN(cpu_bringup_and_idle)
|
||||
NORETURN(cpu_startup_entry)
|
||||
NORETURN(do_exit)
|
||||
|
|
Loading…
Add table
Reference in a new issue