From ae81e0889b83cc280b91d2c8c627c89f02c4fcd3 Mon Sep 17 00:00:00 2001
From: sergei <gorelkin@nanoreflex.ru>
Date: Sat, 22 Feb 2014 19:26:25 +0000
Subject: [PATCH] * Updated internal declarations of RTTI structures to match
 their counterparts in typinfo unit and actual data generated by compiler. It
 went unnoticed this far because fields whose location differ with and without
 'packed' record attribute are not used by internal routines, and tests use
 declarations from typinfo unit (the declarations in question are not in
 interface, so tests cannot be done against them). This eliminates a lot of
 unaligned code on SPARC and ARM.

git-svn-id: trunk@26845 -
---
 rtl/inc/rtti.inc | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/rtl/inc/rtti.inc b/rtl/inc/rtti.inc
index f56fc2cfa8..14265fc6c9 100644
--- a/rtl/inc/rtti.inc
+++ b/rtl/inc/rtti.inc
@@ -18,7 +18,11 @@
 
 type
   PRecordElement=^TRecordElement;
-  TRecordElement=packed record
+  TRecordElement=
+{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
+  packed
+{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
+  record
     TypeInfo: Pointer;
     {$ifdef VER2_6}
     Offset: Longint;
@@ -28,14 +32,22 @@ type
   end;
 
   PRecordInfo=^TRecordInfo;
-  TRecordInfo=packed record
+  TRecordInfo=
+{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
+  packed
+{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
+  record
     Size: Longint;
     Count: Longint;
     { Elements: array[count] of TRecordElement }
   end;
 
   PArrayInfo=^TArrayInfo;
-  TArrayInfo=packed record
+  TArrayInfo=
+{$ifndef FPC_REQUIRES_PROPER_ALIGNMENT}
+  packed
+{$endif FPC_REQUIRES_PROPER_ALIGNMENT}
+  record
     Size: SizeInt;
     ElCount: SizeInt;
     ElInfo: Pointer;