ClangBuiltLinux / linux

Linux kernel source tree
Other
241 stars 14 forks source link

Many objtool warnings for LoongArch #2024

Open nathanchance opened 5 months ago

nathanchance commented 5 months ago

After commit 9f4047a4c9ca ("LoongArch: Update Loongson-3 default config file") in -next, I see many warnings from objtool:

$ make -skj"$(nproc)" ARCH=loongarch LLVM=1 defconfig all
net/bpf/test_run.o: warning: objtool: bpf_test_run_xdp_live+0x7dc: return with modified stack frame
drivers/tty/hvc/hvc_console.o: warning: objtool: __hvc_poll+0x43c: return with modified stack frame
drivers/tty/hvc/hvc_console.o: warning: objtool: hvc_console_print+0x230: return with modified stack frame
arch/loongarch/kernel/perf_event.o: warning: objtool: pmu_handle_irq+0x308: return with modified stack frame
kernel/smp.o: warning: objtool: smp_call_function_single+0x188: return with modified stack frame
kernel/bpf/core.o: warning: objtool: ___bpf_prog_run+0x4c: sibling call from callable instruction with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_namespaces_output+0x1b4: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_aux_event+0x134: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_log_lost_samples+0x114: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_ksymbol_output+0x1c0: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_bpf_output+0x114: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_text_poke_output+0x328: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_report_aux_output_id+0x128: return with modified stack frame
kernel/events/core.o: warning: objtool: ___perf_sw_event+0x1a0: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_bp_event+0xec: return with modified stack frame
kernel/events/core.o: warning: objtool: event_sched_in+0x324: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_log_throttle+0x14c: return with modified stack frame
kernel/events/core.o: warning: objtool: __perf_remove_from_context+0x32c: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_task_output+0x2b8: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_comm_output+0x25c: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_mmap_output+0x438: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_switch_output+0x1d8: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_swevent_hrtimer+0x168: return with modified stack frame
kernel/events/core.o: warning: objtool: perf_event_cgroup_output+0x1dc: return with modified stack frame
kernel/rseq.o: warning: objtool: __rseq_handle_notify_resume+0x44c: return with modified stack frame
lib/crypto/curve25519-hacl64.o: warning: objtool: curve25519_generic+0x8de8: return with modified stack frame
fs/nfs/super.o: warning: objtool: nfs_show_stats+0x6a8: return with modified stack frame
kernel/bpf/cpumap.o: warning: objtool: cpu_map_kthread_run+0x74c: return with modified stack frame
drivers/target/iscsi/iscsi_target.o: warning: objtool: iscsit_response_queue+0x760: return with modified stack frame
...

For the record, I see even more with GCC, how well was the objtool addition tested?

$ make -skj"$(nproc)" ARCH=loongarch CROSS_COMPILE=loongarch64-linux- defconfig all
arch/loongarch/lib/copy_user.o: warning: objtool: unexpected relocation symbol type in .rela.discard.func_stack_frame_non_standard: 0
arch/loongarch/lib/copy_user.o: warning: objtool: .altinstructions+0x0: special: can't find orig instruction
init/main.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
arch/loongarch/lib/clear_user.o: warning: objtool: unexpected relocation symbol type in .rela.discard.func_stack_frame_non_standard: 0
arch/loongarch/lib/clear_user.o: warning: objtool: .altinstructions+0x0: special: can't find orig instruction
arch/loongarch/mm/tlbex.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unwind_hints
init/do_mounts.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction
ipc/util.o: warning: objtool: unexpected relocation symbol type in .rela.discard.reachable
mm/mempool.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
mm/filemap.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction
arch/loongarch/lib/memcpy.o: warning: objtool: unexpected relocation symbol type in .rela.discard.func_stack_frame_non_standard: 0
arch/loongarch/lib/memcpy.o: warning: objtool: .altinstructions+0x0: special: can't find orig instruction
security/commoncap.o: warning: objtool: unexpected relocation symbol type in .rela.discard.reachable
security/lsm_syscalls.o: warning: objtool: __ex_table+0x0: special: can't find orig instruction
fs/open.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
ipc/msg.o: warning: objtool: __ex_table+0x0: special: can't find orig instruction
block/bdev.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
fs/read_write.o: warning: objtool: __ex_table+0x0: special: can't find orig instruction
arch/loongarch/lib/memmove.o: warning: objtool: .altinstructions+0x0: special: can't find orig instruction
arch/loongarch/mm/init.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
mm/maccess.o: warning: objtool: __ex_table+0x0: special: can't find orig instruction
block/fops.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction
fs/file_table.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
arch/loongarch/lib/memset.o: warning: objtool: unexpected relocation symbol type in .rela.discard.func_stack_frame_non_standard: 0
arch/loongarch/lib/memset.o: warning: objtool: .altinstructions+0x0: special: can't find orig instruction
arch/loongarch/mm/cache.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
mm/oom_kill.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction
arch/loongarch/kernel/cpu-probe.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
block/bio.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction
ipc/sem.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
io_uring/opdef.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
ipc/shm.o: warning: objtool: unexpected relocation symbol type in .rela.discard.reachable
arch/loongarch/pci/pci.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
arch/loongarch/mm/extable.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
security/security.o: warning: objtool: __ex_table+0x0: special: can't find orig instruction
arch/loongarch/net/bpf_jit.o: warning: objtool: unexpected relocation symbol type in .rela.discard.reachable
io_uring/io_uring.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
block/blk-core.o: warning: objtool: __jump_table+0x0: special: can't find orig instruction
fs/super.o: warning: objtool: unexpected relocation symbol type in .rela.discard.unreachable
...

cc @xen0n @chenhuacai

nathanchance commented 3 months ago

This has been worked around: https://git.kernel.org/linus/120dd4118e58dbda2ddb1dcf55f3c56cdfe8cee0