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]

S/390: Avoid relocations in .eh_frame section


Hello,

I've just noticed that our .eh_frame sections had a lot of
relocations applied; this was because we forgot to define
ASM_PREFERRED_EH_DATA_FORMAT :-/

Fixed by the following patch, which also adapts the explicit
.eh_frame data for the libffi assembly stub.

Bootstrapped/regtested on s390-ibm-linux and s390x-ibm-linux.


gcc/ChangeLog:
      * config/s390/s390.h (ASM_PREFERRED_EH_DATA_FORMAT): Define.

libffi/ChangeLog:
      * src/s390/sysv.S (.eh_frame section): Adapt to pcrel FDE encoding.


Index: gcc/config/s390/s390.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.h,v
retrieving revision 1.52
diff -c -p -r1.52 s390.h
*** gcc/config/s390/s390.h    4 Nov 2002 16:57:10 -0000     1.52
--- gcc/config/s390/s390.h    15 Nov 2002 14:17:28 -0000
*************** extern int current_function_outgoing_arg
*** 497,502 ****
--- 497,508 ----
    gen_rtx_MEM (Pmode, plus_constant (arg_pointer_rtx, \
                                       TARGET_64BIT? -48 : -40))

+ /* Select a format to encode pointers in exception handling data.  */
+ #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)
+

  /* Frame registers.  */

Index: libffi/src/s390/sysv.S
===================================================================
RCS file: /cvs/gcc/gcc/libffi/src/s390/sysv.S,v
retrieving revision 1.3
diff -c -p -r1.3 sysv.S
*** libffi/src/s390/sysv.S    30 Sep 2002 11:59:42 -0000    1.3
--- libffi/src/s390/sysv.S    15 Nov 2002 14:17:43 -0000
*************** ffi_closure_SYSV:
*** 152,161 ****
  .LSCIE1:
      .4byte      0x0   # CIE Identifier Tag
      .byte 0x1   # CIE Version
!     .ascii "\0" # CIE Augmentation
      .uleb128 0x1      # CIE Code Alignment Factor
      .sleb128 -4 # CIE Data Alignment Factor
      .byte 0xe   # CIE RA Column
      .byte 0xc   # DW_CFA_def_cfa
      .uleb128 0xf
      .uleb128 0x60
--- 152,163 ----
  .LSCIE1:
      .4byte      0x0   # CIE Identifier Tag
      .byte 0x1   # CIE Version
!     .ascii "zR\0"     # CIE Augmentation
      .uleb128 0x1      # CIE Code Alignment Factor
      .sleb128 -4 # CIE Data Alignment Factor
      .byte 0xe   # CIE RA Column
+     .uleb128 0x1      # Augmentation size
+     .byte 0x1b  # FDE Encoding (pcrel sdata4)
      .byte 0xc   # DW_CFA_def_cfa
      .uleb128 0xf
      .uleb128 0x60
*************** ffi_closure_SYSV:
*** 165,172 ****
      .4byte      .LEFDE1-.LASFDE1  # FDE Length
  .LASFDE1:
      .4byte      .LASFDE1-.Lframe1 # FDE CIE offset
!     .4byte      .LFB1 # FDE initial location
      .4byte      .LFE1-.LFB1 # FDE address range
      .byte 0x4   # DW_CFA_advance_loc4
      .4byte      .LCFI0-.LFB1
      .byte 0x8f  # DW_CFA_offset, column 0xf
--- 167,175 ----
      .4byte      .LEFDE1-.LASFDE1  # FDE Length
  .LASFDE1:
      .4byte      .LASFDE1-.Lframe1 # FDE CIE offset
!     .4byte      .LFB1-.     # FDE initial location
      .4byte      .LFE1-.LFB1 # FDE address range
+     .uleb128 0x0      # Augmentation size
      .byte 0x4   # DW_CFA_advance_loc4
      .4byte      .LCFI0-.LFB1
      .byte 0x8f  # DW_CFA_offset, column 0xf
*************** ffi_closure_SYSV:
*** 203,210 ****
      .4byte      .LEFDE2-.LASFDE2  # FDE Length
  .LASFDE2:
      .4byte      .LASFDE2-.Lframe1 # FDE CIE offset
