diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-11 07:09:36 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-11 07:09:36 +0000 |
commit | 31eb8d98fed92dbfac3c3f990b5a0c5c99f5fffd (patch) | |
tree | cdd64cd7bca0a1f9bfb3360b37bc3c4b83167acc /libstdc++-v3 | |
parent | 355a3278b523d304bd52fb59dedbdc94518f3ae5 (diff) | |
download | ppe42-gcc-31eb8d98fed92dbfac3c3f990b5a0c5c99f5fffd.tar.gz ppe42-gcc-31eb8d98fed92dbfac3c3f990b5a0c5c99f5fffd.zip |
2002-10-10 Benjamin Kosnik <bkoz@redhat.com>
* config/linker-map.gnu (GLIBCPP_3.2.1): Add.
(GLIBCPP_3.2): Don't export locale::_S_*.
* src/ios.cc: Move globals into __gnu_cxx. Make old exported
symbols match.
* src/locale.cc: Same.
* src/localename.cc: Same.
* src/globals.cc: Same.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58042 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 10 | ||||
-rw-r--r-- | libstdc++-v3/config/linker-map.gnu | 28 | ||||
-rw-r--r-- | libstdc++-v3/src/globals.cc | 109 | ||||
-rw-r--r-- | libstdc++-v3/src/ios.cc | 26 | ||||
-rw-r--r-- | libstdc++-v3/src/locale.cc | 17 | ||||
-rw-r--r-- | libstdc++-v3/src/localename.cc | 9 |
6 files changed, 156 insertions, 43 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d3e936ae1df..3aa1a554a3f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2002-10-10 Benjamin Kosnik <bkoz@redhat.com> + + * config/linker-map.gnu (GLIBCPP_3.2.1): Add. + (GLIBCPP_3.2): Don't export locale::_S_*. + * src/ios.cc: Move globals into __gnu_cxx. Make old exported + symbols match. + * src/locale.cc: Same. + * src/localename.cc: Same. + * src/globals.cc: Same. + 2002-10-10 Phil Edwards <pme@gcc.gnu.org> * docs/html/21_strings/howto.html: Write #5, char_traits. diff --git a/libstdc++-v3/config/linker-map.gnu b/libstdc++-v3/config/linker-map.gnu index 368a20768bd..a43ab2cc0c5 100644 --- a/libstdc++-v3/config/linker-map.gnu +++ b/libstdc++-v3/config/linker-map.gnu @@ -20,7 +20,6 @@ ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA. - GLIBCPP_3.2 { global: @@ -29,7 +28,18 @@ GLIBCPP_3.2 { # All but the last are terminated with a semicolon. extern "C++" { - std::[A-Za-z]*; + std::[A-Za-k]*; + std::length_error*; + std::logic_error*; + std::locale::[A-Za-z]*; + std::locale::_Impl*; + std::locale::_S_classic; + std::locale::_S_global; + std::locale::_S_num_categories; + std::locale::facet*; + std::locale::id*; + std::locale::locale*; + std::[A-Zm-z]*; std::__throw_*; std::__basic_file*; std::__num_base*; @@ -43,6 +53,11 @@ GLIBCPP_3.2 { # Names not in an 'extern' block are mangled names. + _ZNSt6localeC1E*; + _ZNSt6locale11_M_coalesceERKS_S1_j; + _ZNSt6locale21_S_normalize_categoryEj; + _ZNSt6localeD*; + # std::has_facet* _ZSt9has_facet*; @@ -97,6 +112,15 @@ GLIBCPP_3.2 { *; }; +# Symbols added after GLIBCPP_3.2 +GLIBCPP_3.2.1 { + + _ZNSt7codecvtIcc11__mbstate_tEC1EP15__locale_structj; + _ZNSt7codecvtIcc11__mbstate_tEC2EP15__locale_structj; + _ZNSt7codecvtIwc11__mbstate_tEC1EP15__locale_structj; + _ZNSt7codecvtIwc11__mbstate_tEC2EP15__locale_structj; + +} GLIBCPP_3.2; # Symbols in the support library (libsupc++) have their own tag. CXXABI_1.2 { diff --git a/libstdc++-v3/src/globals.cc b/libstdc++-v3/src/globals.cc index 079fff8fdab..27f8be19891 100644 --- a/libstdc++-v3/src/globals.cc +++ b/libstdc++-v3/src/globals.cc @@ -44,20 +44,32 @@ // Because <iostream> declares the standard streams to be [io]stream // types instead of say [io]fstream types, it is also necessary to // allocate the actual file buffers in this file. -namespace std +namespace __gnu_cxx { - // Standard "C" locale. + using namespace std; + + // NB: The asm directives renames these non-exported, namespace + // __gnu_cxx symbols into the mistakenly exported, namespace std + // symbols in GLIBCPP_3.2. + // The rename syntax is + // asm (".symver currentname,oldname@@GLIBCPP_3.2") + // At the same time, these new __gnu_cxx symbols are not exported. + // In the future, GLIBCXX_ABI > 5 should remove all asm directives + // in this file. typedef char fake_locale[sizeof(locale)] __attribute__ ((aligned(__alignof__(locale)))); fake_locale c_locale; + asm (".symver _ZN9__gnu_cxx8c_localeE,_ZSt8c_locale@@GLIBCPP_3.2"); typedef char fake_locale_Impl[sizeof(locale::_Impl)] __attribute__ ((aligned(__alignof__(locale::_Impl)))); fake_locale_Impl c_locale_impl; - + asm (".symver _ZN9__gnu_cxx13c_locale_implE,\ + _ZSt13c_locale_impl@@GLIBCPP_3.2"); typedef char fake_facet_vec[sizeof(locale::facet*)] __attribute__ ((aligned(__alignof__(locale::facet*)))); fake_facet_vec facet_vec[_GLIBCPP_NUM_FACETS]; + asm (".symver _ZN9__gnu_cxx9facet_vecE,_ZSt9facet_vec@@GLIBCPP_3.2"); typedef char fake_facet_name[sizeof(char*)] __attribute__ ((aligned(__alignof__(char*)))); @@ -66,142 +78,161 @@ namespace std typedef char fake_ctype_c[sizeof(std::ctype<char>)] __attribute__ ((aligned(__alignof__(std::ctype<char>)))); fake_ctype_c ctype_c; + asm (".symver _ZN9__gnu_cxx7ctype_cE,_ZSt7ctype_c@@GLIBCPP_3.2"); typedef char fake_collate_c[sizeof(std::collate<char>)] __attribute__ ((aligned(__alignof__(std::collate<char>)))); fake_collate_c collate_c; + asm (".symver _ZN9__gnu_cxx9collate_cE,_ZSt9collate_c@@GLIBCPP_3.2"); typedef char fake_numpunct_c[sizeof(numpunct<char>)] __attribute__ ((aligned(__alignof__(numpunct<char>)))); fake_numpunct_c numpunct_c; + asm (".symver _ZN9__gnu_cxx10numpunct_cE,_ZSt10numpunct_c@@GLIBCPP_3.2"); typedef char fake_num_get_c[sizeof(num_get<char>)] __attribute__ ((aligned(__alignof__(num_get<char>)))); fake_num_get_c num_get_c; + asm (".symver _ZN9__gnu_cxx9num_get_cE,_ZSt9num_get_c@@GLIBCPP_3.2"); typedef char fake_num_put_c[sizeof(num_put<char>)] __attribute__ ((aligned(__alignof__(num_put<char>)))); fake_num_put_c num_put_c; + asm (".symver _ZN9__gnu_cxx9num_put_cE,_ZSt9num_put_c@@GLIBCPP_3.2"); typedef char fake_codecvt_c[sizeof(codecvt<char, char, mbstate_t>)] __attribute__ ((aligned(__alignof__(codecvt<char, char, mbstate_t>)))); fake_codecvt_c codecvt_c; + asm (".symver _ZN9__gnu_cxx9codecvt_cE,_ZSt9codecvt_c@@GLIBCPP_3.2"); typedef char fake_moneypunct_c[sizeof(moneypunct<char, true>)] __attribute__ ((aligned(__alignof__(moneypunct<char, true>)))); fake_moneypunct_c moneypunct_tc; fake_moneypunct_c moneypunct_fc; + asm (".symver _ZN9__gnu_cxx13moneypunct_tcE,\ + _ZSt13moneypunct_tc@@GLIBCPP_3.2"); + asm (".symver _ZN9__gnu_cxx13moneypunct_fcE,\ + _ZSt13moneypunct_fc@@GLIBCPP_3.2"); typedef char fake_money_get_c[sizeof(money_get<char>)] __attribute__ ((aligned(__alignof__(money_get<char>)))); fake_money_get_c money_get_c; + asm (".symver _ZN9__gnu_cxx11money_get_cE,_ZSt11money_get_c@@GLIBCPP_3.2"); typedef char fake_money_put_c[sizeof(money_put<char>)] __attribute__ ((aligned(__alignof__(money_put<char>)))); fake_money_put_c money_put_c; + asm (".symver _ZN9__gnu_cxx11money_put_cE,_ZSt11money_put_c@@GLIBCPP_3.2"); typedef char fake_timepunct_c[sizeof(__timepunct<char>)] __attribute__ ((aligned(__alignof__(__timepunct<char>)))); fake_timepunct_c timepunct_c; + asm (".symver _ZN9__gnu_cxx11timepunct_cE,_ZSt11timepunct_c@@GLIBCPP_3.2"); typedef char fake_time_get_c[sizeof(time_get<char>)] __attribute__ ((aligned(__alignof__(time_get<char>)))); fake_time_get_c time_get_c; + asm (".symver _ZN9__gnu_cxx10time_get_cE,_ZSt10time_get_c@@GLIBCPP_3.2"); typedef char fake_time_put_c[sizeof(time_put<char>)] __attribute__ ((aligned(__alignof__(time_put<char>)))); fake_time_put_c time_put_c; + asm (".symver _ZN9__gnu_cxx10time_put_cE,_ZSt10time_put_c@@GLIBCPP_3.2"); typedef char fake_messages_c[sizeof(messages<char>)] __attribute__ ((aligned(__alignof__(messages<char>)))); fake_messages_c messages_c; + asm (".symver _ZN9__gnu_cxx10messages_cE,_ZSt10messages_c@@GLIBCPP_3.2"); #ifdef _GLIBCPP_USE_WCHAR_T typedef char fake_wtype_w[sizeof(std::ctype<wchar_t>)] __attribute__ ((aligned(__alignof__(std::ctype<wchar_t>)))); fake_wtype_w ctype_w; + asm (".symver _ZN9__gnu_cxx7ctype_wE,_ZSt7ctype_w@@GLIBCPP_3.2"); typedef char fake_wollate_w[sizeof(std::collate<wchar_t>)] __attribute__ ((aligned(__alignof__(std::collate<wchar_t>)))); fake_wollate_w collate_w; + asm (".symver _ZN9__gnu_cxx9collate_wE,_ZSt9collate_w@@GLIBCPP_3.2"); typedef char fake_numpunct_w[sizeof(numpunct<wchar_t>)] __attribute__ ((aligned(__alignof__(numpunct<wchar_t>)))); fake_numpunct_w numpunct_w; + asm (".symver _ZN9__gnu_cxx10numpunct_wE,_ZSt10numpunct_w@@GLIBCPP_3.2"); typedef char fake_num_get_w[sizeof(num_get<wchar_t>)] __attribute__ ((aligned(__alignof__(num_get<wchar_t>)))); fake_num_get_w num_get_w; + asm (".symver _ZN9__gnu_cxx9num_get_wE,_ZSt9num_get_w@@GLIBCPP_3.2"); typedef char fake_num_put_w[sizeof(num_put<wchar_t>)] __attribute__ ((aligned(__alignof__(num_put<wchar_t>)))); fake_num_put_w num_put_w; + asm (".symver _ZN9__gnu_cxx9num_put_wE,_ZSt9num_put_w@@GLIBCPP_3.2"); typedef char fake_wodecvt_w[sizeof(codecvt<wchar_t, char, mbstate_t>)] __attribute__ ((aligned(__alignof__(codecvt<wchar_t, char, mbstate_t>)))); fake_wodecvt_w codecvt_w; + asm (".symver _ZN9__gnu_cxx9codecvt_wE,_ZSt9codecvt_w@@GLIBCPP_3.2"); typedef char fake_moneypunct_w[sizeof(moneypunct<wchar_t, true>)] __attribute__ ((aligned(__alignof__(moneypunct<wchar_t, true>)))); fake_moneypunct_w moneypunct_tw; fake_moneypunct_w moneypunct_fw; + asm (".symver _ZN9__gnu_cxx13moneypunct_twE,\ + _ZSt13moneypunct_tw@@GLIBCPP_3.2"); + asm (".symver _ZN9__gnu_cxx13moneypunct_fwE,\ + _ZSt13moneypunct_fw@@GLIBCPP_3.2"); typedef char fake_money_get_w[sizeof(money_get<wchar_t>)] __attribute__ ((aligned(__alignof__(money_get<wchar_t>)))); fake_money_get_w money_get_w; + asm (".symver _ZN9__gnu_cxx11money_get_wE,_ZSt11money_get_w@@GLIBCPP_3.2"); typedef char fake_money_put_w[sizeof(money_put<wchar_t>)] __attribute__ ((aligned(__alignof__(money_put<wchar_t>)))); fake_money_put_w money_put_w; + asm (".symver _ZN9__gnu_cxx11money_put_wE,_ZSt11money_put_w@@GLIBCPP_3.2"); typedef char fake_timepunct_w[sizeof(__timepunct<wchar_t>)] __attribute__ ((aligned(__alignof__(__timepunct<wchar_t>)))); fake_timepunct_w timepunct_w; + asm (".symver _ZN9__gnu_cxx11timepunct_wE,_ZSt11timepunct_w@@GLIBCPP_3.2"); typedef char fake_time_get_w[sizeof(time_get<wchar_t>)] __attribute__ ((aligned(__alignof__(time_get<wchar_t>)))); fake_time_get_w time_get_w; + asm (".symver _ZN9__gnu_cxx10time_get_wE,_ZSt10time_get_w@@GLIBCPP_3.2"); typedef char fake_time_put_w[sizeof(time_put<wchar_t>)] __attribute__ ((aligned(__alignof__(time_put<wchar_t>)))); fake_time_put_w time_put_w; + asm (".symver _ZN9__gnu_cxx10time_put_wE,_ZSt10time_put_w@@GLIBCPP_3.2"); typedef char fake_messages_w[sizeof(messages<wchar_t>)] __attribute__ ((aligned(__alignof__(messages<wchar_t>)))); fake_messages_w messages_w; + asm (".symver _ZN9__gnu_cxx10messages_wE,_ZSt10messages_w@@GLIBCPP_3.2"); #endif - // Standard stream objects. - typedef char fake_istream[sizeof(istream)] - __attribute__ ((aligned(__alignof__(istream)))); - typedef char fake_ostream[sizeof(ostream)] - __attribute__ ((aligned(__alignof__(ostream)))); - fake_istream cin; - fake_ostream cout; - fake_ostream cerr; - fake_ostream clog; - - typedef char fake_filebuf[sizeof(__gnu_cxx::stdio_filebuf<char>)] - __attribute__ ((aligned(__alignof__(__gnu_cxx::stdio_filebuf<char>)))); + typedef char fake_filebuf[sizeof(stdio_filebuf<char>)] + __attribute__ ((aligned(__alignof__(stdio_filebuf<char>)))); fake_filebuf buf_cout; fake_filebuf buf_cin; fake_filebuf buf_cerr; + asm (".symver _ZN9__gnu_cxx8buf_coutE,_ZSt8buf_cout@@GLIBCPP_3.2"); + asm (".symver _ZN9__gnu_cxx7buf_cinE,_ZSt7buf_cin@@GLIBCPP_3.2"); + asm (".symver _ZN9__gnu_cxx8buf_cerrE,_ZSt8buf_cerr@@GLIBCPP_3.2"); #ifdef _GLIBCPP_USE_WCHAR_T - typedef char fake_wistream[sizeof(wistream)] - __attribute__ ((aligned(__alignof__(wistream)))); - typedef char fake_wostream[sizeof(wostream)] - __attribute__ ((aligned(__alignof__(wostream)))); - fake_wistream wcin; - fake_wostream wcout; - fake_wostream wcerr; - fake_wostream wclog; - - typedef char fake_wfilebuf[sizeof(__gnu_cxx::stdio_filebuf<wchar_t>)] - __attribute__ ((aligned(__alignof__(__gnu_cxx::stdio_filebuf<wchar_t>)))); + typedef char fake_wfilebuf[sizeof(stdio_filebuf<wchar_t>)] + __attribute__ ((aligned(__alignof__(stdio_filebuf<wchar_t>)))); fake_wfilebuf buf_wcout; fake_wfilebuf buf_wcin; fake_wfilebuf buf_wcerr; + asm (".symver _ZN9__gnu_cxx9buf_wcoutE,_ZSt9buf_wcout@@GLIBCPP_3.2"); + asm (".symver _ZN9__gnu_cxx8buf_wcinE,_ZSt8buf_wcin@@GLIBCPP_3.2"); + asm (".symver _ZN9__gnu_cxx9buf_wcerrE,_ZSt9buf_wcerr@@GLIBCPP_3.2"); #endif // Globals for once-only runtime initialization of mutex objects. This @@ -226,4 +257,28 @@ namespace std _GLIBCPP_mutex_address_init () { __GTHREAD_MUTEX_INIT_FUNCTION (_GLIBCPP_mutex_address); } #endif -} +} // namespace __gnu_cxx + +namespace std +{ + // Standard stream objects. + typedef char fake_istream[sizeof(istream)] + __attribute__ ((aligned(__alignof__(istream)))); + typedef char fake_ostream[sizeof(ostream)] + __attribute__ ((aligned(__alignof__(ostream)))); + fake_istream cin; + fake_ostream cout; + fake_ostream cerr; + fake_ostream clog; + +#ifdef _GLIBCPP_USE_WCHAR_T + typedef char fake_wistream[sizeof(wistream)] + __attribute__ ((aligned(__alignof__(wistream)))); + typedef char fake_wostream[sizeof(wostream)] + __attribute__ ((aligned(__alignof__(wostream)))); + fake_wistream wcin; + fake_wostream wcout; + fake_wostream wcerr; + fake_wostream wclog; +#endif +} // namespace std diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc index c1167f8c15c..7bfdc5b4bb4 100644 --- a/libstdc++-v3/src/ios.cc +++ b/libstdc++-v3/src/ios.cc @@ -39,28 +39,34 @@ #include <bits/atomicity.h> #include <ext/stdio_filebuf.h> -namespace std +namespace __gnu_cxx { // Extern declarations for global objects in src/globals.cc. + extern stdio_filebuf<char> buf_cout; + extern stdio_filebuf<char> buf_cin; + extern stdio_filebuf<char> buf_cerr; + +#ifdef _GLIBCPP_USE_WCHAR_T + extern stdio_filebuf<wchar_t> buf_wcout; + extern stdio_filebuf<wchar_t> buf_wcin; + extern stdio_filebuf<wchar_t> buf_wcerr; +#endif +} // namespace __gnu_cxx + +namespace std +{ + using namespace __gnu_cxx; + extern istream cin; extern ostream cout; extern ostream cerr; extern ostream clog; - using __gnu_cxx::stdio_filebuf; - extern stdio_filebuf<char> buf_cout; - extern stdio_filebuf<char> buf_cin; - extern stdio_filebuf<char> buf_cerr; - #ifdef _GLIBCPP_USE_WCHAR_T extern wistream wcin; extern wostream wcout; extern wostream wcerr; extern wostream wclog; - - extern stdio_filebuf<wchar_t> buf_wcout; - extern stdio_filebuf<wchar_t> buf_wcin; - extern stdio_filebuf<wchar_t> buf_wcerr; #endif // Definitions for static const data members of __ios_flags. diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc index d9c69313491..f858a327cd1 100644 --- a/libstdc++-v3/src/locale.cc +++ b/libstdc++-v3/src/locale.cc @@ -34,11 +34,16 @@ #include <locale> #include <bits/atomicity.h> -namespace std +namespace __gnu_cxx { // Defined in globals.cc. - extern locale c_locale; - extern locale::_Impl c_locale_impl; + extern std::locale c_locale; + extern std::locale::_Impl c_locale_impl; +} // namespace __gnu_cxx + +namespace std +{ + using namespace __gnu_cxx; // Definitions for static const data members of locale. const locale::category locale::none; @@ -50,9 +55,15 @@ namespace std const locale::category locale::messages; const locale::category locale::all; + // In the future, GLIBCXX_ABI > 5 should remove all asm directives + // in this file, and remove exports of any static data members of locale. locale::_Impl* locale::_S_classic; + locale::_Impl* locale::_S_global; + const size_t locale::_S_categories_size; + asm (".symver _ZNSt6locale18_S_categories_sizeE,_ZNSt6locale17_S_num_categoriesE@@GLIBCPP_3.2"); + const size_t locale::_S_extra_categories_size; // Definitions for static const data members of locale::id diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc index a233eb3ec9d..0a2c5210215 100644 --- a/libstdc++-v3/src/localename.cc +++ b/libstdc++-v3/src/localename.cc @@ -30,8 +30,10 @@ #include <cstring> #include <locale> -namespace std +namespace __gnu_cxx { + using namespace std; + // Defined in globals.cc. extern locale::facet** facet_vec; extern char* facet_name[6 + _GLIBCPP_NUM_CATEGORIES]; @@ -66,6 +68,11 @@ namespace std extern time_put<wchar_t> time_put_w; extern std::messages<wchar_t> messages_w; #endif +} // namespace __gnu_cxx + +namespace std +{ + using namespace __gnu_cxx; locale::_Impl:: ~_Impl() throw() |