This is the mail archive of the gcc-patches@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: update dwarf2 asm unwind info [hppa64-*-* failures]


> Gcc is wrong.  Here's a patch to avoid doing the division twice.

I'll give it a try.  I had tried the simple fix to multiply by
DWARF_CIE_DATA_ALIGNMENT in the output for DW_CFA_def_cfa_offset_sf.
This fixed the the linux EH fails using CFI directives.

I'm now pondering what to do about hppa64-hpux.  I have the sense
that pc-relative relocations might work if .eh_frame is read-only.
I think the relocated value will then point to the correct place
for code in shared libraries.  Making .eh_frame read-only would
have to be forced.  I believe that we would need the same pc-relative
indirect trick as we currently use on linux to get the plabel out of
.eh_frame (see patch below).  This looks like the easiest approach
if it works.

The other alternative is to use SEGREL relocations.  It looks like
the assembler CFI directives can't support this.  We would also
need to define a way to indicate to the assembler that we want a
SEGREL relocation.  It looks like the symbol __text_seg provides
the text base, but it is a dynamic symbol.  crtstuff.c probably
would need some modification to pass the correct text and data bases.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

Index: dwarf2out.c
===================================================================
--- dwarf2out.c	(revision 139524)
+++ dwarf2out.c	(working copy)
@@ -145,12 +145,12 @@
     return false;
 
   /* Make sure the personality encoding is one the assembler can support.
-     In particular, aligned addresses can't be handled.  */
+     In particular, indirect and aligned addresses can't be handled.  */
   enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/2,/*global=*/1);
-  if ((enc & 0x70) != 0 && (enc & 0x70) != DW_EH_PE_pcrel)
+  if ((enc & 0xF0) != 0 && (enc & 0xF0) != DW_EH_PE_pcrel)
     return false;
   enc = ASM_PREFERRED_EH_DATA_FORMAT (/*code=*/0,/*global=*/0);
-  if ((enc & 0x70) != 0 && (enc & 0x70) != DW_EH_PE_pcrel)
+  if ((enc & 0xF0) != 0 && (enc & 0xF0) != DW_EH_PE_pcrel)
     return false;
 
   return true;


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