]> git.baikalelectronics.ru Git - kernel.git/commit
LoongArch: Support R_LARCH_GOT_PC_{LO12,HI20} 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)
commit37b95c0fa221e19c3063787724baa9ef2c063239
tree1635c79ad548cbffc9da58559874a73d1037e4f9
parent7e8d6cf1b9cee942fc3e75e886612614827da59f
LoongArch: Support R_LARCH_GOT_PC_{LO12,HI20} in modules

GCC >= 13 and GNU assembler >= 2.40 use these relocations to address
external symbols, so we need to add them.

Let the module loader emit GOT entries for data symbols so we would be
able to handle GOT relocations. The GOT entry is just the data's symbol
address.

In module.lds, emit a stub .got section for a section header entry. The
actual content of the section entry will be filled at runtime by module_
frob_arch_sections().

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/include/asm/module.h
arch/loongarch/include/asm/module.lds.h
arch/loongarch/kernel/module-sections.c
arch/loongarch/kernel/module.c