Remove gcc 3.2 compatibility hacks.
authorIan Lance Taylor <iant@google.com>
Fri, 29 Feb 2008 19:19:17 +0000 (19:19 +0000)
committerIan Lance Taylor <iant@google.com>
Fri, 29 Feb 2008 19:19:17 +0000 (19:19 +0000)
17 files changed:
gold/common.cc
gold/config.in
gold/configure
gold/configure.ac
gold/dynobj.cc
gold/dynobj.h
gold/gold.h
gold/i386.cc
gold/layout.cc
gold/layout.h
gold/object.h
gold/output.cc
gold/output.h
gold/resolve.cc
gold/symtab.cc
gold/symtab.h
gold/x86_64.cc

index e6f391017d9e44606fe32bca9ad17508ef368b09..286a11288550df4a2d51726217b559530af70915 100644 (file)
@@ -90,12 +90,8 @@ Sort_commons<size>::operator()(const Symbol* pa, const Symbol* pb) const
     return true;
 
   const Symbol_table* symtab = this->symtab_;
-  const Sized_symbol<size>* psa;
-  psa = symtab->get_sized_symbol SELECT_SIZE_NAME(size) (pa
-                                                         SELECT_SIZE(size));
-  const Sized_symbol<size>* psb;
-  psb = symtab->get_sized_symbol SELECT_SIZE_NAME(size) (pb
-                                                         SELECT_SIZE(size));
+  const Sized_symbol<size>* psa = symtab->get_sized_symbol<size>(pa);
+  const Sized_symbol<size>* psb = symtab->get_sized_symbol<size>(pb);
 
   typename Sized_symbol<size>::Size_type sa = psa->symsize();
   typename Sized_symbol<size>::Size_type sb = psb->symsize();
