This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix gas/ehopt.c


Hi!

gas doesn't optimize .eh_frame sections like:

        .section        .eh_frame,"a",@progbits
.Lframe1:
        .long   .LECIE1-.LSCIE1 # Length of Common Information Entry
.LSCIE1:
        .long   0x0     # CIE Identifier Tag
        .byte   0x1     # CIE Version
        .ascii "zR\0"   # CIE Augmentation
        .uleb128 0x1    # CIE Code Alignment Factor
        .sleb128 -4     # CIE Data Alignment Factor
        .byte   0x8     # CIE RA Column
        .uleb128 0x1    # Augmentation size
        .byte   0x1b    # FDE Encoding (pcrel sdata4)
        .byte   0xc     # DW_CFA_def_cfa
        .uleb128 0x4
        .uleb128 0x4
        .byte   0x88    # DW_CFA_offset, column 0x8
        .uleb128 0x1
        .align 4
.LECIE1:
.LSFDE1:
        .long   .LEFDE1-.LASFDE1        # FDE Length
.LASFDE1:
        .long   .LASFDE1-.Lframe1       # FDE CIE offset
        .long   .LFB3-. # FDE initial location
        .long   .LFE3-.LFB3     # FDE address range
        .uleb128 0x0    # Augmentation size
        .byte   0x4     # DW_CFA_advance_loc4
        .long   .LCFI0-.LFB3
...
CFA code
.LASFDE1:

(this is classical .eh_frame for -fpic/i386 without try/catch).
The problem is the FDE's augmentation size, ehopt.c apparently
doesn't assume it can be 0.
Fixed thusly, ok to commit?

2003-04-14  Jakub Jelinek  <jakub at redhat dot com>

	* ehopt.c (check_eh_frame): For aug_size == 0
	in state_seeing_aug_size state skip the state_skipping_aug
	state.

--- gas/ehopt.c.jj	2003-04-14 11:40:25.000000000 -0400
+++ gas/ehopt.c	2003-04-14 12:17:43.000000000 -0400
@@ -1,5 +1,5 @@
 /* ehopt.c--optimize gcc exception frame information.
-   Copyright 1998, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian at cygnus dot com>.
 
 This file is part of GAS, the GNU Assembler.
@@ -363,6 +363,8 @@ check_eh_frame (exp, pnbytes)
 	}
       else
 	d->state = state_error;
+      if (d->state == state_skipping_aug && d->aug_size == 0)
+	d->state = state_wait_loc4;
       break;
 
     case state_skipping_aug:


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]