代码拉取完成,页面将自动刷新
同步操作将从 OpenCloudOS Stream/binutils 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 43fdb57b36afb8fd1d76f3dc7a9833d60ef90422 Mon Sep 17 00:00:00 2001
From: Lulu Cai <[email protected]>
Date: Fri, 23 Feb 2024 16:28:22 +0800
Subject: [PATCH 070/123] LoongArch: Add dtpoff calculation function
When tls_sec is NULL, we should not access the virtual address
of tls_sec.
---
bfd/elfnn-loongarch.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c
index eea1839f..489ccbe0 100644
--- a/bfd/elfnn-loongarch.c
+++ b/bfd/elfnn-loongarch.c
@@ -2550,6 +2550,16 @@ loongarch_reloc_is_fatal (struct bfd_link_info *info,
})
+static bfd_vma
+tls_dtpoff_base (struct bfd_link_info *info)
+{
+ /* If tls_sec is NULL, we should have signalled an error already. */
+ if (elf_hash_table (info)->tls_sec == NULL)
+ return 0;
+ return elf_hash_table (info)->tls_sec->vma;
+}
+
+
static int
loongarch_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
bfd *input_bfd, asection *input_section,
@@ -3708,7 +3718,7 @@ loongarch_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
rela.r_offset = sec_addr (got) + got_off + desc_off;
rela.r_addend = 0;
if (indx == 0)
- rela.r_addend = relocation - elf_hash_table (info)->tls_sec->vma;
+ rela.r_addend = relocation - tls_dtpoff_base (info);
rela.r_info = ELFNN_R_INFO (indx, R_LARCH_TLS_DESCNN);
loongarch_elf_append_rela (output_bfd, relgot, &rela);
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。