aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2024-06-19 14:04:18 +0800
committerliuzhensong <liuzhensong@loongson.cn>2024-06-20 16:55:24 +0800
commitb5b05a6e6524778e20fccd6b019e781727659f42 (patch)
tree341ee99d646d3efef302612b3ef3210be785aca0 /bfd
parentb5929e7aa0195a0656a63da95d5eccbb73b5b173 (diff)
downloadbinutils-b5b05a6e6524778e20fccd6b019e781727659f42.zip
binutils-b5b05a6e6524778e20fccd6b019e781727659f42.tar.gz
binutils-b5b05a6e6524778e20fccd6b019e781727659f42.tar.bz2
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 <xry111@xry111.site>
Diffstat (limited to 'bfd')
-rw-r--r--bfd/elfnn-loongarch.c2
1 files changed, 1 insertions, 1 deletions
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. */