[committed] mips cfi directives

Eric Christopher echristo@redhat.com
Tue Mar 15 05:23:00 GMT 2005


As a followup to my last patch I'm now fairly convinced it's correct so
I'm going to commit it to the branch and mainline. I constructed a
simple testcase as well to go with the patch.

The changes in the stock testcases are to allow for non-DIFF_EXPR_OK
testcases since the assembler fills in a different value by default
there. (Depending on whether or not pcrel relocs are ok.)

-eric

2005-03-14  Eric Christopher  <echristo@redhat.com>

        * config/tc-mips.c: Include dw2gencfi.h.
        (mips_cfi_frame_initial_instructions): New.
        * config/tc-mips.h (TARGET_USE_CFIPOP): Define.
        (tc_cfi_frame_initial_instructions): Ditto.
        (DWARF2_DEFAULT_RETURN_COLUMN): Ditto.
        (DWARF2_CIE_DATA_ALIGNMENT): Ditto.
        * Makefile.am: Update dependencies.
        * Makefile.in: Regenerate.

2005-03-14  Eric Christopher  <echristo@redhat.com>

        * gas/cfi/cfi-mips-1.d, gas/cfi/cfi-mips-1.s: New dump test.
        * gas/cfi/cfi.exp: Run it.
        * gas/cfi/cfi-common-1.d: Update.
        * gas/cfi/cfi-common-2.d: Ditto.
        * gas/cfi/cfi-common-3.d: Ditto.
        * gas/cfi/cfi-common-4.d: Ditto.

Index: Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.101
diff -u -p -w -r1.101 Makefile.am
--- Makefile.am	21 Feb 2005 11:49:27 -0000	1.101
+++ Makefile.am	15 Mar 2005 00:13:39 -0000
@@ -1302,7 +1302,7 @@ DEPTC_mips_elf = $(INCDIR)/symcat.h $(sr
   $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \
   $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-
mips.h \
   subsegs.h $(INCDIR)/obstack.h $(INCDIR)/safe-ctype.h \
-  $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h $(INCDIR)/elf/mips.h \
+  $(INCDIR)/opcode/mips.h itbl-ops.h dwarf2dbg.h dw2gencfi.h
$(INCDIR)/elf/mips.h \
   $(INCDIR)/elf/reloc-macros.h ecoff.h $(INCDIR)/coff/sym.h \
   $(INCDIR)/coff/ecoff.h
 DEPTC_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
Index: config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.303
diff -u -p -w -r1.303 tc-mips.c
--- config/tc-mips.c	9 Mar 2005 11:56:15 -0000	1.303
+++ config/tc-mips.c	15 Mar 2005 00:13:42 -0000
@@ -33,6 +33,7 @@
 #include "opcode/mips.h"
 #include "itbl-ops.h"
 #include "dwarf2dbg.h"
+#include "dw2gencfi.h"
 
 #ifdef DEBUG
 #define DBG(x) printf x
@@ -14016,3 +14017,11 @@ mips_dwarf2_addr_size (void)
   else
     return 4;
 }
+
+/* Standard calling conventions leave the CFA at SP on entry.  */
+void
+mips_cfi_frame_initial_instructions (void)
+{
+  cfi_add_CFA_def_cfa_register (SP);
+}
+
Index: config/tc-mips.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.h,v
retrieving revision 1.38
diff -u -p -w -r1.38 tc-mips.h
--- config/tc-mips.h	9 Mar 2005 09:22:25 -0000	1.38
+++ config/tc-mips.h	15 Mar 2005 00:13:42 -0000
@@ -161,4 +161,12 @@ extern enum dwarf2_format mips_dwarf2_fo
 extern int mips_dwarf2_addr_size (void);
 #define DWARF2_ADDR_SIZE(bfd) mips_dwarf2_addr_size ()
 
+#define TARGET_USE_CFIPOP 1
+
+#define tc_cfi_frame_initial_instructions
mips_cfi_frame_initial_instructions
+extern void mips_cfi_frame_initial_instructions (void);
+
+#define DWARF2_DEFAULT_RETURN_COLUMN 31
+#define DWARF2_CIE_DATA_ALIGNMENT -4
+
 #endif /* TC_MIPS */

? gas/cfi/cfi-mips-1.d
? gas/cfi/cfi-mips-1.s
Index: gas/cfi/cfi-common-1.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/cfi/cfi-common-1.d,v
retrieving revision 1.3
diff -u -p -w -r1.3 cfi-common-1.d
--- gas/cfi/cfi-common-1.d	7 Mar 2004 08:51:21 -0000	1.3
+++ gas/cfi/cfi-common-1.d	15 Mar 2005 00:01:16 -0000
@@ -8,7 +8,7 @@ The section .eh_frame contains:
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     1b
+  Augmentation data:     [01]b
 
   DW_CFA_nop
   DW_CFA_nop
Index: gas/cfi/cfi-common-2.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/cfi/cfi-common-2.d,v
retrieving revision 1.4
diff -u -p -w -r1.4 cfi-common-2.d
--- gas/cfi/cfi-common-2.d	7 Mar 2004 23:02:02 -0000	1.4
+++ gas/cfi/cfi-common-2.d	15 Mar 2005 00:01:16 -0000
@@ -8,7 +8,7 @@ The section .eh_frame contains:
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     1b
+  Augmentation data:     [01]b
 #...
 00000014 000000[12][c0] 00000018 FDE cie=00000000 pc=.*
   DW_CFA_advance_loc: 4 to .*
Index: gas/cfi/cfi-common-3.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/cfi/cfi-common-3.d,v
retrieving revision 1.3
diff -u -p -w -r1.3 cfi-common-3.d
--- gas/cfi/cfi-common-3.d	7 Mar 2004 08:51:21 -0000	1.3
+++ gas/cfi/cfi-common-3.d	15 Mar 2005 00:01:16 -0000
@@ -8,7 +8,7 @@ The section .eh_frame contains:
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     1b
+  Augmentation data:     [01]b
 #...
 00000014 00000010 00000018 FDE cie=00000000 pc=.*
   DW_CFA_advance_loc: 4 to .*
Index: gas/cfi/cfi-common-4.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/cfi/cfi-common-4.d,v
retrieving revision 1.2
diff -u -p -w -r1.2 cfi-common-4.d
--- gas/cfi/cfi-common-4.d	8 Oct 2004 02:47:11 -0000	1.2
+++ gas/cfi/cfi-common-4.d	15 Mar 2005 00:01:16 -0000
@@ -8,7 +8,7 @@ The section .eh_frame contains:
   Code alignment factor: .*
   Data alignment factor: .*
   Return address column: .*
-  Augmentation data:     1b
+  Augmentation data:     [01]b
 #...
 00000014 00000010 00000018 FDE cie=00000000 pc=.*
   DW_CFA_remember_state
Index: gas/cfi/cfi.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/cfi/cfi.exp,v
retrieving revision 1.13
diff -u -p -w -r1.13 cfi.exp
--- gas/cfi/cfi.exp	25 Oct 2004 12:26:04 -0000	1.13
+++ gas/cfi/cfi.exp	15 Mar 2005 00:01:16 -0000
@@ -59,6 +59,8 @@ if [istarget "x86_64-*"] then {
 } elseif { [istarget "arm*-*"] || [istarget "xscale*-*"] } then {
     run_dump_test "cfi-arm-1"
 
+} elseif { [istarget "mips*-*"] } then {
+    run_dump_test "cfi-mips-1"
 } else {
     return
 }




More information about the Binutils mailing list