!     .4byte      .LFB2 # FDE initial location
      .4byte      .LFE2-.LFB2 # FDE address range
      .byte 0x4   # DW_CFA_advance_loc4
      .4byte      .LCFI10-.LFB2
      .byte 0x8f  # DW_CFA_offset, column 0xf
--- 206,214 ----
      .4byte      .LEFDE2-.LASFDE2  # FDE Length
  .LASFDE2:
      .4byte      .LASFDE2-.Lframe1 # FDE CIE offset
!     .4byte      .LFB2-.     # FDE initial location
      .4byte      .LFE2-.LFB2 # FDE address range
+     .uleb128 0x0      # Augmentation size
      .byte 0x4   # DW_CFA_advance_loc4
      .4byte      .LCFI10-.LFB2
      .byte 0x8f  # DW_CFA_offset, column 0xf
*************** ffi_closure_SYSV:
*** 347,356 ****
  .LSCIE1:
      .4byte      0x0   # CIE Identifier Tag
      .byte 0x1   # CIE Version
!     .ascii "\0" # CIE Augmentation
      .uleb128 0x1      # CIE Code Alignment Factor
      .sleb128 -8 # CIE Data Alignment Factor
      .byte 0xe   # CIE RA Column
      .byte 0xc   # DW_CFA_def_cfa
      .uleb128 0xf
      .uleb128 0xa0
--- 351,362 ----
  .LSCIE1:
      .4byte      0x0   # CIE Identifier Tag
      .byte 0x1   # CIE Version
!     .ascii "zR\0"     # CIE Augmentation
      .uleb128 0x1      # CIE Code Alignment Factor
      .sleb128 -8 # CIE Data Alignment Factor
      .byte 0xe   # CIE RA Column
+     .uleb128 0x1      # Augmentation size
+     .byte 0x1b  # FDE Encoding (pcrel sdata4)
      .byte 0xc   # DW_CFA_def_cfa
      .uleb128 0xf
      .uleb128 0xa0
*************** ffi_closure_SYSV:
*** 360,367 ****
      .4byte      .LEFDE1-.LASFDE1  # FDE Length
  .LASFDE1:
      .4byte      .LASFDE1-.Lframe1 # FDE CIE offset
!     .8byte      .LFB1 # FDE initial location
!     .8byte      .LFE1-.LFB1 # FDE address range
      .byte 0x4   # DW_CFA_advance_loc4
      .4byte      .LCFI0-.LFB1
      .byte 0x8f  # DW_CFA_offset, column 0xf
--- 366,374 ----
      .4byte      .LEFDE1-.LASFDE1  # FDE Length
  .LASFDE1:
      .4byte      .LASFDE1-.Lframe1 # FDE CIE offset
!     .4byte      .LFB1-.     # FDE initial location
!     .4byte      .LFE1-.LFB1 # FDE address range
!     .uleb128 0x0      # Augmentation size
      .byte 0x4   # DW_CFA_advance_loc4
      .4byte      .LCFI0-.LFB1
      .byte 0x8f  # DW_CFA_offset, column 0xf
*************** ffi_closure_SYSV:
*** 398,405 ****
      .4byte      .LEFDE2-.LASFDE2  # FDE Length
  .LASFDE2:
      .4byte      .LASFDE2-.Lframe1 # FDE CIE offset
!     .8byte      .LFB2 # FDE initial location
!     .8byte      .LFE2-.LFB2 # FDE address range
      .byte 0x4   # DW_CFA_advance_loc4
      .4byte      .LCFI10-.LFB2
      .byte 0x8f  # DW_CFA_offset, column 0xf
--- 405,413 ----
      .4byte      .LEFDE2-.LASFDE2  # FDE Length
  .LASFDE2:
      .4byte      .LASFDE2-.Lframe1 # FDE CIE offset
!     .4byte      .LFB2-.     # FDE initial location
!     .4byte      .LFE2-.LFB2 # FDE address range
!     .uleb128 0x0      # Augmentation size
      .byte 0x4   # DW_CFA_advance_loc4
      .4byte      .LCFI10-.LFB2
      .byte 0x8f  # DW_CFA_offset, column 0xf

Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


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