Skip to content

Commit ad69e02

Browse files
committed
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
2 parents 405a41d + b4ae43b commit ad69e02

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

include/asm-generic/vmlinux.lds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG)
457457
. = ALIGN((align)); \
458458
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
459459
__start_rodata = .; \
460-
*(.rodata) *(.rodata.*) \
460+
*(.rodata) *(.rodata.*) *(.data.rel.ro*) \
461461
SCHED_DATA \
462462
RO_AFTER_INIT_DATA /* Read only after init */ \
463463
. = ALIGN(8); \

include/linux/compiler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
110110
/* Unreachable code */
111111
#ifdef CONFIG_OBJTOOL
112112
/* Annotate a C jump table to allow objtool to follow the code flow */
113-
#define __annotate_jump_table __section(".rodata..c_jump_table,\"a\",@progbits #")
113+
#define __annotate_jump_table __section(".data.rel.ro.c_jump_table")
114114
#else /* !CONFIG_OBJTOOL */
115115
#define __annotate_jump_table
116116
#endif /* CONFIG_OBJTOOL */

tools/objtool/check.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,13 +2472,14 @@ static void mark_rodata(struct objtool_file *file)
24722472
*
24732473
* - .rodata: can contain GCC switch tables
24742474
* - .rodata.<func>: same, if -fdata-sections is being used
2475-
* - .rodata..c_jump_table: contains C annotated jump tables
2475+
* - .data.rel.ro.c_jump_table: contains C annotated jump tables
24762476
*
24772477
* .rodata.str1.* sections are ignored; they don't contain jump tables.
24782478
*/
24792479
for_each_sec(file, sec) {
2480-
if (!strncmp(sec->name, ".rodata", 7) &&
2481-
!strstr(sec->name, ".str1.")) {
2480+
if ((!strncmp(sec->name, ".rodata", 7) &&
2481+
!strstr(sec->name, ".str1.")) ||
2482+
!strncmp(sec->name, ".data.rel.ro", 12)) {
24822483
sec->rodata = true;
24832484
found = true;
24842485
}

tools/objtool/include/objtool/special.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <objtool/check.h>
1111
#include <objtool/elf.h>
1212

13-
#define C_JUMP_TABLE_SECTION ".rodata..c_jump_table"
13+
#define C_JUMP_TABLE_SECTION ".data.rel.ro.c_jump_table"
1414

1515
struct special_alt {
1616
struct list_head list;

tools/objtool/noreturns.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ NORETURN(__x64_sys_exit_group)
1919
NORETURN(arch_cpu_idle_dead)
2020
NORETURN(bch2_trans_in_restart_error)
2121
NORETURN(bch2_trans_restart_error)
22-
NORETURN(bch2_trans_unlocked_error)
22+
NORETURN(bch2_trans_unlocked_or_in_restart_error)
2323
NORETURN(cpu_bringup_and_idle)
2424
NORETURN(cpu_startup_entry)
2525
NORETURN(do_exit)

0 commit comments

Comments
 (0)