From b5b05a6e6524778e20fccd6b019e781727659f42 Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 19 Jun 2024 14:04:18 +0800 Subject: LoongArch: TLS IE needs only one dynamic reloc As the comment in the code says, TLS_IE needs only one dynamic reloc. But commit b67a17aa7c0c ("LoongArch: Fix the issue of excessive relocation generated by GD and IE") has incorrectly allocated the space for two dynamic relocs, causing libc.so to contain 8 R_LARCH_NONE. Adjust tlsdesc-dso.d for the offset changes and add two tests to ensure there are no R_LARCH_NONE with TLS. Signed-off-by: Xi Ruoyao --- bfd/elfnn-loongarch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bfd') diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c index 93c036f..b172076 100644 --- a/bfd/elfnn-loongarch.c +++ b/bfd/elfnn-loongarch.c @@ -1353,7 +1353,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { s->size += GOT_ENTRY_SIZE; if (need_reloc) - htab->elf.srelgot->size += 2 * sizeof (ElfNN_External_Rela); + htab->elf.srelgot->size += sizeof (ElfNN_External_Rela); } /* TLS_DESC needs one dynamic reloc and two GOT slot. */ -- cgit v1.1