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]

Re: fde alignment


Richard Henderson <rth@twiddle.net> writes:

> I've been noticing
>
> cleanup-10.exe(5439): unaligned trap at 0000000120005234: 00000200002344aa 28 16
> cleanup-10.exe(5439): unaligned trap at 00000001200020b8: 00000200002344aa 28 1
> cleanup-10.exe(5439): unaligned trap at 00000001200021e0: 000002000023440f 28 17
> cleanup-10.exe(5439): unaligned trap at 0000000120002298: 00000200002344a6 28 17
>
> Turns out that gcc does in fact expect the fde and cie headers to 
> be aligned.  Fixed like so.
>
>
> r~
>
>
>         * dw2gencfi.c (output_cie): Align length to 4 byte boundary.
>         (cfi_finish): Likewise for fde.
>
>         * gas/alpha/elf-reloc-8.d, gas/cfi/cfi-alpha-1.d,
>         gas/cfi/cfi-alpha-2.d, gas/cfi/cfi-alpha-3.d, gas/cfi/cfi-common-1.d,
>         gas/cfi/cfi-common-2.d, gas/cfi/cfi-common-3.d: Adjust offsets.

What about other platforms?  I expect those also need changes for the
testsuite...

On AMD64 I get:
Running /usr/src/packages/BUILD/binutils-2.15.90.0.1.1/gas/testsuite/gas/cfi/cfi
 ...
FAIL: CFI on x86-64

I'll commit the appended patch to fix this.  Can you look at other
platforms, please?

Andreas

2004-03-07  Andreas Jaeger  <aj@suse.de>

	* gas/cfi/cfi-x86_64.d: Adjust offsets.

============================================================
Index: gas/testsuite/gas/cfi/cfi-x86_64.d
--- gas/testsuite/gas/cfi/cfi-x86_64.d	18 Jun 2003 17:58:48 -0000	1.4
+++ gas/testsuite/gas/cfi/cfi-x86_64.d	7 Mar 2004 10:02:10 -0000
@@ -2,7 +2,7 @@
 #name: CFI on x86-64
 The section .eh_frame contains:
 
-00000000 00000012 00000000 CIE
+00000000 00000014 00000000 CIE
   Version:               1
   Augmentation:          "zR"
   Code alignment factor: 1
@@ -12,32 +12,40 @@ The section .eh_frame contains:
 
   DW_CFA_def_cfa: r7 ofs 8
   DW_CFA_offset: r16 at cfa-8
+  DW_CFA_nop
+  DW_CFA_nop
 
-00000016 00000014 0000001a FDE cie=00000000 pc=0000001e..00000032
-  DW_CFA_advance_loc: 7 to 00000025
+00000018 00000014 0000001c FDE cie=00000000 pc=00000020..00000034
+  DW_CFA_advance_loc: 7 to 00000027
   DW_CFA_def_cfa_offset: 4668
-  DW_CFA_advance_loc: 12 to 00000031
+  DW_CFA_advance_loc: 12 to 00000033
   DW_CFA_def_cfa_offset: 8
 
-0000002e 00000019 00000032 FDE cie=00000000 pc=00000036..00000045
-  DW_CFA_advance_loc: 1 to 00000037
+00000030 0000001c 00000034 FDE cie=00000000 pc=00000038..00000047
+  DW_CFA_advance_loc: 1 to 00000039
   DW_CFA_def_cfa_offset: 16
   DW_CFA_offset: r6 at cfa-16
-  DW_CFA_advance_loc: 3 to 0000003a
+  DW_CFA_advance_loc: 3 to 0000003c
   DW_CFA_def_cfa_reg: r6
-  DW_CFA_advance_loc: 10 to 00000044
+  DW_CFA_advance_loc: 10 to 00000046
   DW_CFA_def_cfa: r7 ofs 8
+  DW_CFA_nop
+  DW_CFA_nop
+  DW_CFA_nop
 
-0000004b 00000013 0000004f FDE cie=00000000 pc=00000053..00000066
-  DW_CFA_advance_loc: 3 to 00000056
+00000050 00000014 00000054 FDE cie=00000000 pc=00000058..0000006b
+  DW_CFA_advance_loc: 3 to 0000005b
   DW_CFA_def_cfa_reg: r12
-  DW_CFA_advance_loc: 15 to 00000065
+  DW_CFA_advance_loc: 15 to 0000006a
   DW_CFA_def_cfa_reg: r7
+  DW_CFA_nop
 
-00000062 0000000d 00000066 FDE cie=00000000 pc=0000006a..00000070
-
-00000073 00000011 00000077 FDE cie=00000000 pc=0000007b..0000008d
+00000068 00000010 0000006c FDE cie=00000000 pc=00000070..00000076
+  DW_CFA_nop
   DW_CFA_nop
+  DW_CFA_nop
+
+0000007c 00000010 00000080 FDE cie=00000000 pc=00000084..00000096
   DW_CFA_nop
   DW_CFA_nop
   DW_CFA_nop

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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