21 Star 27 Fork 151

src-openEuler/gcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0118-LoongArch-Disable-TLS-type-symbols-from-generating-n.patch 2.23 KB
一键复制 编辑 原始数据 按行查看 历史
ticat_fp 提交于 2024-10-31 10:33 +08:00 . LoongArch: Sync to upstream
From 8cab312a44efc4711fb7adad65f1314349295591 Mon Sep 17 00:00:00 2001
From: Lulu Cheng <chenglulu@loongson.cn>
Date: Tue, 23 Jan 2024 11:28:09 +0800
Subject: [PATCH 118/188] LoongArch: Disable TLS type symbols from generating
non-zero offsets.
TLS gd ld and ie type symbols will generate corresponding GOT entries,
so non-zero offsets cannot be generated.
The address of TLS le type symbol+addend is not implemented in binutils,
so non-zero offset is not generated here for the time being.
gcc/ChangeLog:
* config/loongarch/loongarch.cc (loongarch_symbolic_constant_p):
For symbols of type tls, non-zero Offset is not generated.
---
gcc/config/loongarch/loongarch.cc | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/gcc/config/loongarch/loongarch.cc b/gcc/config/loongarch/loongarch.cc
index 5f22b9dd8..9cdd4ed15 100644
--- a/gcc/config/loongarch/loongarch.cc
+++ b/gcc/config/loongarch/loongarch.cc
@@ -1921,11 +1921,7 @@ loongarch_symbolic_constant_p (rtx x, enum loongarch_symbol_type *symbol_type)
x = UNSPEC_ADDRESS (x);
}
else if (SYMBOL_REF_P (x) || LABEL_REF_P (x))
- {
- *symbol_type = loongarch_classify_symbol (x);
- if (*symbol_type == SYMBOL_TLS)
- return true;
- }
+ *symbol_type = loongarch_classify_symbol (x);
else
return false;
@@ -1936,17 +1932,21 @@ loongarch_symbolic_constant_p (rtx x, enum loongarch_symbol_type *symbol_type)
relocations. */
switch (*symbol_type)
{
- case SYMBOL_TLS_IE:
- case SYMBOL_TLS_LE:
- case SYMBOL_TLSGD:
- case SYMBOL_TLSLDM:
case SYMBOL_PCREL:
case SYMBOL_PCREL64:
/* GAS rejects offsets outside the range [-2^31, 2^31-1]. */
return sext_hwi (INTVAL (offset), 32) == INTVAL (offset);
+ /* The following symbol types do not allow non-zero offsets. */
case SYMBOL_GOT_DISP:
+ case SYMBOL_TLS_IE:
+ case SYMBOL_TLSGD:
+ case SYMBOL_TLSLDM:
case SYMBOL_TLS:
+ /* From an implementation perspective, tls_le symbols are allowed to
+ have non-zero offsets, but currently binutils has not added support,
+ so the generation of non-zero offsets is prohibited here. */
+ case SYMBOL_TLS_LE:
return false;
}
gcc_unreachable ();
--
2.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/gcc.git
git@gitee.com:src-openeuler/gcc.git
src-openeuler
gcc
gcc
master

搜索帮助