@@ -171,10 +167,7 @@ Symbol_table::do_allocate_commons(const General_options&,
       else
        {
          any = true;
-         Sized_symbol<size>* ssym;
-         ssym = this->get_sized_symbol SELECT_SIZE_NAME(size) (
-              sym
-              SELECT_SIZE(size));
+         Sized_symbol<size>* ssym = this->get_sized_symbol<size>(sym);
          if (ssym->value() > addralign)
            addralign = ssym->value();
        }
@@ -205,15 +198,9 @@ Symbol_table::do_allocate_commons(const General_options&,
       Symbol* sym = *p;
       if (sym == NULL)
        break;
-
-      Sized_symbol<size>* ssym;
-      ssym = this->get_sized_symbol SELECT_SIZE_NAME(size) (sym
-                                                            SELECT_SIZE(size));
-
+      Sized_symbol<size>* ssym = this->get_sized_symbol<size>(sym);
       off = align_address(off, ssym->value());
-
       ssym->allocate_common(poc, off);
-
       off += ssym->symsize();
     }
 
index 4dc6141415542389770c13363147de735094baf7..81da6aaad3338f3b4e3b85ada96630fdb34cfe98 100644 (file)
@@ -28,9 +28,6 @@
 /* Define to 1 if you have the `mallinfo' function. */
 #undef HAVE_MALLINFO
 
-/* Whether the C++ compiler can call a template member with no arguments */
-#undef HAVE_MEMBER_TEMPLATE_SPECIFICATIONS
-
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
index d2006a3d5322cb5efad9f2c340df12829a5a407e..2caa368e8a66fee38356d257bb27605a4c64b444 100755 (executable)
@@ -6223,59 +6223,6 @@ fi
 done
 
 
-echo "$as_me:$LINENO: checking template member calls" >&5
-echo $ECHO_N "checking template member calls... $ECHO_C" >&6
-if test "${gold_cv_c_membertemplates+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-
-class c { public: template<int i> void fn(); };
-template<int i> void foo(c cv) { cv.fn<i>(); }
-template void foo<1>(c cv);
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_cxx_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  gold_cv_c_membertemplates=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-gold_cv_c_membertemplates=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $gold_cv_c_membertemplates" >&5
-echo "${ECHO_T}$gold_cv_c_membertemplates" >&6
-
-if test "$gold_cv_c_membertemplates" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MEMBER_TEMPLATE_SPECIFICATIONS
-_ACEOF
-
-fi
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
index c719e7853414dbf5aa8c06e444fd886627b7056d..45e65ab277a21d6bf2ef41b4ac5e8a7d0ce273b5 100644 (file)
@@ -242,19 +242,6 @@ AC_CHECK_HEADERS(tr1/unordered_set tr1/unordered_map)
 AC_CHECK_HEADERS(ext/hash_map ext/hash_set)
 AC_CHECK_FUNCS(mallinfo)
 
-dnl Test whether the compiler can specify a member templates to call.
-AC_CACHE_CHECK([template member calls], [gold_cv_c_membertemplates],
-[AC_COMPILE_IFELSE([
-class c { public: template<int i> void fn(); };
-template<int i> void foo(c cv) { cv.fn<i>(); }
-template void foo<1>(c cv);],
-[gold_cv_c_membertemplates=yes], [gold_cv_c_membertemplates=no])])
-
-if test "$gold_cv_c_membertemplates" = "yes"; then
-  AC_DEFINE(HAVE_MEMBER_TEMPLATE_SPECIFICATIONS, [],
-    [Whether the C++ compiler can call a template member with no arguments])
-fi
-
 AC_LANG_POP(C++)
 
 AM_MAINTAINER_MODE
index bfcc78ae8d206fa8263b2d6eec3993e023e402c3..6c0a4b28a56811e7bfac37daf9b91df3054380f0 100644 (file)
@@ -1110,8 +1110,7 @@ Dynobj::sized_create_gnu_hash_table(
 
 template<int size, bool big_endian>
 unsigned char*
-Verdef::write(const Stringpool* dynpool, bool is_last, unsigned char* pb
-              ACCEPT_SIZE_ENDIAN) const
+Verdef::write(const Stringpool* dynpool, bool is_last, unsigned char* pb) const
 {
   const int verdef_size = elfcpp::Elf_sizes<size>::verdef_size;
   const int verdaux_size = elfcpp::Elf_sizes<size>::verdaux_size;
@@ -1190,7 +1189,7 @@ Verneed::finalize(unsigned int index)
 template<int size, bool big_endian>
 unsigned char*
 Verneed::write(const Stringpool* dynpool, bool is_last,
-              unsigned char* pb ACCEPT_SIZE_ENDIAN) const
+              unsigned char* pb) const
 {
   const int verneed_size = elfcpp::Elf_sizes<size>::verneed_size;
   const int vernaux_size = elfcpp::Elf_sizes<size>::vernaux_size;
@@ -1512,8 +1511,7 @@ Versions::symbol_section_contents(const Symbol_table* symtab,
                                  unsigned int local_symcount,
                                  const std::vector<Symbol*>& syms,
                                  unsigned char** pp,
-                                 unsigned int* psize
-                                  ACCEPT_SIZE_ENDIAN) const
+                                 unsigned int* psize) const
 {
   gold_assert(this->is_finalized_);
 
@@ -1553,8 +1551,7 @@ template<int size, bool big_endian>
 void
 Versions::def_section_contents(const Stringpool* dynpool,
                               unsigned char** pp, unsigned int* psize,
-                              unsigned int* pentries
-                               ACCEPT_SIZE_ENDIAN) const
+                              unsigned int* pentries) const
 {
   gold_assert(this->is_finalized_);
   gold_assert(!this->defs_.empty());
@@ -1579,9 +1576,9 @@ Versions::def_section_contents(const Stringpool* dynpool,
   for (p = this->defs_.begin(), i = 0;
        p != this->defs_.end();
        ++p, ++i)
-    pb = (*p)->write SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
-            dynpool, i + 1 >= this->defs_.size(), pb
-            SELECT_SIZE_ENDIAN(size, big_endian));
+    pb = (*p)->write<size, big_endian>(dynpool,
+                                      i + 1 >= this->defs_.size(),
+                                      pb);
 
   gold_assert(static_cast<unsigned int>(pb - pbuf) == sz);
 
@@ -1597,8 +1594,7 @@ template<int size, bool big_endian>
 void
 Versions::need_section_contents(const Stringpool* dynpool,
                                unsigned char** pp, unsigned int *psize,
-                               unsigned int *pentries
-                                ACCEPT_SIZE_ENDIAN) const
+                               unsigned int *pentries) const
 {
   gold_assert(this->is_finalized_);
   gold_assert(!this->needs_.empty());
@@ -1623,9 +1619,9 @@ Versions::need_section_contents(const Stringpool* dynpool,
   for (p = this->needs_.begin(), i = 0;
        p != this->needs_.end();
        ++p, ++i)
-    pb = (*p)->write SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
-           dynpool, i + 1 >= this->needs_.size(), pb
-            SELECT_SIZE_ENDIAN(size, big_endian));
+    pb = (*p)->write<size, big_endian>(dynpool,
+                                      i + 1 >= this->needs_.size(),
+                                      pb);
 
   gold_assert(static_cast<unsigned int>(pb - pbuf) == sz);
 
@@ -1666,8 +1662,7 @@ Versions::symbol_section_contents<32, false>(
     unsigned int,
     const std::vector<Symbol*>&,
     unsigned char**,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
@@ -1679,8 +1674,7 @@ Versions::symbol_section_contents<32, true>(
     unsigned int,
     const std::vector<Symbol*>&,
     unsigned char**,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
@@ -1692,8 +1686,7 @@ Versions::symbol_section_contents<64, false>(
     unsigned int,
     const std::vector<Symbol*>&,
     unsigned char**,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
@@ -1705,8 +1698,7 @@ Versions::symbol_section_contents<64, true>(
     unsigned int,
     const std::vector<Symbol*>&,
     unsigned char**,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_32_LITTLE
@@ -1716,8 +1708,7 @@ Versions::def_section_contents<32, false>(
     const Stringpool*,
     unsigned char**,
     unsigned int*,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
@@ -1727,8 +1718,7 @@ Versions::def_section_contents<32, true>(
     const Stringpool*,
     unsigned char**,
     unsigned int*,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
@@ -1738,8 +1728,7 @@ Versions::def_section_contents<64, false>(
     const Stringpool*,
     unsigned char**,
     unsigned int*,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
@@ -1749,8 +1738,7 @@ Versions::def_section_contents<64, true>(
     const Stringpool*,
     unsigned char**,
     unsigned int*,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_32_LITTLE
@@ -1760,8 +1748,7 @@ Versions::need_section_contents<32, false>(
     const Stringpool*,
     unsigned char**,
     unsigned int*,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(32, false)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_32_BIG
@@ -1771,8 +1758,7 @@ Versions::need_section_contents<32, true>(
     const Stringpool*,
     unsigned char**,
     unsigned int*,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(32, true)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_64_LITTLE
@@ -1782,8 +1768,7 @@ Versions::need_section_contents<64, false>(
     const Stringpool*,
     unsigned char**,
     unsigned int*,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(64, false)) const;
+    unsigned int*) const;
 #endif
 
 #ifdef HAVE_TARGET_64_BIG
@@ -1793,8 +1778,7 @@ Versions::need_section_contents<64, true>(
     const Stringpool*,
     unsigned char**,
     unsigned int*,
-    unsigned int*
-    ACCEPT_SIZE_ENDIAN_EXPLICIT(64, true)) const;
+    unsigned int*) const;
 #endif
 
 } // End namespace gold.
index cdfa9ce6dd93eb55c56f3673654e34a6eaf16f56..b55ae352591b59aad37df8864f652b45ca6db969 100644 (file)
@@ -365,8 +365,7 @@ class Verdef : public Version_base
   // Write contents to buffer.
   template<int size, bool big_endian>
   unsigned char*
-  write(const Stringpool*, bool is_last, unsigned char*
-        ACCEPT_SIZE_ENDIAN) const;
+  write(const Stringpool*, bool is_last, unsigned char*) const;
 
  private:
   Verdef(const Verdef&);
@@ -451,8 +450,7 @@ class Verneed
   // Write contents to buffer.
   template<int size, bool big_endian>
   unsigned char*
-  write(const Stringpool*, bool is_last, unsigned char*
-        ACCEPT_SIZE_ENDIAN) const;
+  write(const Stringpool*, bool is_last, unsigned char*) const;
 
  private:
   Verneed(const Verneed&);
@@ -508,24 +506,21 @@ class Versions
   symbol_section_contents(const Symbol_table*, const Stringpool*,
                          unsigned int local_symcount,
                          const std::vector<Symbol*>& syms,
-                         unsigned char**, unsigned int*
-                          ACCEPT_SIZE_ENDIAN) const;
+                         unsigned char**, unsigned int*) const;
 
   // Build an allocated buffer holding the contents of the version
   // definition section (.gnu.version_d).
   template<int size, bool big_endian>
   void
   def_section_contents(const Stringpool*, unsigned char**,
-                      unsigned int* psize, unsigned int* pentries
-                       ACCEPT_SIZE_ENDIAN) const;
+                      unsigned int* psize, unsigned int* pentries) const;
 
   // Build an allocated buffer holding the contents of the version
   // reference section (.gnu.version_r).
   template<int size, bool big_endian>
   void
   need_section_contents(const Stringpool*, unsigned char**,
-                       unsigned int* psize, unsigned int* pentries
-                        ACCEPT_SIZE_ENDIAN) const;
+                       unsigned int* psize, unsigned int* pentries) const;
 
   const Version_script_info&
   version_script() const
index 520f2e3c16f27f9e2506ac6767384cd077c7e808..ad26d46034b88af85791557c43fa35dffc11363e 100644 (file)
@@ -104,62 +104,6 @@ extern "C" ssize_t pread(int, void*, size_t, off_t);
 
 namespace gold
 {
-// This is a hack to work around a problem with older versions of g++.
-// The problem is that they don't support calling a member template by
-// specifying the template parameters.  It works to pass in an
-// argument for argument dependent lookup.
-
-// To use this, the member template method declaration should put
-// ACCEPT_SIZE or ACCEPT_SIZE_ENDIAN after the last parameter.  If the
-// method takes no parameters, use ACCEPT_SIZE_ONLY or
-// ACCEPT_SIZE_ENDIAN_ONLY.
-
-// When calling the method, instead of using fn<size>, use fn
-// SELECT_SIZE_NAME or SELECT_SIZE_ENDIAN_NAME.  And after the last
-// argument, put SELECT_SIZE(size) or SELECT_SIZE_ENDIAN(size,
-// big_endian).  If there is only one argment, use the _ONLY variants.
-
-#ifdef HAVE_MEMBER_TEMPLATE_SPECIFICATIONS
-
-#define SELECT_SIZE_NAME(size) <size>
-#define SELECT_SIZE(size)
-#define SELECT_SIZE_ONLY(size)
-#define ACCEPT_SIZE
-#define ACCEPT_SIZE_ONLY
-#define ACCEPT_SIZE_EXPLICIT(size)
-
-#define SELECT_SIZE_ENDIAN_NAME(size, big_endian) <size, big_endian>
-#define SELECT_SIZE_ENDIAN(size, big_endian)
-#define SELECT_SIZE_ENDIAN_ONLY(size, big_endian)
-#define ACCEPT_SIZE_ENDIAN
-#define ACCEPT_SIZE_ENDIAN_ONLY
-#define ACCEPT_SIZE_ENDIAN_EXPLICIT(size, big_endian)
-
-#else // !defined(HAVE_MEMBER_TEMPLATE_SPECIFICATIONS)
-
-template<int size>
-class Select_size { };
-template<int size, bool big_endian>
-class Select_size_endian { };
-
-#define SELECT_SIZE_NAME(size)
-#define SELECT_SIZE(size) , Select_size<size>()
-#define SELECT_SIZE_ONLY(size) Select_size<size>()
-#define ACCEPT_SIZE , Select_size<size>
-#define ACCEPT_SIZE_ONLY Select_size<size>
-#define ACCEPT_SIZE_EXPLICIT(size) , Select_size<size>
-
-#define SELECT_SIZE_ENDIAN_NAME(size, big_endian)
-#define SELECT_SIZE_ENDIAN(size, big_endian) \
-  , Select_size_endian<size, big_endian>()
-#define SELECT_SIZE_ENDIAN_ONLY(size, big_endian) \
-  Select_size_endian<size, big_endian>()
-#define ACCEPT_SIZE_ENDIAN , Select_size_endian<size, big_endian>
-#define ACCEPT_SIZE_ENDIAN_ONLY Select_size_endian<size, big_endian>
-#define ACCEPT_SIZE_ENDIAN_EXPLICIT(size, big_endian) \
-  , Select_size_endian<size, big_endian>
-
-#endif // !defined(HAVE_MEMBER_TEMPLATE_SPECIFICATIONS)
 
 // General declarations.
 
index 4303a2a8d9dfea63d6fa011f3d54081c6548f5c8..18faa4a74ba15aed5f6cab558c92aef91304beb5 100644 (file)
@@ -726,9 +726,7 @@ Target_i386::copy_reloc(const General_options* options,
                        Symbol* gsym,
                        const elfcpp::Rel<32, false>& rel)
 {
-  Sized_symbol<32>* ssym;
-  ssym = symtab->get_sized_symbol SELECT_SIZE_NAME(32) (gsym
-                                                       SELECT_SIZE(32));
+  Sized_symbol<32>* ssym = symtab->get_sized_symbol<32>(gsym);
 
   if (!Copy_relocs<32, false>::need_copy_reloc(options, object,
                                               data_shndx, ssym))
index b2fd9715feca0ac0d377d713282393ee166cfa66..97c13ea9d48d3a49ef8a830594dae763699b198c 100644 (file)
@@ -1985,34 +1985,30 @@ Layout::create_version_sections(const Versions* versions,
     {
 #ifdef HAVE_TARGET_32_LITTLE
     case Parameters::TARGET_32_LITTLE:
-      this->sized_create_version_sections
-          SELECT_SIZE_ENDIAN_NAME(32, false)(
-              versions, symtab, local_symcount, dynamic_symbols, dynstr
-              SELECT_SIZE_ENDIAN(32, false));
+      this->sized_create_version_sections<32, false>(versions, symtab,
+                                                    local_symcount,
+                                                    dynamic_symbols, dynstr);
       break;
 #endif
 #ifdef HAVE_TARGET_32_BIG
     case Parameters::TARGET_32_BIG:
-      this->sized_create_version_sections
-          SELECT_SIZE_ENDIAN_NAME(32, true)(
-              versions, symtab, local_symcount, dynamic_symbols, dynstr
-              SELECT_SIZE_ENDIAN(32, true));
+      this->sized_create_version_sections<32, true>(versions, symtab,
+                                                   local_symcount,
+                                                   dynamic_symbols, dynstr);
       break;
 #endif
 #ifdef HAVE_TARGET_64_LITTLE
     case Parameters::TARGET_64_LITTLE:
-      this->sized_create_version_sections
-          SELECT_SIZE_ENDIAN_NAME(64, false)(
-              versions, symtab, local_symcount, dynamic_symbols, dynstr
-              SELECT_SIZE_ENDIAN(64, false));
+      this->sized_create_version_sections<64, false>(versions, symtab,
+                                                    local_symcount,
+                                                    dynamic_symbols, dynstr);
       break;
 #endif
 #ifdef HAVE_TARGET_64_BIG
     case Parameters::TARGET_64_BIG:
-      this->sized_create_version_sections
-          SELECT_SIZE_ENDIAN_NAME(64, true)(
-              versions, symtab, local_symcount, dynamic_symbols, dynstr
-              SELECT_SIZE_ENDIAN(64, true));
+      this->sized_create_version_sections<64, true>(versions, symtab,
+                                                   local_symcount,
+                                                   dynamic_symbols, dynstr);
       break;
 #endif
     default:
@@ -2029,8 +2025,7 @@ Layout::sized_create_version_sections(
     const Symbol_table* symtab,
     unsigned int local_symcount,
     const std::vector<Symbol*>& dynamic_symbols,
-    const Output_section* dynstr
-    ACCEPT_SIZE_ENDIAN)
+    const Output_section* dynstr)
 {
   Output_section* vsec = this->choose_output_section(NULL, ".gnu.version",
                                                     elfcpp::SHT_GNU_versym,
@@ -2039,9 +2034,10 @@ Layout::sized_create_version_sections(
 
   unsigned char* vbuf;
   unsigned int vsize;
-  versions->symbol_section_contents SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
-      symtab, &this->dynpool_, local_symcount, dynamic_symbols, &vbuf, &vsize
-      SELECT_SIZE_ENDIAN(size, big_endian));
+  versions->symbol_section_contents<size, big_endian>(symtab, &this->dynpool_,
+                                                     local_symcount,
+                                                     dynamic_symbols,
+                                                     &vbuf, &vsize);
 
   Output_section_data* vdata = new Output_data_const_buffer(vbuf, vsize, 2);
 
@@ -2063,9 +2059,8 @@ Layout::sized_create_version_sections(
       unsigned char* vdbuf;
       unsigned int vdsize;
       unsigned int vdentries;
-      versions->def_section_contents SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
-          &this->dynpool_, &vdbuf, &vdsize, &vdentries
-          SELECT_SIZE_ENDIAN(size, big_endian));
+      versions->def_section_contents<size, big_endian>(&this->dynpool_, &vdbuf,
+                                                      &vdsize, &vdentries);
 
       Output_section_data* vddata = new Output_data_const_buffer(vdbuf,
                                                                 vdsize,
@@ -2090,9 +2085,9 @@ Layout::sized_create_version_sections(
       unsigned char* vnbuf;
       unsigned int vnsize;
       unsigned int vnentries;
-      versions->need_section_contents SELECT_SIZE_ENDIAN_NAME(size, big_endian)
-        (&this->dynpool_, &vnbuf, &vnsize, &vnentries
-         SELECT_SIZE_ENDIAN(size, big_endian));
+      versions->need_section_contents<size, big_endian>(&this->dynpool_,
+                                                       &vnbuf, &vnsize,
+                                                       &vnentries);
 
       Output_section_data* vndata = new Output_data_const_buffer(vnbuf,
                                                                 vnsize,
index d1caa2cb37305503c124e15f0a901dd8e14059e8..100518305e1683d9723508c54f2412a791e4a333 100644 (file)
@@ -434,8 +434,7 @@ class Layout
                                const Symbol_table*,
                                unsigned int local_symcount,
                                const std::vector<Symbol*>& dynamic_symbols,
-                               const Output_section* dynstr
-                                ACCEPT_SIZE_ENDIAN);
+                               const Output_section* dynstr);
 
   // Return whether to include this section in the link.
   template<int size, bool big_endian>
index 80047b0f6a3c67d796a7f667482e769ecb62cf9c..8a51550b37d6f43f0c7a669c78882d763837d633 100644 (file)
@@ -202,7 +202,7 @@ class Object
   // appropriate checked type.
   template<int size, bool big_endian>
   Sized_target<size, big_endian>*
-  sized_target(ACCEPT_SIZE_ENDIAN_ONLY) const;
+  sized_target() const;
 
   // Get the number of sections.
   unsigned int
@@ -457,7 +457,7 @@ class Object
 
 template<int size, bool big_endian>
 inline Sized_target<size, big_endian>*
-Object::sized_target(ACCEPT_SIZE_ENDIAN_ONLY) const
+Object::sized_target() const
 {
   gold_assert(this->target_->get_size() == size);
   gold_assert(this->target_->is_big_endian() ? big_endian : !big_endian);
@@ -1054,11 +1054,7 @@ class Sized_relobj : public Relobj
   // Return the appropriate Sized_target structure.
   Sized_target<size, big_endian>*
   sized_target()
-  {
-    return this->Object::sized_target
-      SELECT_SIZE_ENDIAN_NAME(size, big_endian) (
-          SELECT_SIZE_ENDIAN_ONLY(size, big_endian));
-  }
+  { return this->Object::sized_target<size, big_endian>(); }
 
   // Return the value of the local symbol symndx.
   Address
index 31a2531e48060b45e88b7178a4883d25029bee0e..622e98378621ef0b7ae1d1e444c765aa0722b22d 100644 (file)
@@ -1381,8 +1381,7 @@ template<int size, bool big_endian>
 void
 Output_data_dynamic::Dynamic_entry::write(
     unsigned char* pov,
-    const Stringpool* pool
-    ACCEPT_SIZE_ENDIAN) const
+    const Stringpool* pool) const
 {
   typename elfcpp::Elf_types<size>::Elf_WXword val;
   switch (this->classification_)
@@ -1500,8 +1499,7 @@ Output_data_dynamic::sized_write(Output_file* of)
        p != this->entries_.end();
        ++p)
     {
-      p->write SELECT_SIZE_ENDIAN_NAME(size, big_endian)(
-          pov, this->pool_ SELECT_SIZE_ENDIAN(size, big_endian));
+      p->write<size, big_endian>(pov, this->pool_);
       pov += dyn_size;
     }
 
@@ -2737,8 +2735,7 @@ unsigned char*
 Output_segment::write_section_headers(const Layout* layout,
                                      const Stringpool* secnamepool,
                                      unsigned char* v,
-                                     unsigned int *pshndx
-                                      ACCEPT_SIZE_ENDIAN) const
+                                     unsigned int *pshndx) const
 {
   // Every section that is attached to a segment must be attached to a
   // PT_LOAD segment, so we only write out section headers for PT_LOAD
@@ -2746,14 +2743,12 @@ Output_segment::write_section_headers(const Layout* layout,
   if (this->type_ != elfcpp::PT_LOAD)
     return v;
 
-  v = this->write_section_headers_list
-      SELECT_SIZE_ENDIAN_NAME(size, big_endian) (
-         layout, secnamepool, &this->output_data_, v, pshndx
-          SELECT_SIZE_ENDIAN(size, big_endian));
-  v = this->write_section_headers_list
-      SELECT_SIZE_ENDIAN_NAME(size, big_endian) (
-          layout, secnamepool, &this->output_bss_, v, pshndx
-          SELECT_SIZE_ENDIAN(size, big_endian));
+  v = this->write_section_headers_list<size, big_endian>(layout, secnamepool,
+                                                        &this->output_data_,
+                                                        v, pshndx);
+  v = this->write_section_headers_list<size, big_endian>(layout, secnamepool,
+                                                        &this->output_bss_,
+                                                        v, pshndx);
   return v;
 }
 
@@ -2763,8 +2758,7 @@ Output_segment::write_section_headers_list(const Layout* layout,
                                           const Stringpool* secnamepool,
                                           const Output_data_list* pdl,
                                           unsigned char* v,
-                                          unsigned int* pshndx
-                                           ACCEPT_SIZE_ENDIAN) const
+                                          unsigned int* pshndx) const
 {
   const int shdr_size = elfcpp::Elf_sizes<size>::shdr_size;
   for (Output_data_list::const_iterator p = pdl->begin();
index 8d0a853b3f0a5e4bca44817667c915ad3eec9a75..a004515dc9a0b63e468b2c4d74c81ae6a2504281 100644 (file)
@@ -1618,7 +1618,7 @@ class Output_data_dynamic : public Output_section_data
     // Write the dynamic entry to an output view.
     template<int size, bool big_endian>
     void
-    write(unsigned char* pov, const Stringpool* ACCEPT_SIZE_ENDIAN) const;
+    write(unsigned char* pov, const Stringpool*) const;
 
    private:
     enum Classification
@@ -2607,7 +2607,7 @@ class Output_segment
   template<int size, bool big_endian>
   unsigned char*
   write_section_headers(const Layout*, const Stringpool*, unsigned char* v,
-                       unsigned int* pshndx ACCEPT_SIZE_ENDIAN) const;
+                       unsigned int* pshndx) const;
 
  private:
   Output_segment(const Output_segment&);
@@ -2649,7 +2649,7 @@ class Output_segment
   unsigned char*
   write_section_headers_list(const Layout*, const Stringpool*,
                             const Output_data_list*, unsigned char* v,
-                            unsigned int* pshdx ACCEPT_SIZE_ENDIAN) const;
+                            unsigned int* pshdx) const;
 
   // The list of output data with contents attached to this segment.
   Output_data_list output_data_;
index c244ad42a94ab11195f7944e63e9e22c685bc62c..330000099f132ef3754dabe44fa8305d9f947adc 100644 (file)
@@ -85,16 +85,13 @@ Symbol_table::override(Sized_symbol<size>* tosym,
     {
       Symbol* sym = this->weak_aliases_[tosym];
       gold_assert(sym != NULL);
-      Sized_symbol<size>* ssym;
-      ssym = this->get_sized_symbol SELECT_SIZE_NAME(size) (sym
-                                                           SELECT_SIZE(size));
+      Sized_symbol<size>* ssym = this->get_sized_symbol<size>(sym);
       do
        {
          ssym->override(fromsym, object, version);
          sym = this->weak_aliases_[ssym];
          gold_assert(sym != NULL);
-         ssym = this->get_sized_symbol SELECT_SIZE_NAME(size) (
-                                               sym SELECT_SIZE(size));
+         ssym = this->get_sized_symbol<size>(sym);
        }
       while (ssym != tosym);
     }
@@ -194,9 +191,7 @@ Symbol_table::resolve(Sized_symbol<size>* to,
   if (object->target()->has_resolve())
     {
       Sized_target<size, big_endian>* sized_target;
-      sized_target = object->sized_target
-                     SELECT_SIZE_ENDIAN_NAME(size, big_endian) (
-                         SELECT_SIZE_ENDIAN_ONLY(size, big_endian));
+      sized_target = object->sized_target<size, big_endian>();
       sized_target->resolve(to, sym, object, version);
       return;
     }
@@ -715,16 +710,13 @@ Symbol_table::override_with_special(Sized_symbol<size>* tosym,
     {
       Symbol* sym = this->weak_aliases_[tosym];
       gold_assert(sym != NULL);
-      Sized_symbol<size>* ssym;
-      ssym = this->get_sized_symbol SELECT_SIZE_NAME(size) (sym
-                                                           SELECT_SIZE(size));
+      Sized_symbol<size>* ssym = this->get_sized_symbol<size>(sym);
       do
        {
          ssym->override_with_special(fromsym);
          sym = this->weak_aliases_[ssym];
          gold_assert(sym != NULL);
-         ssym = this->get_sized_symbol SELECT_SIZE_NAME(size) (
-                                               sym SELECT_SIZE(size));
+         ssym = this->get_sized_symbol<size>(sym);
        }
       while (ssym != tosym);
     }
index cb2a798f7888fd09ce2254b31d29ec9ff2fb8005..1232d0573ca69dcad8d616ace52a511e79c1b228 100644 (file)
@@ -444,7 +444,7 @@ Symbol_table::lookup(const char* name, const char* version) const
 template<int size, bool big_endian>
 void
 Symbol_table::resolve(Sized_symbol<size>* to, const Sized_symbol<size>* from,
-                     const char* version ACCEPT_SIZE_ENDIAN)
+                     const char* version)
 {
   unsigned char buf[elfcpp::Elf_sizes<size>::sym_size];
   elfcpp::Sym_write<size, big_endian> esym(buf);
@@ -542,8 +542,7 @@ Symbol_table::add_from_object(Object* object,
   if (!ins.second)
     {
       // We already have an entry for NAME/VERSION.
-      ret = this->get_sized_symbol SELECT_SIZE_NAME(size) (ins.first->second
-                                                           SELECT_SIZE(size));
+      ret = this->get_sized_symbol<size>(ins.first->second);
       gold_assert(ret != NULL);
 
       was_undefined = ret->is_undefined();
@@ -572,11 +571,8 @@ Symbol_table::add_from_object(Object* object,
              // object.
 
              const Sized_symbol<size>* sym2;
-             sym2 = this->get_sized_symbol SELECT_SIZE_NAME(size) (
-               insdef.first->second
-                SELECT_SIZE(size));
-             Symbol_table::resolve SELECT_SIZE_ENDIAN_NAME(size, big_endian) (
-               ret, sym2, version SELECT_SIZE_ENDIAN(size, big_endian));
+             sym2 = this->get_sized_symbol<size>(insdef.first->second);
+             Symbol_table::resolve<size, big_endian>(ret, sym2, version);
              this->make_forwarder(insdef.first->second, ret);
              insdef.first->second = ret;
            }
@@ -594,17 +590,14 @@ Symbol_table::add_from_object(Object* object,
        {
          // We already have an entry for NAME/NULL.  If we override
          // it, then change it to NAME/VERSION.
-         ret = this->get_sized_symbol SELECT_SIZE_NAME(size) (
-              insdef.first->second
-              SELECT_SIZE(size));
+         ret = this->get_sized_symbol<size>(insdef.first->second);
          this->resolve(ret, sym, orig_sym, object, version);
          ins.first->second = ret;
        }
       else
        {
          Sized_target<size, big_endian>* target =
-           object->sized_target SELECT_SIZE_ENDIAN_NAME(size, big_endian) (
-               SELECT_SIZE_ENDIAN_ONLY(size, big_endian));
+           object->sized_target<size, big_endian>();
          if (!target->has_make_symbol())
            ret = new Sized_symbol<size>();
          else
@@ -1029,8 +1022,7 @@ template<int size, bool big_endian>
 Sized_symbol<size>*
 Symbol_table::define_special_symbol(const char** pname, const char** pversion,
                                    bool only_if_ref,
-                                    Sized_symbol<size>** poldsym
-                                    ACCEPT_SIZE_ENDIAN)
+                                    Sized_symbol<size>** poldsym)
 {
   Symbol* oldsym;
   Sized_symbol<size>* sym;
@@ -1107,8 +1099,7 @@ Symbol_table::define_special_symbol(const char** pname, const char** pversion,
   else
     gold_assert(oldsym != NULL);
 
-  *poldsym = this->get_sized_symbol SELECT_SIZE_NAME(size) (oldsym
-                                                            SELECT_SIZE(size));
+  *poldsym = this->get_sized_symbol<size>(oldsym);
 
   return sym;
 }
@@ -1179,9 +1170,8 @@ Symbol_table::do_define_in_output_data(
   if (parameters->target().is_big_endian())
     {
 #if defined(HAVE_TARGET_32_BIG) || defined(HAVE_TARGET_64_BIG)
-      sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, true) (
-          &name, &version, only_if_ref, &oldsym
-          SELECT_SIZE_ENDIAN(size, true));
+      sym = this->define_special_symbol<size, true>(&name, &version,
+                                                   only_if_ref, &oldsym);
 #else
       gold_unreachable();
 #endif
@@ -1189,9 +1179,8 @@ Symbol_table::do_define_in_output_data(
   else
     {
 #if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_64_LITTLE)
-      sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, false) (
-          &name, &version, only_if_ref, &oldsym
-          SELECT_SIZE_ENDIAN(size, false));
+      sym = this->define_special_symbol<size, false>(&name, &version,
+                                                    only_if_ref, &oldsym);
 #else
       gold_unreachable();
 #endif
@@ -1281,9 +1270,8 @@ Symbol_table::do_define_in_output_segment(
   if (parameters->target().is_big_endian())
     {
 #if defined(HAVE_TARGET_32_BIG) || defined(HAVE_TARGET_64_BIG)
-      sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, true) (
-          &name, &version, only_if_ref, &oldsym
-          SELECT_SIZE_ENDIAN(size, true));
+      sym = this->define_special_symbol<size, true>(&name, &version,
+                                                   only_if_ref, &oldsym);
 #else
       gold_unreachable();
 #endif
@@ -1291,9 +1279,8 @@ Symbol_table::do_define_in_output_segment(
   else
     {
 #if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_64_LITTLE)
-      sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, false) (
-          &name, &version, only_if_ref, &oldsym
-          SELECT_SIZE_ENDIAN(size, false));
+      sym = this->define_special_symbol<size, false>(&name, &version,
+                                                    only_if_ref, &oldsym);
 #else
       gold_unreachable();
 #endif
@@ -1383,9 +1370,8 @@ Symbol_table::do_define_as_constant(
   if (parameters->target().is_big_endian())
     {
 #if defined(HAVE_TARGET_32_BIG) || defined(HAVE_TARGET_64_BIG)
-      sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, true) (
-          &name, &version, only_if_ref, &oldsym
-          SELECT_SIZE_ENDIAN(size, true));
+      sym = this->define_special_symbol<size, true>(&name, &version,
+                                                   only_if_ref, &oldsym);
 #else
       gold_unreachable();
 #endif
@@ -1393,9 +1379,8 @@ Symbol_table::do_define_as_constant(
   else
     {
 #if defined(HAVE_TARGET_32_LITTLE) || defined(HAVE_TARGET_64_LITTLE)
-      sym = this->define_special_symbol SELECT_SIZE_ENDIAN_NAME(size, false) (
-          &name, &version, only_if_ref, &oldsym
-          SELECT_SIZE_ENDIAN(size, false));
+      sym = this->define_special_symbol<size, false>(&name, &version,
+                                                    only_if_ref, &oldsym);
 #else
       gold_unreachable();
 #endif
@@ -1964,9 +1949,8 @@ Symbol_table::sized_write_globals(const Input_objects* input_objects,
          sym_index -= first_global_index;
          gold_assert(sym_index < output_count);
          unsigned char* ps = psyms + (sym_index * sym_size);
-         this->sized_write_symbol SELECT_SIZE_ENDIAN_NAME(size, big_endian) (
-             sym, sym_value, shndx, sympool, ps
-              SELECT_SIZE_ENDIAN(size, big_endian));
+         this->sized_write_symbol<size, big_endian>(sym, sym_value, shndx,
+                                                    sympool, ps);
        }
 
       if (dynsym_index != -1U)
@@ -1974,9 +1958,8 @@ Symbol_table::sized_write_globals(const Input_objects* input_objects,
          dynsym_index -= first_dynamic_global_index;
          gold_assert(dynsym_index < dynamic_count);
          unsigned char* pd = dynamic_view + (dynsym_index * sym_size);
-         this->sized_write_symbol SELECT_SIZE_ENDIAN_NAME(size, big_endian) (
-             sym, dynsym_value, shndx, dynpool, pd
-              SELECT_SIZE_ENDIAN(size, big_endian));
+         this->sized_write_symbol<size, big_endian>(sym, dynsym_value, shndx,
+                                                    dynpool, pd);
        }
     }
 
@@ -1995,8 +1978,7 @@ Symbol_table::sized_write_symbol(
     typename elfcpp::Elf_types<size>::Elf_Addr value,
     unsigned int shndx,
     const Stringpool* pool,
-    unsigned char* p
-    ACCEPT_SIZE_ENDIAN) const
+    unsigned char* p) const
 {
   elfcpp::Sym_write<size, big_endian> osym(p);
   osym.put_st_name(pool->get_offset(sym->name()));
index 9a54187821ab17fff665d3a4416d214f14790dfd..c8a5d86e0cb32a7c0f5de8fe14e97c6a391ab791 100644 (file)
@@ -1112,11 +1112,11 @@ class Symbol_table
   // Return the sized version of a symbol in this table.
   template<int size>
   Sized_symbol<size>*
-  get_sized_symbol(Symbol* ACCEPT_SIZE) const;
+  get_sized_symbol(Symbol*) const;
 
   template<int size>
   const Sized_symbol<size>*
-  get_sized_symbol(const Symbol* ACCEPT_SIZE) const;
+  get_sized_symbol(const Symbol*) const;
 
   // Return the count of undefined symbols seen.
   int
@@ -1224,7 +1224,7 @@ class Symbol_table
   template<int size, bool big_endian>
   void
   resolve(Sized_symbol<size>* to, const Sized_symbol<size>* from,
-          const char* version ACCEPT_SIZE_ENDIAN);
+          const char* version);
 
   // Record that a symbol is forced to be local by a version script.
   void
@@ -1262,8 +1262,7 @@ class Symbol_table
   template<int size, bool big_endian>
   Sized_symbol<size>*
   define_special_symbol(const char** pname, const char** pversion,
-                       bool only_if_ref, Sized_symbol<size>** poldsym
-                       ACCEPT_SIZE_ENDIAN);
+                       bool only_if_ref, Sized_symbol<size>** poldsym);
 
   // Define a symbol in an Output_data, sized version.
   template<int size>
@@ -1335,8 +1334,7 @@ class Symbol_table
   sized_write_symbol(Sized_symbol<size>*,
                     typename elfcpp::Elf_types<size>::Elf_Addr value,
                     unsigned int shndx,
-                    const Stringpool*, unsigned char* p
-                     ACCEPT_SIZE_ENDIAN) const;
+                    const Stringpool*, unsigned char* p) const;
 
   // Possibly warn about an undefined symbol from a dynamic object.
   void
@@ -1458,7 +1456,7 @@ class Symbol_table
 
 template<int size>
 Sized_symbol<size>*
-Symbol_table::get_sized_symbol(Symbol* sym ACCEPT_SIZE) const
+Symbol_table::get_sized_symbol(Symbol* sym) const
 {
   gold_assert(size == parameters->target().get_size());
   return static_cast<Sized_symbol<size>*>(sym);
@@ -1466,7 +1464,7 @@ Symbol_table::get_sized_symbol(Symbol* sym ACCEPT_SIZE) const
 
 template<int size>
 const Sized_symbol<size>*
-Symbol_table::get_sized_symbol(const Symbol* sym ACCEPT_SIZE) const
+Symbol_table::get_sized_symbol(const Symbol* sym) const
 {
   gold_assert(size == parameters->target().get_size());
   return static_cast<const Sized_symbol<size>*>(sym);
index 257be6529b01b1198b17333a1a9450b50cc4afc4..584303d14a436064f4922b683acd136781e990cc 100644 (file)
@@ -683,9 +683,7 @@ Target_x86_64::copy_reloc(const General_options* options,
                           Symbol* gsym,
                           const elfcpp::Rela<64, false>& rela)
 {
-  Sized_symbol<64>* ssym;
-  ssym = symtab->get_sized_symbol SELECT_SIZE_NAME(64) (gsym
-                                                       SELECT_SIZE(64));
+  Sized_symbol<64>* ssym = symtab->get_sized_symbol<64>(gsym);
 
   if (!Copy_relocs<64, false>::need_copy_reloc(options, object,
                                               data_shndx, ssym))
This page took 0.044265 seconds and 4 git commands to generate.