public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
From: hjl@lucon.org (H.J. Lu)
To: ian@cygnus.com (Ian Lance Taylor)
Cc: rth@cygnus.com, gas2@cygnus.com
Subject: An EH patch for gas
Date: Sat, 29 Aug 1998 07:27:00 -0000	[thread overview]
Message-ID: <m0zClxj-000395C@ocean.lucon.org> (raw)

Hi, Ian,

It is wrong to treat all 0x4 as DW_CFA_advance_loc4. .eh_frame can have

	...
	.byte	0x9a
	.byte	0x4
.align 3
	.4byte	length
	...

0x4 here is LEB128 for 0x9a. I believe this patch fixes the bug. Do you
have a better one?

Thanks.

-- 
H.J. Lu (hjl@gnu.org)
---
Sat Aug 29 07:18:45 1998  H.J. Lu  (hjl@gnu.org)

	* as.h (eh_frame_reset): New declaration.

	* ehopt.c (eh_frame_reset): Reset saw_advance_loc4 to 0.

	* read.c (s_align): Call eh_frame_reset ().
	* config/tc-alpha.c (s_alpha_align): Likewise.
	* config/tc-arm.c (s_align): Likewise.
	* config/tc-hppa.c (pa_align): Likewise.
	* config/tc-mips.c (s_align): Likewise.

Index: as.h
===================================================================
RCS file: /home/work/cvs/gnu/binutils/gas/as.h,v
retrieving revision 1.13
diff -u -p -r1.13 as.h
--- as.h	1998/02/17 20:35:41	1.13
+++ as.h	1998/08/29 13:49:08
@@ -592,6 +592,7 @@ int check_eh_frame PARAMS ((struct expre
 int eh_frame_estimate_size_before_relax PARAMS ((fragS *));
 int eh_frame_relax_frag PARAMS ((fragS *));
 void eh_frame_convert_frag PARAMS ((fragS *));
+void eh_frame_reset PARAMS ((void));
 
 #include "expr.h"		/* Before targ-*.h */
 
Index: ehopt.c
===================================================================
RCS file: /home/work/cvs/gnu/binutils/gas/ehopt.c,v
retrieving revision 1.3
diff -u -p -r1.3 ehopt.c
--- ehopt.c	1998/03/31 22:25:05	1.3
+++ ehopt.c	1998/08/29 14:14:30
@@ -243,6 +243,16 @@ eh_frame_code_alignment ()
   return code_alignment;
 }
 
+static int saw_advance_loc4;
+
+/* This functon is called from various functions which handle ".align".
+   A .align marks the end of an FDE entry. */
+void
+eh_frame_reset ()
+{
+  saw_advance_loc4 = 0;
+}
+
 /* This function is called from emit_expr.  It looks for cases which
    we can optimize.
 
@@ -261,7 +271,6 @@ check_eh_frame (exp, pnbytes)
      expressionS *exp;
      unsigned int *pnbytes;
 {
-  static int saw_advance_loc4;
   static fragS *loc4_frag;
   static int loc4_fix;
 
Index: read.c
===================================================================
RCS file: /home/work/cvs/gnu/binutils/gas/read.c,v
retrieving revision 1.15
diff -u -p -r1.15 read.c
--- read.c	1998/05/27 16:38:41	1.15
+++ read.c	1998/08/29 13:48:30
@@ -1216,6 +1216,8 @@ s_align (arg, bytes_p)
   int max;
   int fill_p;
 
+  eh_frame_reset ();
+
   if (flag_mri)
     stop = mri_comment_field (&stopc);
 
Index: config/tc-alpha.c
===================================================================
RCS file: /home/work/cvs/gnu/binutils/gas/config/tc-alpha.c,v
retrieving revision 1.11
diff -u -p -r1.11 tc-alpha.c
--- config/tc-alpha.c	1998/03/04 17:58:19	1.11
+++ config/tc-alpha.c	1998/08/29 14:04:53
@@ -4161,6 +4161,8 @@ s_alpha_align (ignore)
   char fill, *pfill;
   long max_alignment = 15;
 
+  eh_frame_reset ();
+
   align = get_absolute_expression ();
   if (align > max_alignment)
     {
Index: config/tc-arm.c
===================================================================
RCS file: /home/work/cvs/gnu/binutils/gas/config/tc-arm.c,v
retrieving revision 1.17
diff -u -p -r1.17 tc-arm.c
--- config/tc-arm.c	1998/06/29 15:37:06	1.17
+++ config/tc-arm.c	1998/08/29 14:09:10
@@ -1166,6 +1166,8 @@ s_align (unused)	/* Same as s_align_ptwo
   register long temp_fill;
   long max_alignment = 15;
 
+  eh_frame_reset ();
+
   temp = get_absolute_expression ();
   if (temp > max_alignment)
     as_bad ("Alignment too large: %d. assumed.", temp = max_alignment);
Index: config/tc-hppa.c
===================================================================
RCS file: /home/work/cvs/gnu/binutils/gas/config/tc-hppa.c,v
retrieving revision 1.1.1.24
diff -u -p -r1.1.1.24 tc-hppa.c
--- config/tc-hppa.c	1997/10/25 21:55:39	1.1.1.24
+++ config/tc-hppa.c	1998/08/29 14:09:45
@@ -4026,6 +4026,8 @@ pa_parse_neg_add_cmpltr (s, isbranch)
 static void
 pa_align (bytes)
 {
+  eh_frame_reset ();
+
   /* We must have a valid space and subspace.  */
   pa_check_current_space_and_subspace ();
 
Index: config/tc-mips.c
===================================================================
RCS file: /home/work/cvs/gnu/binutils/gas/config/tc-mips.c,v
retrieving revision 1.31
diff -u -p -r1.31 tc-mips.c
--- config/tc-mips.c	1998/03/25 17:09:26	1.31
+++ config/tc-mips.c	1998/08/29 14:10:47
@@ -9595,6 +9595,8 @@ s_align (x)
   register long temp_fill;
   long max_alignment = 15;
 
+  eh_frame_reset ();
+
   /*
 
     o  Note that the assembler pulls down any immediately preceeding label

             reply	other threads:[~1998-08-29  7:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-08-29  7:27 H.J. Lu [this message]
1998-08-29 12:13 ` Ian Lance Taylor

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=m0zClxj-000395C@ocean.lucon.org \
    --to=hjl@lucon.org \
    --cc=gas2@cygnus.com \
    --cc=ian@cygnus.com \
    --cc=rth@cygnus.com \
    /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).