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]

RFC: mips dwarf2 unwind info


So, I went ahead and implemented it for mips, but since we don't have
DIFF_EXPR_OK and no way of doing pc relocs I had to change a couple of
testcases to allow for either value. I also noticed that in gcc we have
the debug offset slightly wrong. We have DWARF_CIE_DATA_ALIGNMENT as 4
there, not -4 even though our stack grows downward. I can't think of any
reason why I shouldn't check this in here, and correct it there, but I
thought asking for a bit of review and comment wouldn't hurt either.

I tested on mips-linux-gnu for gas and mips-elf for gcc and gas (along
with the gcc change), but no more. Before I went through the effort of
building an entire mips-linux build I thought I'd ask for comments here.

-eric

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

	* Makefile.am (tc-mips.c): Add dependencies.
	* 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.

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

	* gas/cfi/cfi-common-1.d: Allow 0 as Augmentation data.
	* gas/cfi/cfi-common-2.d: Ditto.
	* gas/cfi/cfi-common-3.d: Ditto.
	* gas/cfi/cfi-common-4.d: Ditto.

? gas/doc/as.info
Index: gas/Makefile.am
===================================================================
RCS file: /cvs/src/src/gas/Makefile.am,v
retrieving revision 1.101
diff -u -p -w -r1.101 Makefile.am
--- gas/Makefile.am	21 Feb 2005 11:49:27 -0000	1.101
+++ gas/Makefile.am	11 Mar 2005 01:58:28 -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: gas/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
--- gas/config/tc-mips.c	9 Mar 2005 11:56:15 -0000	1.303
+++ gas/config/tc-mips.c	11 Mar 2005 01:58:39 -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: gas/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
--- gas/config/tc-mips.h	9 Mar 2005 09:22:25 -0000	1.38
+++ gas/config/tc-mips.h	11 Mar 2005 01:58:39 -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 */
Index: gas/testsuite/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/testsuite/gas/cfi/cfi-common-1.d	7 Mar 2004 08:51:21 -0000	1.3
+++ gas/testsuite/gas/cfi/cfi-common-1.d	11 Mar 2005 01:58:39 -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/testsuite/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/testsuite/gas/cfi/cfi-common-2.d	7 Mar 2004 23:02:02 -0000	1.4
+++ gas/testsuite/gas/cfi/cfi-common-2.d	11 Mar 2005 01:58:39 -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/testsuite/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/testsuite/gas/cfi/cfi-common-3.d	7 Mar 2004 08:51:21 -0000	1.3
+++ gas/testsuite/gas/cfi/cfi-common-3.d	11 Mar 2005 01:58:39 -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/testsuite/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/testsuite/gas/cfi/cfi-common-4.d	8 Oct 2004 02:47:11 -0000	1.2
+++ gas/testsuite/gas/cfi/cfi-common-4.d	11 Mar 2005 01:58:39 -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/testsuite/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/testsuite/gas/cfi/cfi.exp	25 Oct 2004 12:26:04 -0000	1.13
+++ gas/testsuite/gas/cfi/cfi.exp	11 Mar 2005 01:58:39 -0000
@@ -59,6 +59,9 @@ if [istarget "x86_64-*"] then {
 } elseif { [istarget "arm*-*"] || [istarget "xscale*-*"] } then {
     run_dump_test "cfi-arm-1"
 
+} elseif { [istarget "mips*-*"] } then {
+# No target specific tests yet.
+
 } else {
     return
 }

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