]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2002-06-25 Jessica Han <jessica@cup.hp.com>
authorJessica Han <jessica@cup.hp.com>
Tue, 25 Jun 2002 16:55:47 +0000 (16:55 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Tue, 25 Jun 2002 16:55:47 +0000 (16:55 +0000)
* config/os/hpux/os_defines.h Define _GLIBCPP_VTABLE_PADDING
* libsupc++/tinfo.cc Handle the 8 byte aligned vtable entries when
_GLIBCPP_VTABLE_PADDING is defined.

From-SVN: r54991

libstdc++-v3/ChangeLog
libstdc++-v3/config/os/hpux/os_defines.h
libstdc++-v3/libsupc++/tinfo.cc

index 5ef95d2d3231a2dd0fda5a5d2b721e4cfb460571..4b7d01a2c8f3f3d0e0dfc11516f3c1089e099ee1 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-25  Jessica Han  <jessica@cup.hp.com>
+
+       * config/os/hpux/os_defines.h Define _GLIBCPP_VTABLE_PADDING
+       * libsupc++/tinfo.cc Handle the 8 byte aligned vtable entries when
+       _GLIBCPP_VTABLE_PADDING is defined.
+
 2002-06-25  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/bits/stl_alloc.h: Additional formatting.
index c8a6c9df8a78dcc20200393479cf521126368bfc..0b28bb215d46862299c1656ae52485b247563c0c 100644 (file)
@@ -1,6 +1,6 @@
-// Specific definitions for generic platforms  -*- C++ -*-
+// Specific definitions for HPUX  -*- C++ -*-
 
-// Copyright (C) 2000 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -28,7 +28,7 @@
 // the GNU General Public License.
 
 #ifndef _GLIBCPP_OS_DEFINES
-#define _GLIBCPP_OS_DEFINES
+#define _GLIBCPP_OS_DEFINES 1
 
 // System-specific #define, typedefs, corrections, etc, go here.  This
 // file will come before all others.
@@ -62,7 +62,8 @@
 
    We also force _GLIBCPP_USE_LONG_LONG here so that we don't have
    to bastardize configure to deal with this sillyness.  */
-namespace std {
+namespace std 
+{
 #ifndef __LP64__
   __extension__ extern "C" long long strtoll (const char *, char **, int)
     __asm  ("__strtoll");
@@ -75,5 +76,14 @@ namespace std {
     __asm  ("strtoul");
 #endif
 }
+
 #define _GLIBCPP_USE_LONG_LONG 1
+
+// HPUX on IA64 requires vtable to be 64 bit aligned even at 32 bit
+// mode.  We need to pad the vtable structure to achieve this.  
+#if !defined(_LP64) && defined (__ia64__)
+#define _GLIBCPP_VTABLE_PADDING 8
+typedef long int __padding_type;
+#endif
+
 #endif
index 1eecdeb41a15feab2437883c2e8df5703e6026ad..08379a980790989b2281e545e71d43bd79c09b15 100644 (file)
@@ -28,6 +28,7 @@
 // invalidate any other reasons why the executable file might be covered by
 // the GNU General Public License.
 
+#include <bits/c++config.h>
 #include <cstddef>
 #include "tinfo.h"
 #include "new"                 // for placement new
@@ -91,12 +92,28 @@ namespace {
 using namespace std;
 using namespace abi;
 
-// initial part of a vtable, this structure is used with offsetof, so we don't
+// Initial part of a vtable, this structure is used with offsetof, so we don't
 // have to keep alignments consistent manually.
-struct vtable_prefix {
-  ptrdiff_t whole_object;           // offset to most derived object
-  const __class_type_info *whole_type;  // pointer to most derived type_info
-  const void *origin;               // what a class's vptr points to
+struct vtable_prefix 
+{
+  // Offset to most derived object.
+  ptrdiff_t whole_object;
+
+  // Additional padding if necessary.
+#ifdef _GLIBCPP_VTABLE_PADDING
+  ptrdiff_t padding1;               
+#endif
+
+  // Pointer to most derived type_info.
+  const __class_type_info *whole_type;  
+
+  // Additional padding if necessary.
+#ifdef _GLIBCPP_VTABLE_PADDING
+  ptrdiff_t padding2;               
+#endif
+
+  // What a class's vptr points to.
+  const void *origin;               
 };
 
 template <typename T>