[v3] correct facet_vec

Benjamin Kosnik bkoz@redhat.com
Fri Apr 25 02:50:00 GMT 2003


via Richard

As a bit of extra context: the problem is that src/globals.cc
defines facet_vec as follows:

  fake_facet_vec facet_vec[_GLIBCPP_NUM_FACETS];

but src/localename.cc declares it as:

  extern locale::facet** facet_vec;

So when compiling localename.cc, the mips compiler thinks that
facet_vec is a pointer-sized object, and therefore assumes it's
in the small data section.  This leads to truncated relocations.

tested x86/linux

gcc
gcc-3_3-branch

2003-04-24  Richard Sandiford  <rsandifo@redhat.com>

	* src/localename.cc (__gnu_cxx::facet_vec): Correct types.

Index: src/localename.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/localename.cc,v
retrieving revision 1.35
diff -c -p -r1.35 localename.cc
*** src/localename.cc	1 Feb 2003 16:37:20 -0000	1.35
--- src/localename.cc	25 Apr 2003 02:47:52 -0000
***************
*** 1,4 ****
! // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
  // Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
--- 1,4 ----
! // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
  // Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
*************** namespace __gnu_cxx
*** 35,41 ****
    using namespace std;
  
    // Defined in globals.cc.
!   extern locale::facet** facet_vec;
    extern char* facet_name[6 + _GLIBCPP_NUM_CATEGORIES];
  
    extern std::ctype<char>			ctype_c;
--- 35,41 ----
    using namespace std;
  
    // Defined in globals.cc.
!   extern locale::facet* facet_vec[_GLIBCPP_NUM_FACETS];
    extern char* facet_name[6 + _GLIBCPP_NUM_CATEGORIES];
  
    extern std::ctype<char>			ctype_c;



More information about the Gcc-patches mailing list