This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Re: Does your .eh_frame_hdr change work with DW_EH_PE_absptr?


On Fri, Feb 15, 2002 at 04:39:16AM -0500, Jakub Jelinek wrote:
> On Thu, Feb 14, 2002 at 12:58:56PM -0800, H . J . Lu wrote:
> > 2002-02-14  H.J. Lu <hjl@gnu.org>
> > 
> > 	* config/mips/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): New.
> > 
> > --- gcc/config/mips/linux.h.eh	Fri Feb  8 17:33:04 2002
> > +++ gcc/config/mips/linux.h	Thu Feb 14 12:25:22 2002
> > @@ -283,6 +283,9 @@ void FN ()							\
> >     pseudo-ops.  */
> >  #define FUNCTION_NAME_ALREADY_DECLARED
> >  
> > +#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)       \
> > +  (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4)
> > +
> >  /* The glibc _mcount stub will save $v0 for us.  Don't mess with saving
> >     it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
> >     presence of $gp-relative calls.  */
> 
> Well, if MIPS supports PC relative relocs (R_MIPS_REL32?) using
> .4byte $LFB1 - .

Linux/mips does since R_MIPS_PC32 is a GNU extension for embedded PIC.
It seems to work fine.

> or some other assembly syntax, you should definitely go for
> #define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL)                      \
>   (flag_pic                                                             \
>     ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
>    : DW_EH_PE_absptr)
> 
> This is independent from need to fix ld.

This patch works fine for Linux/mips. I got no C++ EH regressions with
"make check" on gcc.


H.J.
---
2002-02-14  H.J. Lu <hjl@gnu.org>

	* config/mips/linux.h (ASM_PREFERRED_EH_DATA_FORMAT): New.

--- gcc/config/mips/linux.h.eh	Thu Feb 14 14:17:06 2002
+++ gcc/config/mips/linux.h	Fri Feb 15 12:12:23 2002
@@ -283,6 +283,11 @@ void FN ()							\
    pseudo-ops.  */
 #define FUNCTION_NAME_ALREADY_DECLARED
 
+#define ASM_PREFERRED_EH_DATA_FORMAT(CODE, GLOBAL)       		\
+  (flag_pic								\
+    ? ((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4\
+   : DW_EH_PE_absptr)
+
 /* The glibc _mcount stub will save $v0 for us.  Don't mess with saving
    it, since ASM_OUTPUT_REG_PUSH/ASM_OUTPUT_REG_POP do not work in the
    presence of $gp-relative calls.  */


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