Patchwork [v3] libstdc++/36104 namespace versioning, revisited

login
register
mail settings
Submitter Benjamin Kosnik
Date Jan. 15, 2011, 12:29 a.m.
Message ID <20110114162953.60699a0c@shotwell>
Download mbox | patch
Permalink /patch/79021/
State New
Headers show

Comments

Benjamin Kosnik - Jan. 15, 2011, 12:29 a.m.
This patch makes --gnu-versioned-namespace work again, ie fixes
libstdc++/36104. Using this configure flag results in a libstdc++.so
binary that is incompatible with the current ABI, but potentially useful
in that all exported symbols are prefixed with a version _6, via
judicious use of inline namespaces.

This approach is first described here:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html

There are some QoI issues remaining. Since this patch is already quite
large I'll do them as follow ups. Known issues:

1) the exports file has not been updated!! Amazingly, it still works
after 3+ years of bitrot. I mean to do this, and look at typeinfo
exports and VTT exports in a more systematic way. 

Actually, it looks like some issues (quality tests fail) with hash
exports for debug mode. 

2) c++config.h, and combined modes (ie debug and parallel, versioned
and anything) are not super consistent at the moment. I'm hoping to make
this more clear, clean up the header file, and add docs.

3) some of the headers move around.
Now, libsupc++ header files that are not public are in nested
directory named bits and marked as private in a consistent manner as:
http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01498.html

It's my belief that all libstdc++ includes for 4.6.0 are in a consistent
state now. Check the install directory and let me know if anything
looks fishy.

4) what header files are installed when libstdc++ is configured as
hosted vs. freestanding does not change. Should it? This provides
infrastructure (ie a bits subdir for libsupc++ includes) such that it
may be possible to do this with more granularity (ie, correctly) in the
future. I'm surprised to see things like bits/atomic_word.h as header
deps for some libsupc++ includes. But I didn't want to try and solve
this problem today, and this patch makes no substantive changes in this
area.

5) docs for headerfile moves, namespace association to inline
namespaces are not finished.

It was fun to do this again (even with the all the strange build
hacking). This is a pretty elegant idea, and it's actually not that
hard to keep track of things this way.

tested x86_64/linux

-benjamin
H.J. Lu - Feb. 23, 2011, 10:18 p.m.
On Fri, Jan 14, 2011 at 4:29 PM, Benjamin Kosnik <bkoz@redhat.com> wrote:
>
> This patch makes --gnu-versioned-namespace work again, ie fixes
> libstdc++/36104. Using this configure flag results in a libstdc++.so
> binary that is incompatible with the current ABI, but potentially useful
> in that all exported symbols are prefixed with a version _6, via
> judicious use of inline namespaces.
>
> This approach is first described here:
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2013.html
>
> There are some QoI issues remaining. Since this patch is already quite
> large I'll do them as follow ups. Known issues:
>
> 1) the exports file has not been updated!! Amazingly, it still works
> after 3+ years of bitrot. I mean to do this, and look at typeinfo
> exports and VTT exports in a more systematic way.
>
> Actually, it looks like some issues (quality tests fail) with hash
> exports for debug mode.
>
> 2) c++config.h, and combined modes (ie debug and parallel, versioned
> and anything) are not super consistent at the moment. I'm hoping to make
> this more clear, clean up the header file, and add docs.
>
> 3) some of the headers move around.
> Now, libsupc++ header files that are not public are in nested
> directory named bits and marked as private in a consistent manner as:
> http://gcc.gnu.org/ml/gcc-patches/2010-12/msg01498.html
>
> It's my belief that all libstdc++ includes for 4.6.0 are in a consistent
> state now. Check the install directory and let me know if anything
> looks fishy.
>
> 4) what header files are installed when libstdc++ is configured as
> hosted vs. freestanding does not change. Should it? This provides
> infrastructure (ie a bits subdir for libsupc++ includes) such that it
> may be possible to do this with more granularity (ie, correctly) in the
> future. I'm surprised to see things like bits/atomic_word.h as header
> deps for some libsupc++ includes. But I didn't want to try and solve
> this problem today, and this patch makes no substantive changes in this
> area.
>
> 5) docs for headerfile moves, namespace association to inline
> namespaces are not finished.
>
> It was fun to do this again (even with the all the strange build
> hacking). This is a pretty elegant idea, and it's actually not that
> hard to keep track of things this way.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47865

Patch

2011-01-14  Benjamin Kosnik  <bkoz@redhat.com>

	* include/Makefile.am (bits_sup_headers, stamp-bits-sup): New.
	* include/Makefile.in: Regenerate.
	* libsupc++/Makefile.am (std_HEADERS, bits_HEADERS): New.
	(install-stdHEADERS, install-bitsHEADERS): New.
	* libsupc++/Makefile.in: Regenerate.

	* include/bits/c++config: Update for inline namespaces.
	* libsupc++/cxxabi-forced.h: To...
	* libsupc++/cxxabi_forced.h: ...this.
	* libsupc++/hash_bytes.h: Separate file.
	* libsupc++/typeinfo: Use it.
	* libsupc++/exception: Adjust for bits subdirectory.
	* libsupc++/eh_aux_runtime.cc: Same.
	* libsupc++/eh_ptr.cc: Same.
	* libsupc++/new_op.cc: Same.
	* libsupc++/exception_defines.h: Same.
	* libsupc++/nested_exception.h: Same.
	* libsupc++/eh_terminate.cc: Same.
	* libsupc++/vec.cc: Same.
	* libsupc++/vterminate.cc: Same.
	* libsupc++/exception_ptr.h: Same.
	* libsupc++/eh_personality.cc: Same.
	* libsupc++/eh_call.cc: Same.
	* libsupc++/new_opnt.cc: Same.
	* libsupc++/hash_bytes.cc: Same.
	* config/cpu/arm/cxxabi_tweaks.h: Same.
	* config/cpu/generic/cxxabi_tweaks.h: Same.
	* libsupc++/cxxabi.h: Same. Consolidate _GLIBCXX_NOTHROW defines.
	* include/std/bitset: Same.
	* include/ext/vstring.tcc: Same.
	* include/bits/hashtable.h: Same.
	* include/bits/functional_hash.h: Same.
	* include/bits/hashtable_policy.h: Same.
	* include/bits/basic_string.h: Same.
	* include/bits/istream.tcc: Same.
	* include/bits/ostream.tcc: Same.
	* include/bits/algorithmfwd.h: Same.
	* include/bits/basic_string.tcc: Same.
	* include/bits/ostream_insert.h: Same.
	* include/bits/fstream.tcc: Same.
	* include/bits/functexcept.h: Same.

	* doc/doxygen/user.cfg.in: Adjust names.

	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers.


Index: doc/doxygen/user.cfg.in
===================================================================
--- doc/doxygen/user.cfg.in	(revision 168826)
+++ doc/doxygen/user.cfg.in	(working copy)
@@ -586,7 +586,7 @@ 
 
 INPUT                  = @srcdir@/doc/doxygen/doxygroups.cc \
                          @srcdir@/libsupc++/cxxabi.h \
-                         @srcdir@/libsupc++/cxxabi-forced.h \
+                         @srcdir@/libsupc++/cxxabi_forced.h \
                          @srcdir@/libsupc++/exception \
                          @srcdir@/libsupc++/exception_defines.h \
                          @srcdir@/libsupc++/exception_ptr.h \
Index: include/std/bitset
===================================================================
--- include/std/bitset	(revision 168826)
+++ include/std/bitset	(working copy)
@@ -1,6 +1,7 @@ 
 // <bitset> -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+// 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -49,7 +50,7 @@ 
 #include <bits/functexcept.h>   // For invalid_argument, out_of_range,
                                 // overflow_error
 #include <iosfwd>
-#include <cxxabi-forced.h>
+#include <bits/cxxabi_forced.h>
 
 #define _GLIBCXX_BITSET_BITS_PER_WORD  (__CHAR_BIT__ * sizeof(unsigned long))
 #define _GLIBCXX_BITSET_WORDS(__n) \
Index: include/ext/vstring.tcc
===================================================================
--- include/ext/vstring.tcc	(revision 168826)
+++ include/ext/vstring.tcc	(working copy)
@@ -1,6 +1,6 @@ 
 // Versatile string -*- C++ -*-
 
-// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -33,7 +33,7 @@ 
 
 #pragma GCC system_header
 
-#include <cxxabi-forced.h>
+#include <bits/cxxabi_forced.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 
Index: include/bits/hashtable.h
===================================================================
--- include/bits/hashtable.h	(revision 168826)
+++ include/bits/hashtable.h	(working copy)
@@ -1,6 +1,6 @@ 
 // hashtable.h header -*- C++ -*-
 
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 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
@@ -35,39 +35,39 @@ 
 
 #include <bits/hashtable_policy.h>
 
