public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Make sure DW_CFA_advance_loc4 is in the same frag
@ 2023-08-10  2:21 Jinyang He
  2023-08-10  7:51 ` Alan Modra
  2023-08-10  7:55 ` Jan Beulich
  0 siblings, 2 replies; 11+ messages in thread
From: Jinyang He @ 2023-08-10  2:21 UTC (permalink / raw)
  To: Nick Clifton, mengqinggang; +Cc: binutils, Xing Li, Xi Ruoyao

The DW_CFA_advance_loc4 may be in different frags. Then fr_fix
may caused something wrong. Referenced by commit b9d8f5601bcf
("Re: Optimise away eh_frame advance_loc 0").

gas/ChangeLog:

	* ehopt.c (check_eh_frame): Don't allow DW_CFA_advance_loc4
	to be placed in a different frag to the rs_cfa.
---
BTW, it is a bug I triggered when compiling a LoongArch.asm file with
relaxation being enabled. I hope it could be merged to 2.41 as bug-fix.
 
 gas/ehopt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gas/ehopt.c b/gas/ehopt.c
index feea61b92..9d6606adf 100644
--- a/gas/ehopt.c
+++ b/gas/ehopt.c
@@ -386,7 +386,7 @@ check_eh_frame (expressionS *exp, unsigned int *pnbytes)
 	{
 	  /* This might be a DW_CFA_advance_loc4.  Record the frag and the
 	     position within the frag, so that we can change it later.  */
-	  frag_grow (1);
+	  frag_grow (1 + 4);
 	  d->state = state_saw_loc4;
 	  d->loc4_frag = frag_now;
 	  d->loc4_fix = frag_now_fix ();
-- 
2.34.3


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-09-08 23:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ab826dcb-6969-a980-889a-6958b60a4b48@loongson.cn>
2023-08-10 12:36 ` [PATCH] Make sure DW_CFA_advance_loc4 is in the same frag Jinyang He
2023-08-10 12:55   ` Jan Beulich
2023-08-10 23:02     ` Alan Modra
2023-08-11  8:27       ` Jan Beulich
2023-08-11 10:15         ` Alan Modra
2023-08-30  3:35           ` Jinyang He
2023-08-30  6:28             ` Jan Beulich
2023-09-08 23:46               ` Alan Modra
2023-08-10  2:21 Jinyang He
2023-08-10  7:51 ` Alan Modra
2023-08-10  7:55 ` Jan Beulich

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).