Re: [PATCH v3 12/12] objtool/klp: Fold LoongArch paired ADD/SUB relocations into PCREL
Xi Ruoyao <[email protected]> Wed, 08 Jul 2026 21:29:46 +0800
| Newsgroups | org.kernel.vger.live-patching,dev.linux.lists.llvm,dev.linux.lists.loongarch,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2026-07-07 at 15:20 +0800, George Guo wrote: > From: George Guo <[email protected]> >=20 > On LoongArch, the "key - ." field of a __jump_table entry can come out > as two relocations at the same offset, R_LARCH_ADD64 plus > R_LARCH_SUB64.=C2=A0 clang's integrated assembler emits this pair when th= e > key symbol is not defined in the same translation unit (for example > __tracepoint_netif_rx); GAS, and clang for locally-defined keys, > produce a single R_LARCH_64_PCREL instead, which is why GCC builds do > not hit this. Hmm, is this a flaw in LLVM? We have config AS_HAS_THIN_ADD_SUB def_bool $(cc-option,-Wa$(comma)-mthin-add-sub) || AS_IS_LLVM so we are already expecting LLVM to emit R_LARCH_64_PCREL always instead of ADD64/SUB64. --=20 Xi Ruoyao <[email protected]>