-namespace std
-{
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
   // Class template _Hashtable, class definition.
-  
+
   // Meaning of class template _Hashtable's template parameters
-  
+
   // _Key and _Value: arbitrary CopyConstructible types.
-  
+
   // _Allocator: an allocator type ([lib.allocator.requirements]) whose
   // value type is Value.  As a conforming extension, we allow for
   // value type != Value.
 
   // _ExtractKey: function object that takes a object of type Value
   // and returns a value of type _Key.
-  
+
   // _Equal: function object that takes two objects of type k and returns
   // a bool-like value that is true if the two objects are considered equal.
-  
+
   // _H1: the hash function.  A unary function object with argument type
   // Key and result type size_t.  Return values should be distributed
   // over the entire range [0, numeric_limits<size_t>:::max()].
-  
+
   // _H2: the range-hashing function (in the terminology of Tavori and
   // Dreizin).  A binary function object whose argument types and result
   // type are all size_t.  Given arguments r and N, the return value is
   // in the range [0, N).
-  
+
   // _Hash: the ranged hash function (Tavori and Dreizin). A binary function
   // whose argument types are _Key and size_t and whose result type is
   // size_t.  Given arguments k and N, the return value is in the range
   // [0, N).  Default: hash(k, N) = h2(h1(k), N).  If _Hash is anything other
   // than the default, _H1 and _H2 are ignored.
-  
+
   // _RehashPolicy: Policy class with three members, all of which govern
   // the bucket count. _M_next_bkt(n) returns a bucket count no smaller
   // than n.  _M_bkt_for_elements(n) returns a bucket count appropriate
@@ -76,27 +76,27 @@ 
   // current element count is n_elt, we need to increase the bucket
   // count.  If so, returns make_pair(true, n), where n is the new
   // bucket count.  If not, returns make_pair(false, <anything>).
-  
+
   // ??? Right now it is hard-wired that the number of buckets never
   // shrinks.  Should we allow _RehashPolicy to change that?
-  
+
   // __cache_hash_code: bool.  true if we store the value of the hash
   // function along with the value.  This is a time-space tradeoff.
   // Storing it may improve lookup speed by reducing the number of times
   // we need to call the Equal function.
-  
+
   // __constant_iterators: bool.  true if iterator and const_iterator are
   // both constant iterator types.  This is true for unordered_set and
   // unordered_multiset, false for unordered_map and unordered_multimap.
-  
+
   // __unique_keys: bool.  true if the return value of _Hashtable::count(k)
   // is always at most one, false if it may be an arbitrary number.  This
   // true for unordered_set and unordered_map, false for unordered_multiset
   // and unordered_multimap.
-  
+
   template<typename _Key, typename _Value, typename _Allocator,
 	   typename _ExtractKey, typename _Equal,
-	   typename _H1, typename _H2, typename _Hash, 
+	   typename _H1, typename _H2, typename _Hash,
 	   typename _RehashPolicy,
 	   bool __cache_hash_code,
 	   bool __constant_iterators,
@@ -145,33 +145,33 @@ 
       typedef std::ptrdiff_t                              difference_type;
       typedef __detail::_Node_iterator<value_type, __constant_iterators,
 				       __cache_hash_code>
-                                                          local_iterator;
+							  local_iterator;
       typedef __detail::_Node_const_iterator<value_type,
 					     __constant_iterators,
 					     __cache_hash_code>
-                                                          const_local_iterator;
+							  const_local_iterator;
 
       typedef __detail::_Hashtable_iterator<value_type, __constant_iterators,
 					    __cache_hash_code>
-                                                          iterator;
+							  iterator;
       typedef __detail::_Hashtable_const_iterator<value_type,
 						  __constant_iterators,
 						  __cache_hash_code>
-                                                          const_iterator;
+							  const_iterator;
 
       template<typename _Key2, typename _Value2, typename _Ex2, bool __unique2,
 	       typename _Hashtable2>
-        friend struct __detail::_Map_base;
+	friend struct __detail::_Map_base;
 
     private:
       typedef __detail::_Hash_node<_Value, __cache_hash_code> _Node;
       typedef typename _Allocator::template rebind<_Node>::other
-                                                        _Node_allocator_type;
+							_Node_allocator_type;
       typedef typename _Allocator::template rebind<_Node*>::other
-                                                        _Bucket_allocator_type;
+							_Bucket_allocator_type;
 
       typedef typename _Allocator::template rebind<_Value>::other
-                                                        _Value_allocator_type;
+							_Value_allocator_type;
 
       _Node_allocator_type   _M_node_allocator;
       _Node**                _M_buckets;
@@ -181,39 +181,39 @@ 
       _RehashPolicy          _M_rehash_policy;
 
       template<typename... _Args>
-        _Node*
-        _M_allocate_node(_Args&&... __args);
-  
+	_Node*
+	_M_allocate_node(_Args&&... __args);
+
       void
       _M_deallocate_node(_Node* __n);
-  
+
       void
       _M_deallocate_nodes(_Node**, size_type);
 
       _Node**
       _M_allocate_buckets(size_type __n);
-  
+
       void
       _M_deallocate_buckets(_Node**, size_type __n);
 
-    public:			    
+    public:
       // Constructor, destructor, assignment, swap
       _Hashtable(size_type __bucket_hint,
 		 const _H1&, const _H2&, const _Hash&,
 		 const _Equal&, const _ExtractKey&,
 		 const allocator_type&);
-  
+
       template<typename _InputIterator>
-        _Hashtable(_InputIterator __first, _InputIterator __last,
+	_Hashtable(_InputIterator __first, _InputIterator __last,
 		   size_type __bucket_hint,
-		   const _H1&, const _H2&, const _Hash&, 
+		   const _H1&, const _H2&, const _Hash&,
 		   const _Equal&, const _ExtractKey&,
 		   const allocator_type&);
-  
+
       _Hashtable(const _Hashtable&);
 
       _Hashtable(_Hashtable&&);
-      
+
       _Hashtable&
       operator=(const _Hashtable& __ht)
       {
@@ -264,7 +264,7 @@ 
       size_type
       size() const
       { return _M_element_count; }
-  
+
       bool
       empty() const
       { return size() == 0; }
@@ -288,18 +288,18 @@ 
       size_type
       bucket_count() const
       { return _M_bucket_count; }
-  
+
       size_type
       max_bucket_count() const
       { return max_size(); }
-  
+
       size_type
       bucket_size(size_type __n) const
       { return std::distance(begin(__n), end(__n)); }
-  
+
       size_type
       bucket(const key_type& __k) const
-      { 
+      {
 	return this->_M_bucket_index(__k, this->_M_hash_code(__k),
 				     bucket_count());
       }
@@ -331,7 +331,7 @@ 
 
       float
       load_factor() const
-      { 
+      {
 	return static_cast<float>(size()) / static_cast<float>(bucket_count());
       }
 
@@ -342,8 +342,8 @@ 
       const _RehashPolicy&
       __rehash_policy() const
       { return _M_rehash_policy; }
-      
-      void 
+
+      void
       __rehash_policy(const _RehashPolicy&);
 
       // Lookup.
@@ -369,28 +369,28 @@ 
 		   typename _Hashtable::_Hash_code_type) const;
 
       template<typename _Arg>
-        iterator
-        _M_insert_bucket(_Arg&&, size_type,
+	iterator
+	_M_insert_bucket(_Arg&&, size_type,
 			 typename _Hashtable::_Hash_code_type);
 
       template<typename _Arg>
-        std::pair<iterator, bool>
-        _M_insert(_Arg&&, std::true_type);
+	std::pair<iterator, bool>
+	_M_insert(_Arg&&, std::true_type);
 
       template<typename _Arg>
-        iterator
-        _M_insert(_Arg&&, std::false_type);
+	iterator
+	_M_insert(_Arg&&, std::false_type);
 
       typedef typename std::conditional<__unique_keys,
 					std::pair<iterator, bool>,
 					iterator>::type
-        _Insert_Return_Type;
+	_Insert_Return_Type;
 
       typedef typename std::conditional<__unique_keys,
 					std::_Select1st<_Insert_Return_Type>,
 					std::_Identity<_Insert_Return_Type>
-                                   >::type
-        _Insert_Conv_Type;
+				   >::type
+	_Insert_Conv_Type;
 
     public:
       // Insert and erase
@@ -415,22 +415,22 @@ 
 	       std::enable_if<!__constant_iterators
 			      && std::is_convertible<_Pair,
 						     value_type>::value>::type>
-        _Insert_Return_Type
-        insert(_Pair&& __v)
-        { return _M_insert(std::forward<_Pair>(__v),
+	_Insert_Return_Type
+	insert(_Pair&& __v)
+	{ return _M_insert(std::forward<_Pair>(__v),
 			   std::integral_constant<bool, __unique_keys>()); }
 
       template<typename _Pair, typename = typename
 	       std::enable_if<!__constant_iterators
 			      && std::is_convertible<_Pair,
 						     value_type>::value>::type>
-        iterator
-        insert(const_iterator, _Pair&& __v)
-        { return _Insert_Conv_Type()(insert(std::forward<_Pair>(__v))); }
+	iterator
+	insert(const_iterator, _Pair&& __v)
+	{ return _Insert_Conv_Type()(insert(std::forward<_Pair>(__v))); }
 
       template<typename _InputIterator>
-        void
-        insert(_InputIterator __first, _InputIterator __last);
+	void
+	insert(_InputIterator __first, _InputIterator __last);
 
       void
       insert(initializer_list<value_type> __l)
@@ -461,7 +461,7 @@ 
 
 
   // Definitions of class template _Hashtable's out-of-line member functions.
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -487,7 +487,7 @@ 
 	  }
       }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -500,7 +500,7 @@ 
       _M_node_allocator.deallocate(__n, 1);
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -522,7 +522,7 @@ 
 	}
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -543,7 +543,7 @@ 
       return __p;
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -556,7 +556,7 @@ 
       __alloc.deallocate(__p, __n + 1);
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -581,7 +581,7 @@ 
       _M_begin_bucket_index = _M_bucket_count;
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -622,8 +622,8 @@ 
 	    __throw_exception_again;
 	  }
       }
-  
-  template<typename _Key, typename _Value, 
+
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -664,7 +664,7 @@ 
 	}
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -690,7 +690,7 @@ 
       __ht._M_rehash_policy = _RehashPolicy();
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -702,7 +702,7 @@ 
       _M_deallocate_buckets(_M_buckets, _M_bucket_count);
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -729,7 +729,7 @@ 
       std::swap(_M_element_count, __x._M_element_count);
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -744,7 +744,7 @@ 
 	_M_rehash(__n_bkt);
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -761,7 +761,7 @@ 
       return __p ? iterator(__p, _M_buckets + __n) : this->end();
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -778,7 +778,7 @@ 
       return __p ? const_iterator(__p, _M_buckets + __n) : this->end();
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -798,7 +798,7 @@ 
       return __result;
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -818,7 +818,7 @@ 
       std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
       _Node** __head = _M_buckets + __n;
       _Node* __p = _M_find_node(*__head, __k, __code);
-      
+
       if (__p)
 	{
 	  _Node* __p1 = __p->_M_next;
@@ -836,7 +836,7 @@ 
 	return std::make_pair(this->end(), this->end());
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -876,13 +876,13 @@ 
 
   // Find the node whose key compares equal to k, beginning the search
   // at p (usually the head of a bucket).  Return nil if no node is found.
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
     typename _Hashtable<_Key, _Value, _Allocator, _ExtractKey,
 			_Equal, _H1, _H2, _Hash, _RehashPolicy,
-			__chc, __cit, __uk>::_Node* 
+			__chc, __cit, __uk>::_Node*
     _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
 	       _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
     _M_find_node(_Node* __p, const key_type& __k,
@@ -895,7 +895,7 @@ 
     }
 
   // Insert v in bucket n (assumes no element with its key already present).
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -943,7 +943,7 @@ 
       }
 
   // Insert v if no element with its key is already present.
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -967,7 +967,7 @@ 
       }
 
   // Insert v unconditionally.
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -984,7 +984,7 @@ 
 					    _M_element_count, 1);
 	if (__do_rehash.first)
 	  _M_rehash(__do_rehash.second);
- 
+
 	const key_type& __k = this->_M_extract(__v);
 	typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
 	size_type __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
@@ -993,7 +993,7 @@ 
 	_Node* __prev = _M_find_node(_M_buckets[__n], __k, __code);
 	_Node* __new_node = _M_allocate_node(std::forward<_Arg>(__v));
 
-        if (__prev)
+	if (__prev)
 	  {
 	    __new_node->_M_next = __prev->_M_next;
 	    __prev->_M_next = __new_node;
@@ -1005,18 +1005,18 @@ 
 	    if (__n < _M_begin_bucket_index)
 	      _M_begin_bucket_index = __n;
 	  }
-        this->_M_store_code(__new_node, __code);
+	this->_M_store_code(__new_node, __code);
 
-        ++_M_element_count;
-        return iterator(__new_node, _M_buckets + __n);
+	++_M_element_count;
+	return iterator(__new_node, _M_buckets + __n);
       }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
     template<typename _InputIterator>
-      void 
+      void
       _Hashtable<_Key, _Value, _Allocator, _ExtractKey, _Equal,
 		 _H1, _H2, _Hash, _RehashPolicy, __chc, __cit, __uk>::
       insert(_InputIterator __first, _InputIterator __last)
@@ -1032,7 +1032,7 @@ 
 	  this->insert(*__first);
       }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -1073,7 +1073,7 @@ 
       return __result;
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -1087,7 +1087,7 @@ 
       typename _Hashtable::_Hash_code_type __code = this->_M_hash_code(__k);
       std::size_t __n = this->_M_bucket_index(__k, __code, _M_bucket_count);
       size_type __result = 0;
-      
+
       _Node** __slot = _M_buckets + __n;
       while (*__slot && !this->_M_compare(__k, __code, *__slot))
 	__slot = &((*__slot)->_M_next);
@@ -1101,8 +1101,8 @@ 
 	  if (std::__addressof(this->_M_extract((*__slot)->_M_v))
 	      != std::__addressof(__k))
 	    {
-              _Node* __p = *__slot;
-              *__slot = __p->_M_next;
+	      _Node* __p = *__slot;
+	      *__slot = __p->_M_next;
 	      _M_deallocate_node(__p);
 	      --_M_element_count;
 	      ++__result;
@@ -1143,7 +1143,7 @@ 
   // ??? This could be optimized by taking advantage of the bucket
   // structure, but it's not clear that it's worth doing.  It probably
   // wouldn't even be an optimization unless the load factor is large.
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -1159,7 +1159,7 @@ 
       return iterator(__last._M_cur_node, __last._M_cur_bucket);
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -1172,8 +1172,8 @@ 
       _M_element_count = 0;
       _M_begin_bucket_index = _M_bucket_count;
     }
