]> git.baikalelectronics.ru Git - kernel.git/commit
LoongArch: Support PC-relative relocations in modules
authorXi Ruoyao <xry111@xry111.site>
Wed, 12 Oct 2022 08:36:14 +0000 (16:36 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 12 Oct 2022 08:36:14 +0000 (16:36 +0800)
commit0a15112822fe7c429f8518a22be66cd62d47ef2b
treeb956692584a1b1d9dcf2aa27f57c2c2c5ee554d8
parent3a33e18aa8ac2495a16d113212d441f4c3f3f9af
LoongArch: Support PC-relative relocations in modules

Binutils >= 2.40 uses R_LARCH_B26 instead of R_LARCH_SOP_PUSH_PLT_PCREL,
and R_LARCH_PCALA* instead of R_LARCH_SOP_PUSH_PCREL.

Handle R_LARCH_B26 and R_LARCH_PCALA* in the module loader. For R_LARCH_
B26, also create a PLT entry as needed.

Tested-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/kernel/module-sections.c
arch/loongarch/kernel/module.c