This is the mail archive of the
mailing list for the GCC project.
[committed] Fix a lot of MIPS16 EH failures
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 24 Nov 2008 20:39:31 +0000
- Subject: [committed] Fix a lot of MIPS16 EH failures
The move to .cfi_* directives caused a lot of MIPS16 EH failures.
The problem is that we use constructs like:
naturally expecting that $LFBxxx would match the FDE start address.
This isn't true for MIPS16 functions: $LFBxxx is a MIPS16 label
but the internal .cfi_startproc label isn't.
Fixed with the patch below. Tested on mipsisa64-elfoabi and applied.
* config/mips/mips.h (ASM_OUTPUT_DEBUG_LABEL): Define.
--- gcc/config/mips/mips.h 2008-11-24 20:22:59.000000000 +0000
+++ gcc/config/mips/mips.h 2008-11-24 20:31:24.000000000 +0000
@@ -2845,6 +2845,32 @@ #define ASM_DECLARE_FUNCTION_NAME(STREAM
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long)(NUM))
+/* Print debug labels as "foo = ." rather than "foo:" because they should
+ represent a byte pointer rather than an ISA-encoded address. This is
+ particularly important for code like:
+ $LFBxxx = .
+ .section .gcc_except_table,...
+ .uleb128 foo-$LFBxxx
+ The .uleb128 requies $LFBxxx to match the FDE start address, which is
+ likewise a byte pointer rather than an ISA-encoded address.
+ At the time of writing, this hook is not used for the function end
+ .end foo
+ But this doesn't matter, because GAS doesn't treat a pre-.end label
+ as a MIPS16 one anyway. */
+#define ASM_OUTPUT_DEBUG_LABEL(FILE, PREFIX, NUM) \
+ fprintf (FILE, "%s%s%d = .\n", LOCAL_LABEL_PREFIX, PREFIX, NUM)
/* This is how to output an element of a case-vector that is absolute. */
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \