[PATCH v4 8/9] loongarch: avoid orphan input sections

Xi Ruoyao xry111 at xry111.site
Sun Aug 28 02:44:24 PDT 2022


On Sun, 2022-08-28 at 11:36 +0200, Ard Biesheuvel wrote:
> But does the ELF psABI for LoongArch describe L_ARCH_NONE as a dynamic
> relocation? .rela.dyn typically only contains relocations that are
> specified as being suitable for runtime relocation.

In Binutils 2.39 the BFD linker often over-estimate the size of .rela.*.
For example if there is only 42 relocations, it may allocate the space
for 47 relocations and fill the unused space in the section with zero. 
Then 5 R_LARCH_NONE will appear.

This has already caused trouble when we reviewed LoongArch glibc port,
but at last the reviewers considered using NONE relocations as a
"padding" acceptable.  So in glibc ld.so will treat R_LARCH_NONE as a
"dynamic" relocation with no real effect.

The issue (or "bug", if we want a more serious term) seems fixed in
Binutils trunk, but I've not rebuilt the entire system with it so I'm
not sure if it's completely fixed.

-- 
Xi Ruoyao <xry111 at xry111.site>
School of Aerospace Science and Technology, Xidian University



More information about the linux-arm-kernel mailing list