aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJessica Han <jessica@cup.hp.com>2002-06-25 16:55:47 +0000
committerBenjamin Kosnik <bkoz@gcc.gnu.org>2002-06-25 16:55:47 +0000
commit0e20c0b56f39546c2e70864c23e9de0a40a44571 (patch)
treea3a064a9a74419663a261de7625c4d59c4817a46
parent72ea9226fbaa39d730aac5a56bea1dab768b1611 (diff)
downloadgcc-0e20c0b56f39546c2e70864c23e9de0a40a44571.zip
gcc-0e20c0b56f39546c2e70864c23e9de0a40a44571.tar.gz
gcc-0e20c0b56f39546c2e70864c23e9de0a40a44571.tar.bz2
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. From-SVN: r54991
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/config/os/hpux/os_defines.h18
-rw-r--r--libstdc++-v3/libsupc++/tinfo.cc27
3 files changed, 42 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5ef95d2..4b7d01a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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.
diff --git a/libstdc++-v3/config/os/hpux/os_defines.h b/libstdc++-v3/config/os/hpux/os_defines.h
index c8a6c9d..0b28bb2 100644
--- a/libstdc++-v3/config/os/hpux/os_defines.h
+++ b/libstdc++-v3/config/os/hpux/os_defines.h
@@ -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
diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc
index 1eecdeb..08379a9 100644
--- a/libstdc++-v3/libsupc++/tinfo.cc
+++ b/libstdc++-v3/libsupc++/tinfo.cc
@@ -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>