==> ChangeLog <==
authorEric Christopher <echristo@gmail.com>
Tue, 15 Mar 2005 05:28:17 +0000 (05:28 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 15 Mar 2005 05:28:17 +0000 (05:28 +0000)
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.

==> testsuite/ChangeLog <==
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.

13 files changed:
gas/ChangeLog
gas/Makefile.am
gas/Makefile.in
gas/config/tc-mips.c
gas/config/tc-mips.h
gas/testsuite/ChangeLog
gas/testsuite/gas/cfi/cfi-common-1.d
gas/testsuite/gas/cfi/cfi-common-2.d
gas/testsuite/gas/cfi/cfi-common-3.d
gas/testsuite/gas/cfi/cfi-common-4.d
gas/testsuite/gas/cfi/cfi-mips-1.d [new file with mode: 0644]
gas/testsuite/gas/cfi/cfi-mips-1.s [new file with mode: 0644]
gas/testsuite/gas/cfi/cfi.exp

index cbca7e43aa97910b2181f0d7567ee84e3792c8df..d98f5b031cdabf4d71e83853d116e87682bf36c6 100644 (file)
@@ -1,3 +1,14 @@
+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-15  Alan Modra  <amodra@bigpond.net.au>
 
        * po/es.po: Commit new Spanish translation.
index 450852ac750ddda5b94959549d9a267b1bed17ee..38676b8483926bfe30f7d1b076e5f70d34debb72 100644 (file)
@@ -1302,7 +1302,7 @@ DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(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 3b045810fba18b6a56362867815563d8665205d4..26623f730f378626e9516f11818ab109ecd2c1df 100644 (file)
@@ -1141,7 +1141,7 @@ DEPTC_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \
   $(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
 
index 655be764c67ff4894e48d4d91b6c2bbd55b26497..84f58e3e9d9b3e61968bda8f80f4a2466e3b28bb 100644 (file)
@@ -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 720f644fe38b079a4772a88b9e672b82114a5114..a5d5cf198478a1632843d8e4a39dc50ebe5976ae 100644 (file)
@@ -161,4 +161,12 @@ extern enum dwarf2_format mips_dwarf2_format (void);
 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 */
index 09706cfe982f5db2287c9f3d0e2cde46bc8b0fc4..4ea866d0280bb488f828619258970d217aa223b0 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2005-03-12  Zack Weinberg  <zack@codesourcery.com>
 
        * gas/arm/thumbv6k.d, gas/arm/thumbv6k.s: New dump test.
index 332c4774c0c582924882e492dfad6cdded1a71cb..9f5d9932a7d90b4640ac8fbe68b2b664ce5128ae 100644 (file)
@@ -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 a1f1d068541ae6bc19b59ab9ffb92e440a5d44c1..a54e542cbc3840e8233e46fc5eb73e0c7ff98552 100644 (file)
@@ -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 82a4193280ffddbb38ddda757ea3b1b7675b776f..70055aa0b8cb9171ef95796835d4293df396edbf 100644 (file)
@@ -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 c6bbae8200d6bcbd802ff6c743cbc1b9ae5827bc..9d6527023b4996d715cbff84db1a0189c20555e1 100644 (file)
@@ -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
diff --git a/gas/testsuite/gas/cfi/cfi-mips-1.d b/gas/testsuite/gas/cfi/cfi-mips-1.d
new file mode 100644 (file)
index 0000000..7a8d8e8
--- /dev/null
@@ -0,0 +1,27 @@
+#readelf: -wf
+#name: CFI on mips, 1
+The section .eh_frame contains:
+
+00000000 00000014 00000000 CIE
+  Version:               1
+  Augmentation:          "zR"
+  Code alignment factor: 1
+  Data alignment factor: -4
+  Return address column: 31
+  Augmentation data:     0b
+
+  DW_CFA_def_cfa_reg: r29
+  DW_CFA_def_cfa: r29 ofs 0
+  DW_CFA_nop
+  DW_CFA_nop
+
+00000018 0000001c 0000001c FDE cie=00000000 pc=00000000..0000002c
+  DW_CFA_advance_loc: 4 to 00000004
+  DW_CFA_def_cfa_offset: 8
+  DW_CFA_advance_loc: 4 to 00000008
+  DW_CFA_offset: r30 at cfa-8
+  DW_CFA_advance_loc: 4 to 0000000c
+  DW_CFA_def_cfa: r30 ofs 8
+  DW_CFA_advance_loc: 24 to 00000024
+  DW_CFA_def_cfa: r29 ofs 0
+  DW_CFA_nop
diff --git a/gas/testsuite/gas/cfi/cfi-mips-1.s b/gas/testsuite/gas/cfi/cfi-mips-1.s
new file mode 100644 (file)
index 0000000..cf7d5e2
--- /dev/null
@@ -0,0 +1,39 @@
+       .file   1 "foo.c"
+       .section .mdebug.abi64
+       .previous
+       .text
+       .align  2
+       .globl  foo
+       .ent    foo
+       .cfi_startproc
+foo:
+       .frame  $fp,8,$31               # vars= 8, regs= 1/0, args= 0, gp= 0
+       .mask   0x40000000,-8
+       .fmask  0x00000000,0
+       .set    noreorder
+       .set    nomacro
+
+       .cfi_def_cfa $sp, 0
+       addiu   $sp,$sp,-8
+       .cfi_adjust_cfa_offset 8
+       sw      $fp,0($sp)
+       .cfi_offset $30, -8
+       move    $fp,$sp
+       .cfi_def_cfa $fp, 8
+
+       nop
+       nop
+       nop
+       
+       move    $sp,$fp
+       lw      $fp,0($sp)
+       addiu   $sp,$sp,8
+       .cfi_def_cfa $sp, 0
+       j       $31
+       nop
+       .set    macro
+       .set    reorder
+       .end    foo
+       .cfi_endproc
+       .size   foo, .-foo
+       .ident  "GCC: (GNU) 4.0.0 20041226 (experimental)"
index 21483b14e1f54dfba441b93a4c4ebd16f05059e3..eeb5510982919708e3287fd23209b4c0a8edaae2 100644 (file)
@@ -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
 }