From: Jessica Han Date: Tue, 25 Jun 2002 16:55:47 +0000 (+0000) Subject: 2002-06-25 Jessica Han X-Git-Tag: releases/gcc-3.3.0~4106 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e20c0b56f39546c2e70864c23e9de0a40a44571;p=thirdparty%2Fgcc.git 2002-06-25 Jessica Han * 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5ef95d2d3231..4b7d01a2c8f3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2002-06-25 Jessica Han + + * 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 * 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 c8a6c9df8a78..0b28bb215d46 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 1eecdeb41a15..08379a980790 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 #include #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