From: mengqinggang <mengqinggang@loongson.cn>
To: binutils@sourceware.org
Cc: xuchenghua@loongson.cn, chenglulu@loongson.cn,
liuzhensong@loongson.cn, cailulu@loongson.cn, xry111@xry111.site,
i.swmail@xen0n.name, maskray@google.com, luweining@loongson.cn,
wanglei@loongson.cn, hejinyang@loongson.cn,
mengqinggang <mengqinggang@loongson.cn>
Subject: [PATCH] LoongArch: gas: Start a new frag after instructions that can be relaxed
Date: Sun, 21 Jan 2024 11:23:26 +0800 [thread overview]
Message-ID: <20240121032326.1952820-1-mengqinggang@loongson.cn> (raw)
For R_LARCH_TLS_{LE_HI20_R,LE_ADD_R,IE_PC_HI20,LD_PC_HI20,GD_PC_HI20,
TLS_DESC_PC_HI20} relocations, start a new frag to get correct eh_frame info.
---
gas/config/tc-loongarch.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gas/config/tc-loongarch.c b/gas/config/tc-loongarch.c
index 863ac9cea43..47ec8441a3b 100644
--- a/gas/config/tc-loongarch.c
+++ b/gas/config/tc-loongarch.c
@@ -1089,7 +1089,13 @@ append_fixp_and_insn (struct loongarch_cl_insn *ip)
if (symbol_get_frag (to) == symbol_get_frag (from))) */
if (LARCH_opts.relax
&& (BFD_RELOC_LARCH_PCALA_HI20 == reloc_info[0].type
- || BFD_RELOC_LARCH_GOT_PC_HI20 == reloc_info[0].type))
+ || BFD_RELOC_LARCH_GOT_PC_HI20 == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_LE_HI20_R == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_LE_ADD_R == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_IE_PC_HI20 == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_LD_PC_HI20 == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_GD_PC_HI20 == reloc_info[0].type
+ || BFD_RELOC_LARCH_TLS_DESC_PC_HI20 == reloc_info[0].type))
{
frag_wane (frag_now);
frag_new (0);
--
2.36.0
reply other threads:[~2024-01-21 3:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240121032326.1952820-1-mengqinggang@loongson.cn \
--to=mengqinggang@loongson.cn \
--cc=binutils@sourceware.org \
--cc=cailulu@loongson.cn \
--cc=chenglulu@loongson.cn \
--cc=hejinyang@loongson.cn \
--cc=i.swmail@xen0n.name \
--cc=liuzhensong@loongson.cn \
--cc=luweining@loongson.cn \
--cc=maskray@google.com \
--cc=wanglei@loongson.cn \
--cc=xry111@xry111.site \
--cc=xuchenghua@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).