- 
-  template<typename _Key, typename _Value, 
+
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -1187,7 +1187,7 @@ 
 							      + 1)));
     }
 
-  template<typename _Key, typename _Value, 
+  template<typename _Key, typename _Value,
 	   typename _Allocator, typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash, typename _RehashPolicy,
 	   bool __chc, bool __cit, bool __uk>
@@ -1228,6 +1228,7 @@ 
 	  __throw_exception_again;
 	}
     }
-}
 
+_GLIBCXX_END_NESTED_NAMESPACE // namespace std
+
 #endif // _HASHTABLE_H
Index: include/bits/functional_hash.h
===================================================================
--- include/bits/functional_hash.h	(revision 168826)
+++ include/bits/functional_hash.h	(working copy)
@@ -1,6 +1,6 @@ 
 // functional_hash.h header -*- C++ -*-
 
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 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
@@ -32,10 +32,10 @@ 
 
 #pragma GCC system_header
 
-#include <bits/c++config.h>
+#include <bits/hash_bytes.h>
 
-namespace std
-{
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
   /** @defgroup hashes Hashes
    *  @ingroup functors
    *
@@ -122,20 +122,6 @@ 
 
 #undef _Cxx_hashtable_define_trivial_hash
 
-  // Hash function implementation for the nontrivial specialization.
-  // All of them are based on a primitive that hashes a pointer to
-  // a byte array. The actual hash algorithm is not guaranteed to
-  // stay the same from release to release -- it may be updated or
-  // tuned to improve hash quality or speed.
-  size_t
-  _Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
-
-  // A similar hash primitive, using the FNV hash algorithm. This
-  // algorithm is guaranteed to stay the same from release to release.
-  // (although it might not produce the same values on different machines.)
-  size_t
-  _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed);
-
   struct _Hash_impl
   {
     static size_t
@@ -158,7 +144,7 @@ 
   {
     static size_t
     hash(const void* __ptr, size_t __clength,
-         size_t __seed = static_cast<size_t>(2166136261UL))
+	 size_t __seed = static_cast<size_t>(2166136261UL))
     { return _Fnv_hash_bytes(__ptr, __clength, __seed); }
 
     template<typename _Tp>
@@ -196,6 +182,7 @@ 
     hash<long double>::operator()(long double __val) const;
 
   // @} group hashes
-}
 
+_GLIBCXX_END_NAMESPACE
+
 #endif // _FUNCTIONAL_HASH_H
Index: include/bits/hashtable_policy.h
===================================================================
--- include/bits/hashtable_policy.h	(revision 168826)
+++ include/bits/hashtable_policy.h	(working copy)
@@ -1,6 +1,6 @@ 
 // Internal policy header for unordered_set and unordered_map -*- C++ -*-
 
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010, 2011 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
@@ -24,15 +24,15 @@ 
 
 /** @file bits/hashtable_policy.h
  *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. 
+ *  Do not attempt to use it directly.
  *  @headername{unordered_map,unordered_set}
  */
 
 #ifndef _HASHTABLE_POLICY_H
 #define _HASHTABLE_POLICY_H 1
 
-namespace std
-{
+_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
+
 namespace __detail
 {
   // Helper function: return distance(first, last) for forward
@@ -59,7 +59,7 @@ 
 
   // Auxiliary types used for all instantiations of _Hashtable: nodes
   // and iterators.
-  
+
   // Nodes, used to wrap elements stored in the hash table.  A policy
   // template parameter of class template _Hashtable controls whether
   // nodes also store a hash code. In some cases (e.g. strings) this
@@ -75,7 +75,7 @@ 
       _Hash_node*  _M_next;
 
       template<typename... _Args>
-        _Hash_node(_Args&&... __args)
+	_Hash_node(_Args&&... __args)
 	: _M_v(std::forward<_Args>(__args)...),
 	  _M_hash_code(), _M_next() { }
     };
@@ -87,7 +87,7 @@ 
       _Hash_node*  _M_next;
 
       template<typename... _Args>
-        _Hash_node(_Args&&... __args)
+	_Hash_node(_Args&&... __args)
 	: _M_v(std::forward<_Args>(__args)...),
 	  _M_next() { }
     };
@@ -99,7 +99,7 @@ 
     {
       _Node_iterator_base(_Hash_node<_Value, __cache>* __p)
       : _M_cur(__p) { }
-      
+
       void
       _M_incr()
       { _M_cur = _M_cur->_M_next; }
@@ -126,10 +126,10 @@ 
       typedef _Value                                   value_type;
       typedef typename std::conditional<__constant_iterators,
 					const _Value*, _Value*>::type
-                                                       pointer;
+						       pointer;
       typedef typename std::conditional<__constant_iterators,
 					const _Value&, _Value&>::type
-                                                       reference;
+						       reference;
       typedef std::ptrdiff_t                           difference_type;
       typedef std::forward_iterator_tag                iterator_category;
 
@@ -143,21 +143,21 @@ 
       reference
       operator*() const
       { return this->_M_cur->_M_v; }
-  
+
       pointer
       operator->() const
       { return std::__addressof(this->_M_cur->_M_v); }
 
       _Node_iterator&
       operator++()
-      { 
+      {
 	this->_M_incr();
-	return *this; 
+	return *this;
       }
-  
+
       _Node_iterator
       operator++(int)
-      { 
+      {
 	_Node_iterator __tmp(*this);
 	this->_M_incr();
 	return __tmp;
@@ -188,21 +188,21 @@ 
       reference
       operator*() const
       { return this->_M_cur->_M_v; }
-  
+
       pointer
       operator->() const
       { return std::__addressof(this->_M_cur->_M_v); }
 
       _Node_const_iterator&
       operator++()
-      { 
+      {
 	this->_M_incr();
-	return *this; 
+	return *this;
       }
-  
+
       _Node_const_iterator
       operator++(int)
-      { 
+      {
 	_Node_const_iterator __tmp(*this);
 	this->_M_incr();
 	return __tmp;
@@ -265,10 +265,10 @@ 
       typedef _Value                                   value_type;
       typedef typename std::conditional<__constant_iterators,
 					const _Value*, _Value*>::type
-                                                       pointer;
+						       pointer;
       typedef typename std::conditional<__constant_iterators,
 					const _Value&, _Value&>::type
-                                                       reference;
+						       reference;
       typedef std::ptrdiff_t                           difference_type;
       typedef std::forward_iterator_tag                iterator_category;
 
@@ -286,21 +286,21 @@ 
       reference
       operator*() const
       { return this->_M_cur_node->_M_v; }
-  
+
       pointer
       operator->() const
       { return std::__addressof(this->_M_cur_node->_M_v); }
 
       _Hashtable_iterator&
       operator++()
-      { 
+      {
 	this->_M_incr();
 	return *this;
       }
-  
+
       _Hashtable_iterator
       operator++(int)
-      { 
+      {
 	_Hashtable_iterator __tmp(*this);
 	this->_M_incr();
 	return __tmp;
@@ -336,21 +336,21 @@ 
       reference
       operator*() const
       { return this->_M_cur_node->_M_v; }
-  
+
       pointer
       operator->() const
       { return std::__addressof(this->_M_cur_node->_M_v); }
 
       _Hashtable_const_iterator&
       operator++()
-      { 
+      {
 	this->_M_incr();
 	return *this;
       }
-  
+
       _Hashtable_const_iterator
       operator++(int)
-      { 
+      {
 	_Hashtable_const_iterator __tmp(*this);
 	this->_M_incr();
 	return __tmp;
@@ -390,16 +390,16 @@ 
 
     float
     max_load_factor() const
-    { return _M_max_load_factor; }      
+    { return _M_max_load_factor; }
 
     // Return a bucket size no smaller than n.
     std::size_t
     _M_next_bkt(std::size_t __n) const;
-    
+
     // Return a bucket count appropriate for n elements
     std::size_t
     _M_bkt_for_elements(std::size_t __n) const;
-    
+
     // __n_bkt is current bucket count, __n_elt is current element count,
     // and __n_ins is number of elements to be inserted.  Do we need to
     // increase bucket count?  If so, return make_pair(true, n), where n
@@ -418,7 +418,7 @@ 
   extern const unsigned long __prime_list[];
 
   // XXX This is a hack.  There's no good reason for any of
-  // _Prime_rehash_policy's member functions to be inline.  
+  // _Prime_rehash_policy's member functions to be inline.
 
   // Return a prime no smaller than n.
   inline std::size_t
@@ -427,7 +427,7 @@ 
   {
     const unsigned long* __p = std::lower_bound(__prime_list, __prime_list
 						+ _S_n_primes, __n);
-    _M_next_resize = 
+    _M_next_resize =
       static_cast<std::size_t>(__builtin_ceil(*__p * _M_max_load_factor));
     return *__p;
   }
@@ -448,7 +448,7 @@ 
 
   // Finds the smallest prime p such that alpha p > __n_elt + __n_ins.
   // If p > __n_bkt, return make_pair(true, p); otherwise return
-  // make_pair(false, 0).  In principle this isn't very different from 
+  // make_pair(false, 0).  In principle this isn't very different from
   // _M_bkt_for_elements.
 
   // The only tricky part is that we're caching the element count at
@@ -474,7 +474,7 @@ 
 	      (__builtin_ceil(*__p * _M_max_load_factor));
 	    return std::make_pair(true, *__p);
 	  }
-	else 
+	else
 	  {
 	    _M_next_resize = static_cast<std::size_t>
 	      (__builtin_ceil(__n_bkt * _M_max_load_factor));
@@ -642,10 +642,10 @@ 
   //       we have a dummy type as placeholder.
   //   (2) Whether or not we cache hash codes.  Caching hash codes is
   //       meaningless if we have a ranged hash function.
-  // We also put the key extraction and equality comparison function 
+  // We also put the key extraction and equality comparison function
   // objects here, for convenience.
-  
-  // Primary template: unused except as a hook for specializations.  
+
+  // Primary template: unused except as a hook for specializations.
   template<typename _Key, typename _Value,
 	   typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash,
@@ -666,11 +666,11 @@ 
       : _M_extract(__ex), _M_eq(__eq), _M_ranged_hash(__h) { }
 
       typedef void* _Hash_code_type;
-  
+
       _Hash_code_type
       _M_hash_code(const _Key& __key) const
       { return 0; }
-  
+
       std::size_t
       _M_bucket_index(const _Key& __k, _Hash_code_type,
 		      std::size_t __n) const
@@ -680,7 +680,7 @@ 
       _M_bucket_index(const _Hash_node<_Value, false>* __p,
 		      std::size_t __n) const
       { return _M_ranged_hash(_M_extract(__p->_M_v), __n); }
-  
+
       bool
       _M_compare(const _Key& __k, _Hash_code_type,
 		 _Hash_node<_Value, false>* __n) const
@@ -694,7 +694,7 @@ 
       _M_copy_code(_Hash_node<_Value, false>*,
 		   const _Hash_node<_Value, false>*) const
       { }
-      
+
       void
       _M_swap(_Hash_code_base& __x)
       {
@@ -712,11 +712,11 @@ 
 
   // No specialization for ranged hash function while caching hash codes.
   // That combination is meaningless, and trying to do it is an error.
-  
-  
+
+
   // Specialization: ranged hash function, cache hash codes.  This
   // combination is meaningless, so we provide only a declaration
-  // and no definition.  
+  // and no definition.
   template<typename _Key, typename _Value,
 	   typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2, typename _Hash>
@@ -725,7 +725,7 @@ 
 
   // Specialization: hash function and range-hashing function, no
   // caching of hash codes.  H is provided but ignored.  Provides
-  // typedef and accessor required by TR1.  
+  // typedef and accessor required by TR1.
   template<typename _Key, typename _Value,
 	   typename _ExtractKey, typename _Equal,
 	   typename _H1, typename _H2>
@@ -749,7 +749,7 @@ 
       _Hash_code_type
       _M_hash_code(const _Key& __k) const
       { return _M_h1(__k); }
-      
+
       std::size_t
       _M_bucket_index(const _Key&, _Hash_code_type __c,
 		      std::size_t __n) const
@@ -790,7 +790,7 @@ 
       _H2          _M_h2;
     };
 
-  // Specialization: hash function and range-hashing function, 
+  // Specialization: hash function and range-hashing function,
   // caching hash codes.  H is provided but ignored.  Provides
   // typedef and accessor required by TR1.
   template<typename _Key, typename _Value,
@@ -800,7 +800,7 @@ 
 			   _Default_ranged_hash, true>
     {
       typedef _H1 hasher;
-      
+
       hasher
       hash_function() const
       { return _M_h1; }
@@ -812,11 +812,11 @@ 
       : _M_extract(__ex), _M_eq(__eq), _M_h1(__h1), _M_h2(__h2) { }
 
       typedef std::size_t _Hash_code_type;
-  
+
       _Hash_code_type
       _M_hash_code(const _Key& __k) const
       { return _M_h1(__k); }
-  
+
       std::size_t
       _M_bucket_index(const _Key&, _Hash_code_type __c,
 		      std::size_t __n) const
@@ -849,7 +849,7 @@ 
 	std::swap(_M_h1, __x._M_h1);
 	std::swap(_M_h2, __x._M_h2);
       }
-      
+
     protected:
       _ExtractKey  _M_extract;
       _Equal       _M_eq;
@@ -898,8 +898,8 @@ 
 
     private:
       template<typename _Uiterator>
-        static bool
-        _S_is_permutation(_Uiterator, _Uiterator, _Uiterator);
+	static bool
+	_S_is_permutation(_Uiterator, _Uiterator, _Uiterator);
     };
 
   // See std::is_permutation in N3068.
@@ -978,6 +978,7 @@ 
       return true;
     }
 } // namespace __detail
-}
 
+_GLIBCXX_END_NESTED_NAMESPACE // namespace std
+
 #endif // _HASHTABLE_POLICY_H
Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 168826)
+++ include/bits/basic_string.h	(working copy)
@@ -1,7 +1,7 @@ 
 // Components for manipulating sequences of characters -*- C++ -*-
 
 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010
+// 2006, 2007, 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
Index: include/bits/istream.tcc
===================================================================
--- include/bits/istream.tcc	(revision 168826)
+++ include/bits/istream.tcc	(working copy)
@@ -1,7 +1,7 @@ 
 // istream classes -*- C++ -*-
 
 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010
+// 2006, 2007, 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -38,7 +38,7 @@ 
 
 #pragma GCC system_header
 
-#include <cxxabi-forced.h>
+#include <bits/cxxabi_forced.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
Index: include/bits/ostream.tcc
===================================================================
--- include/bits/ostream.tcc	(revision 168826)
+++ include/bits/ostream.tcc	(working copy)
@@ -1,7 +1,7 @@ 
 // ostream classes -*- C++ -*-
 
 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010
+// 2006, 2007, 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -38,7 +38,7 @@ 
 
 #pragma GCC system_header
 
-#include <cxxabi-forced.h>
+#include <bits/cxxabi_forced.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
Index: include/bits/c++config
===================================================================
--- include/bits/c++config	(revision 168826)
+++ include/bits/c++config	(working copy)
@@ -1,7 +1,7 @@ 
 // Predefined symbols and macros -*- C++ -*-
 
 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// 2006, 2007, 2008, 2009, 2010, 2011 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
@@ -32,7 +32,7 @@ 
 #define _GLIBCXX_CXX_CONFIG_H 1
 
 // The current version of the C++ library in compressed ISO date format.
-#define __GLIBCXX__ 
+#define __GLIBCXX__
 
 // Macros for various attributes.
 #ifndef _GLIBCXX_PURE
@@ -49,7 +49,7 @@ 
 
 #ifndef _GLIBCXX_NOTHROW
 # ifdef __cplusplus
-#  define _GLIBCXX_NOTHROW throw() 
+#  define _GLIBCXX_NOTHROW throw()
 # else
 #  define _GLIBCXX_NOTHROW __attribute__((__nothrow__))
 # endif
@@ -87,7 +87,7 @@ 
 {
   typedef __SIZE_TYPE__ 	size_t;
   typedef __PTRDIFF_TYPE__	ptrdiff_t;
-  
+
 #ifdef __GXX_EXPERIMENTAL_CXX0X__
   typedef decltype(nullptr)	nullptr_t;
 #endif
@@ -103,23 +103,19 @@ 
 #ifndef _GLIBCXX_CONSTEXPR
 # ifdef __GXX_EXPERIMENTAL_CXX0X__
 #  define _GLIBCXX_CONSTEXPR constexpr
-# else
-#  define _GLIBCXX_CONSTEXPR 
-# endif
-#endif
-
-#ifndef _GLIBCXX_USE_CONSTEXPR
-# ifdef __GXX_EXPERIMENTAL_CXX0X__
 #  define _GLIBCXX_USE_CONSTEXPR constexpr
 # else
+#  define _GLIBCXX_CONSTEXPR
 #  define _GLIBCXX_USE_CONSTEXPR const
 # endif
 #endif
 
-// Macros for activating various namespace association modes.
-// _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
-// _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
-// _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+// Macros for activating various inline namespaces.
+//
+// _GLIBCXX_NAMESPACE_DEBUG
+// _GLIBCXX_NAMESPACE_PARALLEL
+// _GLIBCXX_NAMESPACE_PROFILE
+// _GLIBCXX_NAMESPACE_VERSION
 
 // Guide to libstdc++ namespaces.
 /*
@@ -127,6 +123,7 @@ 
   {
     namespace __debug { }
     namespace __parallel { }
+    namespace __profile { }
     namespace __norm { } // __normative, __shadow, __replaced
     namespace __cxx1998 { }
 
@@ -135,26 +132,26 @@ 
 */
 
 #ifdef _GLIBCXX_DEBUG
-# define _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG 1
+# define _GLIBCXX_INLINE_DEBUG 1
 #endif
 
 #ifdef _GLIBCXX_PARALLEL
-# define _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL 1
+# define _GLIBCXX_INLINE_PARALLEL 1
 #endif
 
-// Namespace association for profile
+// Namespace association for profile.
 #ifdef _GLIBCXX_PROFILE
-# define _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE 1
+# define _GLIBCXX_INLINE_PROFILE 1
 #endif
 
-#define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION 
+#define _GLIBCXX_INLINE_VERSION
 
-// Defined if any namespace association modes are active.
-#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG \
-  || _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL \
-  || _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE \
-  || _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
-# define _GLIBCXX_USE_NAMESPACE_ASSOCIATION 1
+// Defined if inline namespaces modes are active.
+#if _GLIBCXX_INLINE_DEBUG \
+  || _GLIBCXX_INLINE_PARALLEL \
+  || _GLIBCXX_INLINE_PROFILE \
+  || _GLIBCXX_INLINE_VERSION
+# define _GLIBCXX_USE_INLINE_NAMESPACES 1
 #endif
 
 // Macros for namespace scope. Either namespace std:: or the name
@@ -169,7 +166,7 @@ 
 // _GLIBCXX_END_NAMESPACE
 // _GLIBCXX_BEGIN_NESTED_NAMESPACE
 // _GLIBCXX_END_NESTED_NAMESPACE
-#ifndef _GLIBCXX_USE_NAMESPACE_ASSOCIATION
+#ifndef _GLIBCXX_USE_INLINE_NAMESPACES
 # define _GLIBCXX_STD_D _GLIBCXX_STD
 # define _GLIBCXX_STD_P _GLIBCXX_STD
 # define _GLIBCXX_STD_PR _GLIBCXX_STD
@@ -180,7 +177,7 @@ 
 # define _GLIBCXX_END_NAMESPACE }
 #else
 
-# if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION // && not anything else
+# if _GLIBCXX_INLINE_VERSION // && not anything else
 #  define _GLIBCXX_STD_D _GLIBCXX_STD
 #  define _GLIBCXX_STD_P _GLIBCXX_STD
 #  define _GLIBCXX_STD _6
@@ -189,37 +186,37 @@ 
 # endif
 
 //  debug
-# if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE
+# if _GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PARALLEL && !_GLIBCXX_INLINE_PROFILE
 #  define _GLIBCXX_STD_D __norm
 #  define _GLIBCXX_STD_P _GLIBCXX_STD
 #  define _GLIBCXX_STD __cxx1998
-#  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { 
+#  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
 #  define _GLIBCXX_END_NAMESPACE }
 #  define _GLIBCXX_EXTERN_TEMPLATE -1
 # endif
 
 // parallel
-# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && !_GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE
+# if _GLIBCXX_INLINE_PARALLEL && !_GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PROFILE
 #  define _GLIBCXX_STD_D _GLIBCXX_STD
 #  define _GLIBCXX_STD_P __norm
 #  define _GLIBCXX_STD __cxx1998
-#  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { 
+#  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
 #  define _GLIBCXX_END_NAMESPACE }
 # endif
 
 // debug + parallel
-# if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL && _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG  && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE
+# if _GLIBCXX_INLINE_PARALLEL && _GLIBCXX_INLINE_DEBUG  && !_GLIBCXX_INLINE_PROFILE
 #  define _GLIBCXX_STD_D __norm
 #  define _GLIBCXX_STD_P __norm
 #  define _GLIBCXX_STD __cxx1998
-#  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { 
+#  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
 #  define _GLIBCXX_END_NAMESPACE }
 #  define _GLIBCXX_EXTERN_TEMPLATE -1
 # endif
 
 // profile
-# if _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE
-#  if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL || _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG
+# if _GLIBCXX_INLINE_PROFILE
+#  if _GLIBCXX_INLINE_PARALLEL || _GLIBCXX_INLINE_DEBUG
 #   error Cannot use -D_GLIBCXX_PROFILE with -D_GLIBCXX_DEBUG or \
     -D_GLIBCXX_PARALLEL
 #  endif
@@ -227,12 +224,12 @@ 
 #  define _GLIBCXX_STD_P _GLIBCXX_STD
 #  define _GLIBCXX_STD_PR __norm
 #  define _GLIBCXX_STD __cxx1998
-#  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) { 
+#  define _GLIBCXX_BEGIN_NAMESPACE(X) namespace X _GLIBCXX_VISIBILITY_ATTR(default) {
 #  define _GLIBCXX_END_NAMESPACE }
 # endif
 
 # if __NO_INLINE__ && !__GXX_WEAK__
-#  warning currently using namespace associated mode which may fail \
+#  warning currently using inlined namespace mode which may fail \
    without inlining due to lack of weak symbols
 # endif
 
@@ -240,52 +237,52 @@ 
 # define _GLIBCXX_END_NESTED_NAMESPACE } }
 #endif
 
-// Namespace associations for debug mode.
-#if _GLIBCXX_NAMESPACE_ASSOCIATION_DEBUG && !_GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE
+// Inline namespaces for debug mode.
+#if _GLIBCXX_INLINE_DEBUG && !_GLIBCXX_INLINE_PROFILE
 namespace std
-{ 
-  namespace __norm { } 
+{
+  namespace __norm { }
   inline namespace __debug { }
   inline namespace __cxx1998 { }
 }
 #endif
 
-// Namespace associations for parallel mode.
-#if _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+// Inline namespaces for parallel mode.
+#if _GLIBCXX_INLINE_PARALLEL
 namespace std
-{ 
-  namespace __norm { } 
+{
+  namespace __norm { }
   inline namespace __parallel { }
   inline namespace __cxx1998 { }
 }
 #endif
 
-// Namespace associations for profile mode
-#if _GLIBCXX_NAMESPACE_ASSOCIATION_PROFILE
+// Inline namespaces for profile mode
+#if _GLIBCXX_INLINE_PROFILE
 namespace std
-{ 
-  namespace __norm { } 
+{
+  namespace __norm { }
   inline namespace __profile { }
   inline namespace __cxx1998 { }
 }
 #endif
 
-// Namespace associations for versioning mode.
-#if _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION
+// Inline namespaces for versioning mode.
+#if _GLIBCXX_INLINE_VERSION
 namespace std
 {
   inline namespace _6 { }
 }
 
-namespace __gnu_cxx 
-{ 
+namespace __gnu_cxx
+{
   inline namespace _6 { }
 }
 
 namespace std
 {
-  namespace tr1 
-  { 
+  namespace tr1
+  {
     inline namespace _6 { }
   }
 }
@@ -295,8 +292,8 @@ 
 // Define if compatibility should be provided for -mlong-double-64
 #undef _GLIBCXX_LONG_DOUBLE_COMPAT
 
-// Namespace associations for long double 128 mode.
-#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__ 
+// Inline namespaces for long double 128 mode.
+#if defined _GLIBCXX_LONG_DOUBLE_COMPAT && defined __LONG_DOUBLE_128__
 namespace std
 {
   inline namespace __gnu_cxx_ldbl128 { }
@@ -341,11 +338,11 @@ 
 
 #else // !__cplusplus
 # define _GLIBCXX_BEGIN_EXTERN_C
-# define _GLIBCXX_END_EXTERN_C 
+# define _GLIBCXX_END_EXTERN_C
 # undef _GLIBCXX_BEGIN_NAMESPACE
 # undef _GLIBCXX_END_NAMESPACE
-# define _GLIBCXX_BEGIN_NAMESPACE(X) 
-# define _GLIBCXX_END_NAMESPACE 
+# define _GLIBCXX_BEGIN_NAMESPACE(X)
+# define _GLIBCXX_END_NAMESPACE
 #endif
 
 // First includes.
@@ -397,7 +394,7 @@ 
   // Avoid the use of assert, because we're trying to keep the <cassert>
   // include out of the mix.
   inline void
-  __replacement_assert(const char* __file, int __line, 
+  __replacement_assert(const char* __file, int __line,
 		       const char* __function, const char* __condition)
   {
     __builtin_printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
@@ -406,8 +403,8 @@ 
   }
 _GLIBCXX_END_NAMESPACE
 
-#define __glibcxx_assert(_Condition)                               	\
-  do 								        \
+#define __glibcxx_assert(_Condition)				   	\
+  do 									\
   {							      		\
     if (! (_Condition))                                                 \
       std::__replacement_assert(__FILE__, __LINE__, 			\
Index: include/bits/algorithmfwd.h
===================================================================
--- include/bits/algorithmfwd.h	(revision 168826)
+++ include/bits/algorithmfwd.h	(working copy)
@@ -804,7 +804,7 @@ 
 
 _GLIBCXX_END_NESTED_NAMESPACE
 
-#ifdef _GLIBCXX_NAMESPACE_ASSOCIATION_PARALLEL
+#ifdef _GLIBCXX_PARALLEL
 # include <parallel/algorithmfwd.h>
 #endif
 
Index: include/bits/basic_string.tcc
===================================================================
--- include/bits/basic_string.tcc	(revision 168826)
+++ include/bits/basic_string.tcc	(working copy)
@@ -1,7 +1,7 @@ 
 // Components for manipulating sequences of characters -*- C++ -*-
 
 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010
+// 2006, 2007, 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -41,7 +41,7 @@ 
 
 #pragma GCC system_header
 
-#include <cxxabi-forced.h>
+#include <bits/cxxabi_forced.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
Index: include/bits/ostream_insert.h
===================================================================
--- include/bits/ostream_insert.h	(revision 168826)
+++ include/bits/ostream_insert.h	(working copy)
@@ -1,6 +1,6 @@ 
 // Helpers for ostream inserters -*- C++ -*-
 
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 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
@@ -33,7 +33,7 @@ 
 #pragma GCC system_header
 
 #include <iosfwd>
-#include <cxxabi-forced.h>
+#include <bits/cxxabi_forced.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
Index: include/bits/fstream.tcc
===================================================================
--- include/bits/fstream.tcc	(revision 168826)
+++ include/bits/fstream.tcc	(working copy)
@@ -1,7 +1,7 @@ 
 // File based streams -*- C++ -*-
 
 // Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-// 2007, 2008, 2009, 2010
+// 2007, 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -38,7 +38,7 @@ 
 
 #pragma GCC system_header
 
-#include <cxxabi-forced.h>
+#include <bits/cxxabi_forced.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
Index: include/bits/functexcept.h
===================================================================
--- include/bits/functexcept.h	(revision 168826)
+++ include/bits/functexcept.h	(working copy)
@@ -1,6 +1,6 @@ 
 // Function-Based Exception Support -*- C++ -*-
 
-// Copyright (C) 2001, 2004, 2005, 2008, 2009, 2010
+// Copyright (C) 2001, 2004, 2005, 2008, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -38,7 +38,7 @@ 
 #define _FUNCTEXCEPT_H 1
 
 #include <bits/c++config.h>
-#include <exception_defines.h>
+#include <bits/exception_defines.h>
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
Index: include/Makefile.am
===================================================================
--- include/Makefile.am	(revision 168826)
+++ include/Makefile.am	(working copy)
@@ -1,6 +1,7 @@ 
 ## Makefile for the include subdirectory of the GNU C++ Standard library.
 ##
-## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+## 2011
 ## Free Software Foundation, Inc.
 ##
 ## This file is part of the libstdc++ version 3 distribution.
@@ -172,6 +173,14 @@ 
 	${bits_srcdir}/valarray_after.h \
 	${bits_srcdir}/vector.tcc
 
+bits_sup_srcdir = ${glibcxx_srcdir}/libsupc++
+bits_sup_headers = \
+        ${bits_sup_srcdir}/cxxabi_forced.h \
+        ${bits_sup_srcdir}/exception_defines.h \
+        ${bits_sup_srcdir}/exception_ptr.h \
+        ${bits_sup_srcdir}/hash_bytes.h \
+        ${bits_sup_srcdir}/nested_exception.h
+
 backward_srcdir = ${glibcxx_srcdir}/include/backward
 backward_builddir = ./backward
 backward_headers = \
@@ -888,7 +897,7 @@ 
 # List of all timestamp files.  By keeping only one copy of this list, both
 # CLEANFILES and all-local are kept up-to-date.
 allstamped = \
-	stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
+	stamp-std stamp-bits stamp-bits-sup stamp-c_base stamp-c_compatibility \
 	stamp-backward stamp-ext stamp-pb stamp-tr1 stamp-decimal \
 	stamp-debug stamp-parallel stamp-profile stamp-profile-impl \
 	stamp-host 
@@ -917,6 +926,10 @@ 
 	@-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
 	@$(STAMP) stamp-bits
 
+stamp-bits-sup: stamp-bits ${bits_sup_headers}
+	@-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
+	@$(STAMP) stamp-bits-sup
+
 stamp-c_base: ${c_base_headers}
 	@-mkdir -p ${c_base_builddir}
 	@-cd ${c_base_builddir} && $(LN_S) $? . 2>/dev/null
@@ -1071,14 +1084,14 @@ 
 			      stamp-namespace-version \
 			      stamp-visibility
 	@date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\
-	nsa_version=`cat stamp-namespace-version` ;\
+	ns_version=`cat stamp-namespace-version` ;\
 	visibility=`cat stamp-visibility` ;\
 	ldbl_compat='s,g,g,' ;\
 	grep "^[ 	]*#[ 	]*define[ 	][ 	]*_GLIBCXX_LONG_DOUBLE_COMPAT[ 	][ 	]*1[ 	]*$$" \
 	${CONFIG_HEADER} > /dev/null 2>&1 \
 	&& ldbl_compat='s,^#undef _GLIBCXX_LONG_DOUBLE_COMPAT$$,#define _GLIBCXX_LONG_DOUBLE_COMPAT 1,' ;\
 	sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \
-	-e "s,define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION, define _GLIBCXX_NAMESPACE_ASSOCIATION_VERSION $$nsa_version," \
+	-e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \
 	-e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \
 	-e "$$ldbl_compat" \
             < ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
Index: libsupc++/hash_bytes.h
===================================================================
--- libsupc++/hash_bytes.h	(revision 0)
+++ libsupc++/hash_bytes.h	(revision 0)
@@ -0,0 +1,56 @@ 
+// Declarations for hash functions. -*- C++ -*-
+
+// Copyright (C) 2010, 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/hash_bytes.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{functional}
+ */
+
+#ifndef _HASH_BYTES_H
+#define _HASH_BYTES_H 1
+
+#pragma GCC system_header
+
+#include <bits/c++config.h>
+
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
+  // Hash function implementation for the nontrivial specialization.
+  // All of them are based on a primitive that hashes a pointer to a
+  // byte array. The actual hash algorithm is not guaranteed to stay
+  // the same from release to release -- it may be updated or tuned to
+  // improve hash quality or speed.
+  size_t
+  _Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
+
+  // A similar hash primitive, using the FNV hash algorithm. This
+  // algorithm is guaranteed to stay the same from release to release.
+  // (although it might not produce the same values on different
+  // machines.)
+  size_t
+  _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed);
+
+_GLIBCXX_END_NAMESPACE
+
+#endif
Index: libsupc++/cxxabi_forced.h
===================================================================
--- libsupc++/cxxabi_forced.h	(revision 168824)
+++ libsupc++/cxxabi_forced.h	(working copy)
@@ -1,6 +1,6 @@ 
-// cxxabi.h subset for inclusion by other library headers -*- C++ -*-
+// cxxabi.h subset for cancellation -*- C++ -*-
   
-// Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2009, 2010, 2011 Free Software Foundation, Inc.
 //
 // This file is part of GCC.
 //
@@ -23,8 +23,9 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @file cxxabi-forced.h
- *  The header provides an interface to the C++ ABI.
+/** @file bits/cxxabi_forced.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{cxxabi.h}
  */
 
 #ifndef _CXXABI_FORCED_H
Index: libsupc++/typeinfo
===================================================================
--- libsupc++/typeinfo	(revision 168826)
+++ libsupc++/typeinfo	(working copy)
@@ -1,6 +1,6 @@ 
 // RTTI support for -*- C++ -*-
 // Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-// 2003, 2004, 2005, 2006, 2007, 2009, 2010
+// 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011
 // Free Software Foundation
 //
 // This file is part of GCC.
@@ -34,7 +34,11 @@ 
 #pragma GCC system_header
 
 #include <exception>
+#ifdef __GXX_EXPERIMENTAL_CXX0X__
+#include <bits/hash_bytes.h>
+#endif
 
+
 #pragma GCC visibility push(default)
 
 extern "C++" {
@@ -78,11 +82,6 @@ 
 
 namespace std 
 {
-#ifdef __GXX_EXPERIMENTAL_CXX0X__
-  size_t
-  _Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
-#endif
-
   /**
    *  @brief  Part of RTTI.
    *
Index: libsupc++/exception
===================================================================
--- libsupc++/exception	(revision 168826)
+++ libsupc++/exception	(working copy)
@@ -1,7 +1,7 @@ 
 // Exception Handling support header for -*- C++ -*-
 
 // Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-// 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
 // Free Software Foundation
 //
 // This file is part of GCC.
@@ -148,8 +148,8 @@ 
 
 #if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
      && defined(_GLIBCXX_ATOMIC_BUILTINS_4))
-#include <exception_ptr.h>
-#include <nested_exception.h>
+#include <bits/exception_ptr.h>
+#include <bits/nested_exception.h>
 #endif
 
 #endif
Index: libsupc++/eh_aux_runtime.cc
===================================================================
--- libsupc++/eh_aux_runtime.cc	(revision 168826)
+++ libsupc++/eh_aux_runtime.cc	(working copy)
@@ -1,5 +1,5 @@ 
 // -*- C++ -*- Common throw conditions.
-// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2009
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2009, 2011
 // Free Software Foundation
 //
 // This file is part of GCC.
@@ -27,7 +27,7 @@ 
 #include "exception"
 #include <cstdlib>
 #include "unwind-cxx.h"
-#include "exception_defines.h"
+#include <bits/exception_defines.h>
 
 extern "C" void
 __cxxabiv1::__cxa_bad_cast ()
Index: libsupc++/cxxabi-forced.h
===================================================================
--- libsupc++/cxxabi-forced.h	(revision 168826)
+++ libsupc++/cxxabi-forced.h	(working copy)
@@ -1,59 +0,0 @@ 
-// cxxabi.h subset for inclusion by other library headers -*- C++ -*-
-  
-// Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
-//
-// This file is part of GCC.
-//
-// GCC is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3, or (at your option)
-// any later version.
-// 
-// GCC is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-// 
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file cxxabi-forced.h
- *  The header provides an interface to the C++ ABI.
- */
-
-#ifndef _CXXABI_FORCED_H
-#define _CXXABI_FORCED_H 1
-
-#pragma GCC system_header
-
-#pragma GCC visibility push(default)
-
-#ifdef __cplusplus
-namespace __cxxabiv1
-{  
-  /** 
-   *  @brief Thrown as part of forced unwinding.
-   *  @ingroup exceptions
-   *
-   *  A magic placeholder class that can be caught by reference to
-   *  recognize forced unwinding.
-   */
-  class __forced_unwind
-  {
-    virtual ~__forced_unwind() throw();
-
-    // Prevent catch by value.
-    virtual void __pure_dummy() = 0; 
-  };
-}
-#endif // __cplusplus
-
-#pragma GCC visibility pop
-
-#endif // __CXXABI_FORCED_H 
Index: libsupc++/eh_ptr.cc
===================================================================
--- libsupc++/eh_ptr.cc	(revision 168826)
+++ libsupc++/eh_ptr.cc	(working copy)
@@ -29,7 +29,7 @@ 
 #define _GLIBCXX_EH_PTR_COMPAT
 
 #include <exception>
-#include <exception_ptr.h>
+#include <bits/exception_ptr.h>
 #include "unwind-cxx.h"
 
 using namespace __cxxabiv1;
Index: libsupc++/new_op.cc
===================================================================
--- libsupc++/new_op.cc	(revision 168826)
+++ libsupc++/new_op.cc	(working copy)
@@ -1,6 +1,6 @@ 
 // Support routines for the -*- C++ -*- dynamic memory management.
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2009
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2009, 2011
 // Free Software Foundation
 //
 // This file is part of GCC.
@@ -26,7 +26,7 @@ 
 
 #include <bits/c++config.h>
 #include <cstdlib>
-#include <exception_defines.h>
+#include <bits/exception_defines.h>
 #include "new"
 
 using std::new_handler;
Index: libsupc++/exception_defines.h
===================================================================
--- libsupc++/exception_defines.h	(revision 168826)
+++ libsupc++/exception_defines.h	(working copy)
@@ -1,6 +1,7 @@ 
 // -fno-exceptions Support -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 2007, 2008, 2009,
+// 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -23,12 +24,9 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-//
-// ISO C++ 14882: 19.1  Exception classes
-//
-
-/** @file exception_defines.h
- *  This is a Standard C++ Library header.
+/** @file bits/exception_defines.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{exception}
  */
 
 #ifndef _EXCEPTION_DEFINES_H
Index: libsupc++/nested_exception.h
===================================================================
--- libsupc++/nested_exception.h	(revision 168826)
+++ libsupc++/nested_exception.h	(working copy)
@@ -1,6 +1,6 @@ 
 // Nested Exception support header (nested_exception class) for -*- C++ -*-
 
-// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2009, 2010, 2011 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
@@ -22,7 +22,7 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @file nested_exception.h
+/** @file bits/nested_exception.h
  *  This is an internal header file, included by other library headers.
  *  Do not attempt to use it directly. @headername{exception}
  */
Index: libsupc++/eh_terminate.cc
===================================================================
--- libsupc++/eh_terminate.cc	(revision 168826)
+++ libsupc++/eh_terminate.cc	(working copy)
@@ -1,5 +1,6 @@ 
 // -*- C++ -*- std::terminate, std::unexpected and friends.
-// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009
+// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009,
+// 2011
 // Free Software Foundation
 //
 // This file is part of GCC.
@@ -27,7 +28,7 @@ 
 #include "exception"
 #include <cstdlib>
 #include "unwind-cxx.h"
-#include "exception_defines.h"
+#include <bits/exception_defines.h>
 
 using namespace __cxxabiv1;
 
Index: libsupc++/vec.cc
===================================================================
--- libsupc++/vec.cc	(revision 168826)
+++ libsupc++/vec.cc	(working copy)
@@ -1,6 +1,7 @@ 
 // New abi Support -*- C++ -*-
 
-// Copyright (C) 2000, 2001, 2003, 2004, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2003, 2004, 2009, 2011
+// Free Software Foundation, Inc.
 //  
 // This file is part of GCC.
 //
@@ -28,7 +29,7 @@ 
 #include <cxxabi.h>
 #include <new>
 #include <exception>
-#include <exception_defines.h>
+#include <bits/exception_defines.h>
 #include "unwind-cxx.h"
 
 namespace __cxxabiv1
Index: libsupc++/vterminate.cc
===================================================================
--- libsupc++/vterminate.cc	(revision 168826)
+++ libsupc++/vterminate.cc	(working copy)
@@ -1,6 +1,6 @@ 
 // Verbose terminate_handler -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2004, 2005, 2009 Free Software Foundation
+// Copyright (C) 2001, 2002, 2004, 2005, 2009, 2011 Free Software Foundation
 //
 // 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
@@ -27,7 +27,7 @@ 
 #if _GLIBCXX_HOSTED
 #include <cstdlib>
 #include <exception>
-#include <exception_defines.h>
+#include <bits/exception_defines.h>
 #include <cxxabi.h>
 # include <cstdio>
 
Index: libsupc++/cxxabi.h
===================================================================
--- libsupc++/cxxabi.h	(revision 168826)
+++ libsupc++/cxxabi.h	(working copy)
@@ -1,6 +1,6 @@ 
-// new abi support -*- C++ -*-
-  
-// Copyright (C) 2000, 2002, 2003, 2004, 2006, 2007, 2009, 2010
+// ABI Support -*- C++ -*-
+
+// Copyright (C) 2000, 2002, 2003, 2004, 2006, 2007, 2009, 2010, 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of GCC.
@@ -9,12 +9,12 @@ 
 // it under the terms of the GNU General Public License as published by
 // the Free Software Foundation; either version 3, or (at your option)
 // any later version.
-// 
+//
 // GCC is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 // GNU General Public License for more details.
-// 
+//
 // Under Section 7 of GPL version 3, you are granted additional
 // permissions described in the GCC Runtime Library Exception, version
 // 3.1, as published by the Free Software Foundation.
@@ -25,12 +25,12 @@ 
 // <http://www.gnu.org/licenses/>.
 
 // Written by Nathan Sidwell, Codesourcery LLC, <nathan@codesourcery.com>
- 
+
 /* This file declares the new abi entry points into the runtime. It is not
    normally necessary for user programs to include this header, or use the
    entry points directly. However, this header is available should that be
    needed.
-   
+
    Some of the entry points are intended for both C and C++, thus this header
    is includable from both C and C++. Though the C++ specific parts are not
    available in C, naturally enough.  */
@@ -47,40 +47,35 @@ 
 #pragma GCC visibility push(default)
 
 #include <stddef.h>
+#include <bits/c++config.h>
 #include <bits/cxxabi_tweaks.h>
-#include <cxxabi-forced.h>
- 
-#ifdef __cplusplus
-#define _GLIBCXX_NOTHROW throw() 
-#else
-#define _GLIBCXX_NOTHROW __attribute__((__nothrow__))
-#endif
+#include <bits/cxxabi_forced.h>
 
 #ifdef __cplusplus
 namespace __cxxabiv1
-{  
-  extern "C" 
+{
+  extern "C"
   {
 #endif
 
   typedef __cxa_cdtor_return_type (*__cxa_cdtor_type)(void *);
 
   // Allocate array.
-  void* 
-  __cxa_vec_new(size_t __element_count, size_t __element_size, 
+  void*
+  __cxa_vec_new(size_t __element_count, size_t __element_size,
 		size_t __padding_size, __cxa_cdtor_type __constructor,
 		__cxa_cdtor_type __destructor);
 
   void*
   __cxa_vec_new2(size_t __element_count, size_t __element_size,
 		 size_t __padding_size, __cxa_cdtor_type __constructor,
-		 __cxa_cdtor_type __destructor, void *(*__alloc) (size_t), 
+		 __cxa_cdtor_type __destructor, void *(*__alloc) (size_t),
 		 void (*__dealloc) (void*));
 
   void*
   __cxa_vec_new3(size_t __element_count, size_t __element_size,
 		 size_t __padding_size, __cxa_cdtor_type __constructor,
-		 __cxa_cdtor_type __destructor, void *(*__alloc) (size_t), 
+		 __cxa_cdtor_type __destructor, void *(*__alloc) (size_t),
 		 void (*__dealloc) (void*, size_t));
 
   // Construct array.
@@ -91,41 +86,41 @@ 
 
   __cxa_vec_ctor_return_type
   __cxa_vec_cctor(void* __dest_array, void* __src_array,
-		  size_t __element_count, size_t __element_size, 
-		  __cxa_cdtor_return_type (*__constructor) (void*, void*), 
+		  size_t __element_count, size_t __element_size,
+		  __cxa_cdtor_return_type (*__constructor) (void*, void*),
 		  __cxa_cdtor_type __destructor);
- 
+
   // Destruct array.
-  void 
+  void
   __cxa_vec_dtor(void* __array_address, size_t __element_count,
 		 size_t __element_size, __cxa_cdtor_type __destructor);
-  
-  void 
+
+  void
   __cxa_vec_cleanup(void* __array_address, size_t __element_count, size_t __s,
 		    __cxa_cdtor_type __destructor) _GLIBCXX_NOTHROW;
-  
+
   // Destruct and release array.
-  void 
+  void
   __cxa_vec_delete(void* __array_address, size_t __element_size,
 		   size_t __padding_size, __cxa_cdtor_type __destructor);
 
-  void 
+  void
   __cxa_vec_delete2(void* __array_address, size_t __element_size,
 		    size_t __padding_size, __cxa_cdtor_type __destructor,
 		    void (*__dealloc) (void*));
-                  
-  void 
+
+  void
   __cxa_vec_delete3(void* __array_address, size_t __element_size,
 		    size_t __padding_size, __cxa_cdtor_type __destructor,
 		    void (*__dealloc) (void*, size_t));
 
-  int 
+  int
   __cxa_guard_acquire(__guard*);
 
-  void 
+  void
   __cxa_guard_release(__guard*) _GLIBCXX_NOTHROW;
 
-  void 
+  void
   __cxa_guard_abort(__guard*) _GLIBCXX_NOTHROW;
 
   // Pure virtual functions.
@@ -148,7 +143,7 @@ 
 
 
   /**
-   *  @brief Demangling routine. 
+   *  @brief Demangling routine.
    *  ABI-mandated entry point in the C++ runtime library for demangling.
    *
    *  @param __mangled_name A NUL-terminated character string
@@ -177,7 +172,7 @@ 
    *  The demangling is performed using the C++ ABI mangling rules,
    *  with GNU extensions. For example, this function is used in
    *  __gnu_cxx::__verbose_terminate_handler.
-   * 
+   *
    *  See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch39.html
    *  for other examples of use.
    *
@@ -205,10 +200,10 @@ 
   class __fundamental_type_info : public std::type_info
   {
   public:
-    explicit 
+    explicit
     __fundamental_type_info(const char* __n) : std::type_info(__n) { }
 
-    virtual 
+    virtual
     ~__fundamental_type_info();
   };
 
@@ -216,10 +211,10 @@ 
   class __array_type_info : public std::type_info
   {
   public:
-    explicit 
+    explicit
     __array_type_info(const char* __n) : std::type_info(__n) { }
 
-    virtual 
+    virtual
     ~__array_type_info();
   };
 
@@ -227,15 +222,15 @@ 
   class __function_type_info : public std::type_info
   {
   public:
-    explicit 
+    explicit
     __function_type_info(const char* __n) : std::type_info(__n) { }
 
-    virtual 
+    virtual
     ~__function_type_info();
 
   protected:
     // Implementation defined member function.
-    virtual bool 
+    virtual bool
     __is_function_p() const;
   };
 
@@ -243,10 +238,10 @@ 
   class __enum_type_info : public std::type_info
   {
   public:
-    explicit 
+    explicit
     __enum_type_info(const char* __n) : std::type_info(__n) { }
 
-    virtual 
+    virtual
     ~__enum_type_info();
   };
 
@@ -257,17 +252,17 @@ 
     unsigned int 		__flags; // Qualification of the target object.
     const std::type_info* 	__pointee; // Type of pointed to object.
 
-    explicit 
-    __pbase_type_info(const char* __n, int __quals, 
+    explicit
+    __pbase_type_info(const char* __n, int __quals,
 		      const std::type_info* __type)
     : std::type_info(__n), __flags(__quals), __pointee(__type)
     { }
-    
-    virtual 
+
+    virtual
     ~__pbase_type_info();
 
     // Implementation defined type.
-    enum __masks 
+    enum __masks
       {
 	__const_mask = 0x1,
 	__volatile_mask = 0x2,
@@ -283,11 +278,11 @@ 
     operator=(const __pbase_type_info&);
 
     // Implementation defined member functions.
-    virtual bool 
-    __do_catch(const std::type_info* __thr_type, void** __thr_obj, 
+    virtual bool
+    __do_catch(const std::type_info* __thr_type, void** __thr_obj,
 	       unsigned int __outer) const;
 
-    inline virtual bool 
+    inline virtual bool
     __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
 		    unsigned __outer) const;
   };
@@ -296,22 +291,22 @@ 
   class __pointer_type_info : public __pbase_type_info
   {
   public:
-    explicit 
-    __pointer_type_info(const char* __n, int __quals, 
+    explicit
+    __pointer_type_info(const char* __n, int __quals,
 			const std::type_info* __type)
     : __pbase_type_info (__n, __quals, __type) { }
 
 
-    virtual 
+    virtual
     ~__pointer_type_info();
 
   protected:
     // Implementation defined member functions.
-    virtual bool 
+    virtual bool
     __is_pointer_p() const;
 
-    virtual bool 
-    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj, 
+    virtual bool
+    __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
 		    unsigned __outer) const;
   };
 
@@ -323,13 +318,13 @@ 
   public:
     __class_type_info* __context;   // Class of the member.
 
-    explicit 
+    explicit
     __pointer_to_member_type_info(const char* __n, int __quals,
-				  const std::type_info* __type, 
+				  const std::type_info* __type,
 				  __class_type_info* __klass)
     : __pbase_type_info(__n, __quals, __type), __context(__klass) { }
 
-    virtual 
+    virtual
     ~__pointer_to_member_type_info();
 
   protected:
@@ -339,7 +334,7 @@ 
     operator=(const __pointer_to_member_type_info&);
 
     // Implementation defined member function.
-    virtual bool 
+    virtual bool
     __pointer_catch(const __pbase_type_info* __thr_type, void** __thr_obj,
 		    unsigned __outer) const;
   };
@@ -351,26 +346,26 @@ 
     const __class_type_info* 	__base_type;  // Base class type.
     long 			__offset_flags;  // Offset and info.
 
-    enum __offset_flags_masks 
+    enum __offset_flags_masks
       {
 	__virtual_mask = 0x1,
 	__public_mask = 0x2,
 	__hwm_bit = 2,
 	__offset_shift = 8          // Bits to shift offset.
       };
-  
+
     // Implementation defined member functions.
-    bool 
+    bool
     __is_virtual_p() const
     { return __offset_flags & __virtual_mask; }
 
-    bool 
+    bool
     __is_public_p() const
     { return __offset_flags & __public_mask; }
 
-    ptrdiff_t 
+    ptrdiff_t
     __offset() const
-    { 
+    {
       // This shift, being of a signed type, is implementation
       // defined. GCC implements such shifts as arithmetic, which is
       // what we want.
@@ -382,10 +377,10 @@ 
   class __class_type_info : public std::type_info
   {
   public:
-    explicit 
+    explicit
     __class_type_info (const char *__n) : type_info(__n) { }
 
-    virtual 
+    virtual
     ~__class_type_info ();
 
     // Implementation defined types.
@@ -396,24 +391,24 @@ 
     enum __sub_kind
       {
 	// We have no idea.
-	__unknown = 0, 
+	__unknown = 0,
 
 	// Not contained within us (in some circumstances this might
 	// mean not contained publicly)
-	__not_contained, 
+	__not_contained,
 
 	// Contained ambiguously.
-	__contained_ambig, 
-    
+	__contained_ambig,
+
 	// Via a virtual path.
-	__contained_virtual_mask = __base_class_type_info::__virtual_mask, 
+	__contained_virtual_mask = __base_class_type_info::__virtual_mask,
 
 	// Via a public path.
-	__contained_public_mask = __base_class_type_info::__public_mask,   
+	__contained_public_mask = __base_class_type_info::__public_mask,
 
 	// Contained within us.
 	__contained_mask = 1 << __base_class_type_info::__hwm_bit,
-    
+
 	__contained_private = __contained_mask,
 	__contained_public = __contained_mask | __contained_public_mask
       };
@@ -423,17 +418,17 @@ 
 
   protected:
     // Implementation defined member functions.
-    virtual bool 
+    virtual bool
     __do_upcast(const __class_type_info* __dst_type, void**__obj_ptr) const;
 
-    virtual bool 
-    __do_catch(const type_info* __thr_type, void** __thr_obj, 
+    virtual bool
+    __do_catch(const type_info* __thr_type, void** __thr_obj,
 	       unsigned __outer) const;
 
   public:
-    // Helper for upcast. See if DST is us, or one of our bases. 
-    // Return false if not found, true if found. 
-    virtual bool 
+    // Helper for upcast. See if DST is us, or one of our bases.
+    // Return false if not found, true if found.
+    virtual bool
     __do_upcast(const __class_type_info* __dst, const void* __obj,
 		__upcast_result& __restrict __result) const;
 
@@ -443,9 +438,9 @@ 
     // objects might be contained within this type.  If SRC_PTR is one
     // of our SRC_TYPE bases, indicate the virtuality. Returns
     // not_contained for non containment or private containment.
-    inline __sub_kind 
+    inline __sub_kind
     __find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
-		      const __class_type_info* __src_type, 
+		      const __class_type_info* __src_type,
 		      const void* __src_ptr) const;
 
     // Helper for dynamic cast. ACCESS_PATH gives the access from the
@@ -455,17 +450,17 @@ 
     // started from and SRC_PTR points to that base within the most
     // derived object. Fill in RESULT with what we find. Return true
     // if we have located an ambiguous match.
-    virtual bool 
+    virtual bool
     __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
-		 const __class_type_info* __dst_type, const void* __obj_ptr, 
-		 const __class_type_info* __src_type, const void* __src_ptr, 
+		 const __class_type_info* __dst_type, const void* __obj_ptr,
+		 const __class_type_info* __src_type, const void* __src_ptr,
 		 __dyncast_result& __result) const;
-    
+
     // Helper for find_public_subobj. SRC2DST indicates how SRC_TYPE
     // bases are inherited by the type started from -- which is not
     // necessarily the current type. The current type will be a base
     // of the destination type.  OBJ_PTR points to the current base.
-    virtual __sub_kind 
+    virtual __sub_kind
     __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
 			 const __class_type_info* __src_type,
 			 const void* __src_ptr) const;
@@ -477,11 +472,11 @@ 
   public:
     const __class_type_info* __base_type;
 
-    explicit 
+    explicit
     __si_class_type_info(const char *__n, const __class_type_info *__base)
     : __class_type_info(__n), __base_type(__base) { }
 
-    virtual 
+    virtual
     ~__si_class_type_info();
 
   protected:
@@ -491,24 +486,24 @@ 
     operator=(const __si_class_type_info&);
 
     // Implementation defined member functions.
-    virtual bool 
+    virtual bool
     __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
 		 const __class_type_info* __dst_type, const void* __obj_ptr,
 		 const __class_type_info* __src_type, const void* __src_ptr,
 		 __dyncast_result& __result) const;
 
-    virtual __sub_kind 
+    virtual __sub_kind
     __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
 			 const __class_type_info* __src_type,
 			 const void* __sub_ptr) const;
 
-    virtual bool 
+    virtual bool
     __do_upcast(const __class_type_info*__dst, const void*__obj,
 		__upcast_result& __restrict __result) const;
   };
 
   // Type information for a class with multiple and/or virtual bases.
-  class __vmi_class_type_info : public __class_type_info 
+  class __vmi_class_type_info : public __class_type_info
   {
   public:
     unsigned int 		__flags;  // Details about the class hierarchy.
@@ -519,15 +514,15 @@ 
     // internally generated by the compiler.
     __base_class_type_info 	__base_info[1];  // Array of bases.
 
-    explicit 
+    explicit
     __vmi_class_type_info(const char* __n, int ___flags)
     : __class_type_info(__n), __flags(___flags), __base_count(0) { }
 
-    virtual 
+    virtual
     ~__vmi_class_type_info();
 
     // Implementation defined types.
-    enum __flags_masks 
+    enum __flags_masks
       {
 	__non_diamond_repeat_mask = 0x1, // Distinct instance of repeated base.
 	__diamond_shaped_mask = 0x2, // Diamond shaped multiple inheritance.
@@ -536,18 +531,18 @@ 
 
   protected:
     // Implementation defined member functions.
-    virtual bool 
+    virtual bool
     __do_dyncast(ptrdiff_t __src2dst, __sub_kind __access_path,
 		 const __class_type_info* __dst_type, const void* __obj_ptr,
 		 const __class_type_info* __src_type, const void* __src_ptr,
 		 __dyncast_result& __result) const;
 
-    virtual __sub_kind 
-    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr, 
+    virtual __sub_kind
+    __do_find_public_src(ptrdiff_t __src2dst, const void* __obj_ptr,
 			 const __class_type_info* __src_type,
 			 const void* __src_ptr) const;
-    
-    virtual bool 
+
+    virtual bool
     __do_upcast(const __class_type_info* __dst, const void* __obj,
 		__upcast_result& __restrict __result) const;
   };
@@ -628,4 +623,4 @@ 
 
 #pragma GCC visibility pop
 
-#endif // __CXXABI_H 
+#endif // __CXXABI_H
Index: libsupc++/exception_ptr.h
===================================================================
--- libsupc++/exception_ptr.h	(revision 168826)
+++ libsupc++/exception_ptr.h	(working copy)
@@ -1,6 +1,6 @@ 
 // Exception Handling support header (exception_ptr class) for -*- C++ -*-
 
-// Copyright (C) 2008, 2009, 2010 Free Software Foundation
+// Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation
 //
 // This file is part of GCC.
 //
@@ -23,7 +23,7 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @file exception_ptr.h
+/** @file bits/exception_ptr.h
  *  This is an internal header file, included by other library headers.
  *  Do not attempt to use it directly. @headername{exception}
  */
@@ -34,7 +34,7 @@ 
 #pragma GCC visibility push(default)
 
 #include <bits/c++config.h>
-#include <exception_defines.h>
+#include <bits/exception_defines.h>
 
 #if !defined(_GLIBCXX_ATOMIC_BUILTINS_4)
 #  error This platform does not support exception propagation.
Index: libsupc++/eh_personality.cc
===================================================================
--- libsupc++/eh_personality.cc	(revision 168826)
+++ libsupc++/eh_personality.cc	(working copy)
@@ -1,5 +1,6 @@ 
 // -*- C++ -*- The GNU C++ exception personality routine.
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+// 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of GCC.
@@ -25,7 +26,7 @@ 
 
 #include <bits/c++config.h>
 #include <cstdlib>
-#include <exception_defines.h>
+#include <bits/exception_defines.h>
 #include <cxxabi.h>
 #include "unwind-cxx.h"
 
Index: libsupc++/Makefile.am
===================================================================
--- libsupc++/Makefile.am	(revision 168826)
+++ libsupc++/Makefile.am	(working copy)
@@ -1,7 +1,7 @@ 
 ## Makefile for the GNU C++ Support library.
 ##
 ## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-## 2009, 2010
+## 2009, 2010, 2011
 ## Free Software Foundation, Inc.
 ##
 ## Process this file with automake to produce Makefile.in.
@@ -31,11 +31,15 @@ 
 # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
 noinst_LTLIBRARIES = libsupc++convenience.la
 
+std_HEADERS = \
+	cxxabi.h exception initializer_list new typeinfo 
 
-headers = \
-	exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h \
-	initializer_list exception_ptr.h nested_exception.h
+bits_HEADERS = \
+	cxxabi_forced.h hash_bytes.h \
+	exception_defines.h exception_ptr.h nested_exception.h 
 
+headers = $(std_HEADERS) $(bits_HEADERS)
+
 if GLIBCXX_HOSTED
   c_sources = \
 	cp-demangle.c 
@@ -88,12 +92,9 @@ 
 	vmi_class_type_info.cc \
 	vterminate.cc
 
-libsupc___la_SOURCES = $(sources) $(c_sources)
+libsupc___la_SOURCES = $(sources) $(c_sources) 
 libsupc__convenience_la_SOURCES = $(sources) $(c_sources)
 
-glibcxxinstalldir = $(gxx_include_dir)
-glibcxxinstall_HEADERS = $(headers)
-
 # AM_CXXFLAGS needs to be in each subdirectory so that it can be
 # modified in a per-library or per-sub-library way.  Need to manually
 # set this option because CONFIG_CXXFLAGS has to be after
@@ -132,7 +133,7 @@ 
 	$(C_COMPILE) -DIN_GLIBCPP_V3 -Wno-error -c $<
 
 
-# libstdc++ libtool notes
+# Libtool notes
 
 # 1) Need to explicitly set LTCXXCOMPILE so that AM_CXXFLAGS is
 # last. (That way, things like -O2 passed down from the toplevel can
@@ -169,21 +170,43 @@ 
 	  --mode=link $(CXX) \
 	  $(OPT_LDFLAGS) $(SECTION_LDFLAGS) $(AM_CXXFLAGS) $(LTLDFLAGS) -o $@
 
+
+# Install notes
 # We have to have rules modified from the default to counteract SUN make
-# prepending each of $(glibcxxinstall_HEADERS) with VPATH below.
-install-glibcxxinstallHEADERS: $(glibcxxinstall_HEADERS)
+# prepending each of $(*_HEADERS) with VPATH below.
+stddir = $(gxx_include_dir)
+bitsdir = $(gxx_include_dir)/bits
+
+install-stdHEADERS: $(std_HEADERS)
 	@$(NORMAL_INSTALL)
-	$(mkinstalldirs) $(DESTDIR)$(glibcxxinstalldir)
-	@list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \
+	$(mkinstalldirs) $(DESTDIR)$(stddir)
+	@list='$(std_HEADERS)'; for p in $$list; do \
 	  q=`echo $$p | sed -e 's,.*/,,'`; \
 	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
-	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q"; \
-	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(glibcxxinstalldir)/$$q; \
+	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(stddir)/$$q"; \
+	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(stddir)/$$q; \
 	done
 
-uninstall-glibcxxinstallHEADERS:
+install-bitsHEADERS: $(bits_HEADERS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(bitsdir)
+	@list='$(bits_HEADERS)'; for p in $$list; do \
+	  q=`echo $$p | sed -e 's,.*/,,'`; \
+	  if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+	  echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(bitsdir)/$$q"; \
+	  $(INSTALL_DATA) $$d$$p $(DESTDIR)$(bitsdir)/$$q; \
+	done
+
+uninstall-stdHEADERS:
 	@$(NORMAL_UNINSTALL)
-	list='$(glibcxxinstall_HEADERS)'; for p in $$list; do \
+	list='$(std_HEADERS)'; for p in $$list; do \
 	  q=`echo $$p | sed -e 's,.*/,,'`; \
-	  rm -f $(DESTDIR)$(glibcxxinstalldir)/$$q; \
+	  rm -f $(DESTDIR)$(stddir)/$$q; \
 	done
+
+uninstall-bitsHEADERS:
+	@$(NORMAL_UNINSTALL)
+	list='$(bits_HEADERS)'; for p in $$list; do \
+	  q=`echo $$p | sed -e 's,.*/,,'`; \
+	  rm -f $(DESTDIR)$(bitsdir)/$$q; \
+	done
Index: libsupc++/eh_call.cc
===================================================================
--- libsupc++/eh_call.cc	(revision 168826)
+++ libsupc++/eh_call.cc	(working copy)
@@ -1,5 +1,6 @@ 
 // -*- C++ -*- Helpers for calling unextected and terminate
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+// 2011
 // Free Software Foundation, Inc.
 //
 // This file is part of GCC.
@@ -25,7 +26,7 @@ 
 
 #include <bits/c++config.h>
 #include <cstdlib>
-#include <exception_defines.h>
+#include <bits/exception_defines.h>
 #include "unwind-cxx.h"
 
 using namespace __cxxabiv1;
Index: libsupc++/new_opnt.cc
===================================================================
--- libsupc++/new_opnt.cc	(revision 168826)
+++ libsupc++/new_opnt.cc	(working copy)
@@ -1,5 +1,5 @@ 
 // Support routines for the -*- C++ -*- dynamic memory management.
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2009
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2009, 2011
 // Free Software Foundation
 //
 // This file is part of GCC.
@@ -24,7 +24,7 @@ 
 // <http://www.gnu.org/licenses/>.
 
 #include <bits/c++config.h>
-#include <exception_defines.h>
+#include <bits/exception_defines.h>
 #include "new"
 
 using std::new_handler;
Index: libsupc++/hash_bytes.cc
===================================================================
--- libsupc++/hash_bytes.cc	(revision 168826)
+++ libsupc++/hash_bytes.cc	(working copy)
@@ -1,6 +1,6 @@ 
 // Definition of _Hash_bytes. -*- C++ -*-
 
-// Copyright (C) 2010 Free Software Foundation, Inc.
+// Copyright (C) 2010, 2011 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
@@ -32,7 +32,7 @@ 
 // function apears to be better in both speed and hash quality, and
 // FNV is provided primarily for backward compatibility.
 
-#include <bits/c++config.h>
+#include <bits/hash_bytes.h>
 
 namespace
 {
@@ -63,8 +63,8 @@ 
 #endif
 }
 
-namespace std
-{
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
 #if __SIZEOF_SIZE_T__ == 4
 
   // Implementation of Murmur hash for 32-bit size_t.
@@ -97,7 +97,7 @@ 
 	hash ^= static_cast<unsigned char>(buf[1]) << 8;
       case 1:
 	hash ^= static_cast<unsigned char>(buf[0]);
-        hash *= m;
+	hash *= m;
       };
 
     // Do a few final mixes of the hash.
@@ -182,4 +182,5 @@ 
   { return _Hash_bytes(ptr, len, seed); }
 
 #endif /* __SIZEOF_SIZE_T__ */
-}
+
+_GLIBCXX_END_NAMESPACE
Index: testsuite/ext/profile/mutex_extensions_neg.cc
===================================================================
--- testsuite/ext/profile/mutex_extensions_neg.cc	(revision 168826)
+++ testsuite/ext/profile/mutex_extensions_neg.cc	(working copy)
@@ -3,7 +3,7 @@ 
 
 // -*- C++ -*-
 
-// Copyright (C) 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007, 2009, 2010, 2011 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
@@ -22,4 +22,4 @@ 
 
 #include <vector>
 
-// { dg-error "Cannot use -D_GLIBCXX_PROFILE with " "" { target *-*-* } 223 }
+// { dg-error "Cannot use -D_GLIBCXX_PROFILE with " "" { target *-*-* } 220 }
Index: config/cpu/arm/cxxabi_tweaks.h
===================================================================
--- config/cpu/arm/cxxabi_tweaks.h	(revision 168826)
+++ config/cpu/arm/cxxabi_tweaks.h	(working copy)
@@ -1,6 +1,6 @@ 
 // Control various target specific ABI tweaks.  ARM version.
 
-// Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2006, 2008, 2009, 2011 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
@@ -22,8 +22,9 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @file cxxabi_tweaks.h
- *  The header provides an CPU-variable interface to the C++ ABI.
+/** @file bits/cxxabi_tweaks.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{cxxabi.h}
  */
 
 #ifndef _CXXABI_TWEAKS_H
Index: config/cpu/generic/cxxabi_tweaks.h
===================================================================
--- config/cpu/generic/cxxabi_tweaks.h	(revision 168826)
+++ config/cpu/generic/cxxabi_tweaks.h	(working copy)
@@ -1,6 +1,6 @@ 
 // Control various target specific ABI tweaks.  Generic version.
 
-// Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2006, 2008, 2009, 2011 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
@@ -22,8 +22,9 @@ 
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @file cxxabi_tweaks.h
- *  The header provides an CPU-variable interface to the C++ ABI.
+/** @file bits/cxxabi_tweaks.h
+ *  This is an internal header file, included by other library headers.
+ *  Do not attempt to use it directly. @headername{cxxabi.h}
  */
 
 #ifndef _CXXABI_TWEAKS_H