Add -Wshadow to the gcc command line options used when compiling the binutils.
[deliverable/binutils-gdb.git] / gold / sparc.cc
index d15b8339f693da3c0ddcc161653164ffcb9272b5..43c6e34b0b9ccb09bde296df9e7cee4604eaea7d 100644 (file)
@@ -40,6 +40,7 @@
 #include "target-select.h"
 #include "tls.h"
 #include "errors.h"
+#include "gc.h"
 
 namespace
 {
@@ -66,8 +67,7 @@ class Target_sparc : public Sized_target<size, big_endian>
   // Process the relocations to determine unreferenced sections for 
   // garbage collection.
   void
-  gc_process_relocs(const General_options& options,
-                   Symbol_table* symtab,
+  gc_process_relocs(Symbol_table* symtab,
                    Layout* layout,
                    Sized_relobj<size, big_endian>* object,
                    unsigned int data_shndx,
@@ -81,8 +81,7 @@ class Target_sparc : public Sized_target<size, big_endian>
 
   // Scan the relocations to look for symbol adjustments.
   void
-  scan_relocs(const General_options& options,
-             Symbol_table* symtab,
+  scan_relocs(Symbol_table* symtab,
              Layout* layout,
              Sized_relobj<size, big_endian>* object,
              unsigned int data_shndx,
@@ -95,7 +94,7 @@ class Target_sparc : public Sized_target<size, big_endian>
              const unsigned char* plocal_symbols);
   // Finalize the sections.
   void
-  do_finalize_sections(Layout*);
+  do_finalize_sections(Layout*, const Input_objects*, Symbol_table*);
 
   // Return the value to use for a dynamic which requires special
   // treatment.
@@ -112,12 +111,12 @@ class Target_sparc : public Sized_target<size, big_endian>
                   bool needs_special_offset_handling,
                   unsigned char* view,
                   typename elfcpp::Elf_types<size>::Elf_Addr view_address,
-                  section_size_type view_size);
+                  section_size_type view_size,
+                  const Reloc_symbol_changes*);
 
   // Scan the relocs during a relocatable link.
   void
-  scan_relocatable_relocs(const General_options& options,
-                         Symbol_table* symtab,
+  scan_relocatable_relocs(Symbol_table* symtab,
                          Layout* layout,
                          Sized_relobj<size, big_endian>* object,
                          unsigned int data_shndx,
@@ -179,8 +178,7 @@ class Target_sparc : public Sized_target<size, big_endian>
     { }
 
     inline void
-    local(const General_options& options, Symbol_table* symtab,
-         Layout* layout, Target_sparc* target,
+    local(Symbol_table* symtab, Layout* layout, Target_sparc* target,
          Sized_relobj<size, big_endian>* object,
          unsigned int data_shndx,
          Output_section* output_section,
@@ -188,8 +186,7 @@ class Target_sparc : public Sized_target<size, big_endian>
          const elfcpp::Sym<size, big_endian>& lsym);
 
     inline void
-    global(const General_options& options, Symbol_table* symtab,
-          Layout* layout, Target_sparc* target,
+    global(Symbol_table* symtab, Layout* layout, Target_sparc* target,
           Sized_relobj<size, big_endian>* object,
           unsigned int data_shndx,
           Output_section* output_section,
@@ -305,17 +302,6 @@ class Target_sparc : public Sized_target<size, big_endian>
   Reloc_section*
   rela_dyn_section(Layout*);
 
-  // Return true if the symbol may need a COPY relocation.
-  // References from an executable object to non-function symbols
-  // defined in a dynamic object may need a COPY relocation.
-  bool
-  may_need_copy_reloc(Symbol* gsym)
-  {
-    return (!parameters->options().shared()
-            && gsym->is_from_dynobj()
-            && gsym->type() != elfcpp::STT_FUNC);
-  }
-
   // Copy a relocation against a global symbol.
   void
   copy_reloc(Symbol_table* symtab, Layout* layout,
@@ -371,7 +357,13 @@ Target::Target_info Target_sparc<32, true>::sparc_info =
   "/usr/lib/ld.so.1",  // dynamic_linker
   0x00010000,          // default_text_segment_address
   64 * 1024,           // abi_pagesize (overridable by -z max-page-size)
-  8 * 1024             // common_pagesize (overridable by -z common-page-size)
+  8 * 1024,            // common_pagesize (overridable by -z common-page-size)
+  elfcpp::SHN_UNDEF,   // small_common_shndx
+  elfcpp::SHN_UNDEF,   // large_common_shndx
+  0,                   // small_common_section_flags
+  0,                   // large_common_section_flags
+  NULL,                        // attributes_section
+  NULL                 // attributes_vendor
 };
 
 template<>
@@ -388,7 +380,13 @@ Target::Target_info Target_sparc<64, true>::sparc_info =
   "/usr/lib/sparcv9/ld.so.1",  // dynamic_linker
   0x100000,            // default_text_segment_address
   64 * 1024,           // abi_pagesize (overridable by -z max-page-size)
-  8 * 1024             // common_pagesize (overridable by -z common-page-size)
+  8 * 1024,            // common_pagesize (overridable by -z common-page-size)
+  elfcpp::SHN_UNDEF,   // small_common_shndx
+  elfcpp::SHN_UNDEF,   // large_common_shndx
+  0,                   // small_common_section_flags
+  0,                   // large_common_section_flags
+  NULL,                        // attributes_section
+  NULL                 // attributes_vendor
 };
 
 // We have to take care here, even when operating in little-endian
@@ -403,13 +401,13 @@ private:
   rela(unsigned char* view,
        unsigned int right_shift,
        typename elfcpp::Elf_types<valsize>::Elf_Addr dst_mask,
-       typename elfcpp::Swap<size, big_endian>::Valtype value,
+       typename elfcpp::Swap<size, big_endian>::Valtype avalue,
        typename elfcpp::Swap<size, big_endian>::Valtype addend)
   {
     typedef typename elfcpp::Swap<valsize, big_endian>::Valtype Valtype;
     Valtype* wv = reinterpret_cast<Valtype*>(view);
     Valtype val = elfcpp::Swap<valsize, big_endian>::readval(wv);
-    Valtype reloc = ((value + addend) >> right_shift);
+    Valtype reloc = ((avalue + addend) >> right_shift);
 
     val &= ~dst_mask;
     reloc &= dst_mask;
@@ -591,10 +589,10 @@ public:
   // R_SPARC_HI22: (Symbol + Addend) >> 10
   static inline void
   hi22(unsigned char* view,
-       typename elfcpp::Elf_types<size>::Elf_Addr value,
+       typename elfcpp::Elf_types<size>::Elf_Addr avalue,
        typename elfcpp::Elf_types<size>::Elf_Addr addend)
   {
-    This_insn::template rela<32>(view, 10, 0x003fffff, value, addend);
+    This_insn::template rela<32>(view, 10, 0x003fffff, avalue, addend);
   }
 
   // R_SPARC_HI22: (Symbol + Addend) >> 10
@@ -622,10 +620,10 @@ public:
   // R_SPARC_LO10: (Symbol + Addend) & 0x3ff
   static inline void
   lo10(unsigned char* view,
-       typename elfcpp::Elf_types<size>::Elf_Addr value,
+       typename elfcpp::Elf_types<size>::Elf_Addr avalue,
        typename elfcpp::Elf_types<size>::Elf_Addr addend)
   {
-    This_insn::template rela<32>(view, 0, 0x000003ff, value, addend);
+    This_insn::template rela<32>(view, 0, 0x000003ff, avalue, addend);
   }
 
   // R_SPARC_LO10: (Symbol + Addend) & 0x3ff
@@ -684,10 +682,10 @@ public:
   // R_SPARC_13: (Symbol + Addend)
   static inline void
   rela32_13(unsigned char* view,
-           typename elfcpp::Elf_types<size>::Elf_Addr value,
+           typename elfcpp::Elf_types<size>::Elf_Addr avalue,
            typename elfcpp::Elf_types<size>::Elf_Addr addend)
   {
-    This_insn::template rela<32>(view, 0, 0x00001fff, value, addend);
+    This_insn::template rela<32>(view, 0, 0x00001fff, avalue, addend);
   }
 
   // R_SPARC_13: (Symbol + Addend)
@@ -906,22 +904,22 @@ public:
   // R_SPARC_TLS_LDO_HIX22: @dtpoff(Symbol + Addend) >> 10
   static inline void
   ldo_hix22(unsigned char* view,
-           typename elfcpp::Elf_types<size>::Elf_Addr value,
+           typename elfcpp::Elf_types<size>::Elf_Addr avalue,
            typename elfcpp::Elf_types<size>::Elf_Addr addend)
   {
-    This_insn::hi22(view, value, addend);
+    This_insn::hi22(view, avalue, addend);
   }
 
   // R_SPARC_TLS_LDO_LOX10: @dtpoff(Symbol + Addend) & 0x3ff
   static inline void
   ldo_lox10(unsigned char* view,
-           typename elfcpp::Elf_types<size>::Elf_Addr value,
+           typename elfcpp::Elf_types<size>::Elf_Addr avalue,
            typename elfcpp::Elf_types<size>::Elf_Addr addend)
   {
     typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
     Valtype* wv = reinterpret_cast<Valtype*>(view);
     Valtype val = elfcpp::Swap<32, true>::readval(wv);
-    Valtype reloc = (value + addend);
+    Valtype reloc = (avalue + addend);
 
     val &= ~0x1fff;
     reloc &= 0x3ff;
@@ -932,13 +930,13 @@ public:
   // R_SPARC_TLS_LE_HIX22: (@tpoff(Symbol + Addend) ^ 0xffffffffffffffff) >> 10
   static inline void
   hix22(unsigned char* view,
-       typename elfcpp::Elf_types<size>::Elf_Addr value,
+       typename elfcpp::Elf_types<size>::Elf_Addr avalue,
        typename elfcpp::Elf_types<size>::Elf_Addr addend)
   {
     typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
     Valtype* wv = reinterpret_cast<Valtype*>(view);
     Valtype val = elfcpp::Swap<32, true>::readval(wv);
-    Valtype reloc = (value + addend);
+    Valtype reloc = (avalue + addend);
 
     val &= ~0x3fffff;
 
@@ -976,13 +974,13 @@ public:
   // R_SPARC_TLS_LE_LOX10: (@tpoff(Symbol + Addend) & 0x3ff) | 0x1c00
   static inline void
   lox10(unsigned char* view,
-       typename elfcpp::Elf_types<size>::Elf_Addr value,
+       typename elfcpp::Elf_types<size>::Elf_Addr avalue,
        typename elfcpp::Elf_types<size>::Elf_Addr addend)
   {
     typedef typename elfcpp::Swap<32, true>::Valtype Valtype;
     Valtype* wv = reinterpret_cast<Valtype*>(view);
     Valtype val = elfcpp::Swap<32, true>::readval(wv);
-    Valtype reloc = (value + addend);
+    Valtype reloc = (avalue + addend);
 
     val &= ~0x1fff;
     reloc &= 0x3ff;
@@ -1028,7 +1026,7 @@ Target_sparc<size, big_endian>::got_section(Symbol_table* symtab,
       os = layout->add_output_section_data(".got", elfcpp::SHT_PROGBITS,
                                           (elfcpp::SHF_ALLOC
                                            | elfcpp::SHF_WRITE),
-                                          this->got_);
+                                          this->got_, false);
       os->set_is_relro();
 
       // Define _GLOBAL_OFFSET_TABLE_ at the start of the .got section.
@@ -1054,7 +1052,7 @@ Target_sparc<size, big_endian>::rela_dyn_section(Layout* layout)
       gold_assert(layout != NULL);
       this->rela_dyn_ = new Reloc_section(parameters->options().combreloc());
       layout->add_output_section_data(".rela.dyn", elfcpp::SHT_RELA,
-                                     elfcpp::SHF_ALLOC, this->rela_dyn_);
+                                     elfcpp::SHF_ALLOC, this->rela_dyn_, true);
     }
   return this->rela_dyn_;
 }
@@ -1156,7 +1154,7 @@ Output_data_plt_sparc<size, big_endian>::Output_data_plt_sparc(Layout* layout)
 {
   this->rel_ = new Reloc_section(false);
   layout->add_output_section_data(".rela.plt", elfcpp::SHT_RELA,
-                                 elfcpp::SHF_ALLOC, this->rel_);
+                                 elfcpp::SHF_ALLOC, this->rel_, true);
 }
 
 template<int size, bool big_endian>
@@ -1222,10 +1220,10 @@ template<int size, bool big_endian>
 void
 Output_data_plt_sparc<size, big_endian>::do_write(Output_file* of)
 {
-  const off_t offset = this->offset();
+  const off_t off = this->offset();
   const section_size_type oview_size =
     convert_to_section_size_type(this->data_size());
-  unsigned char* const oview = of->get_output_view(offset, oview_size);
+  unsigned char* const oview = of->get_output_view(off, oview_size);
   unsigned char* pov = oview;
 
   memset(pov, 0, base_plt_entry_size * 4);
@@ -1349,7 +1347,7 @@ Output_data_plt_sparc<size, big_endian>::do_write(Output_file* of)
 
   gold_assert(static_cast<section_size_type>(pov - oview) == oview_size);
 
-  of->write_output_view(offset, oview_size, oview);
+  of->write_output_view(off, oview_size, oview);
 }
 
 // Create a PLT entry for a global symbol.
@@ -1373,7 +1371,7 @@ Target_sparc<size, big_endian>::make_plt_entry(Symbol_table* symtab,
                                      (elfcpp::SHF_ALLOC
                                       | elfcpp::SHF_EXECINSTR
                                       | elfcpp::SHF_WRITE),
-                                     this->plt_);
+                                     this->plt_, false);
 
       // Define _PROCEDURE_LINKAGE_TABLE_ at the start of the .plt section.
       symtab->define_in_output_data("_PROCEDURE_LINKAGE_TABLE_", NULL,
@@ -1601,7 +1599,6 @@ Target_sparc<size, big_endian>::Scan::check_non_pic(Relobj* object, unsigned int
 template<int size, bool big_endian>
 inline void
 Target_sparc<size, big_endian>::Scan::local(
-                       const General_options&,
                        Symbol_table* symtab,
                        Layout* layout,
                        Target_sparc<size, big_endian>* target,
@@ -1903,7 +1900,6 @@ Target_sparc<size, big_endian>::Scan::unsupported_reloc_global(
 template<int size, bool big_endian>
 inline void
 Target_sparc<size, big_endian>::Scan::global(
-                               const General_options&,
                                Symbol_table* symtab,
                                Layout* layout,
                                Target_sparc<size, big_endian>* target,
@@ -1976,7 +1972,7 @@ Target_sparc<size, big_endian>::Scan::global(
          flags |= Symbol::FUNCTION_CALL;
        if (gsym->needs_dynamic_reloc(flags))
          {
-           if (target->may_need_copy_reloc(gsym))
+           if (gsym->may_need_copy_reloc())
              {
                target->copy_reloc(symtab, layout, object,
                                   data_shndx, output_section, gsym,
@@ -2032,7 +2028,7 @@ Target_sparc<size, big_endian>::Scan::global(
         // Make a dynamic relocation if necessary.
         if (gsym->needs_dynamic_reloc(Symbol::ABSOLUTE_REF))
           {
-            if (target->may_need_copy_reloc(gsym))
+            if (gsym->may_need_copy_reloc())
               {
                target->copy_reloc(symtab, layout, object,
                                   data_shndx, output_section, gsym, reloc);
@@ -2251,7 +2247,6 @@ Target_sparc<size, big_endian>::Scan::global(
 template<int size, bool big_endian>
 void
 Target_sparc<size, big_endian>::gc_process_relocs(
-                       const General_options& options,
                        Symbol_table* symtab,
                        Layout* layout,
                        Sized_relobj<size, big_endian>* object,
@@ -2265,10 +2260,9 @@ Target_sparc<size, big_endian>::gc_process_relocs(
                        const unsigned char* plocal_symbols)
 {
   typedef Target_sparc<size, big_endian> Sparc;
-  typedef typename Target_sparc<size, big_endian>::Scan Scan;
+  typedef typename Target_sparc<size, big_endian>::Scan scan;
 
-  gold::gc_process_relocs<size, big_endian, Sparc, elfcpp::SHT_RELA, Scan>(
-    options,
+  gold::gc_process_relocs<size, big_endian, Sparc, elfcpp::SHT_RELA, scan>(
     symtab,
     layout,
     this,
@@ -2287,7 +2281,6 @@ Target_sparc<size, big_endian>::gc_process_relocs(
 template<int size, bool big_endian>
 void
 Target_sparc<size, big_endian>::scan_relocs(
-                       const General_options& options,
                        Symbol_table* symtab,
                        Layout* layout,
                        Sized_relobj<size, big_endian>* object,
@@ -2301,7 +2294,7 @@ Target_sparc<size, big_endian>::scan_relocs(
                        const unsigned char* plocal_symbols)
 {
   typedef Target_sparc<size, big_endian> Sparc;
-  typedef typename Target_sparc<size, big_endian>::Scan Scan;
+  typedef typename Target_sparc<size, big_endian>::Scan scan;
 
   if (sh_type == elfcpp::SHT_REL)
     {
@@ -2310,8 +2303,7 @@ Target_sparc<size, big_endian>::scan_relocs(
       return;
     }
 
-  gold::scan_relocs<size, big_endian, Sparc, elfcpp::SHT_RELA, Scan>(
-    options,
+  gold::scan_relocs<size, big_endian, Sparc, elfcpp::SHT_RELA, scan>(
     symtab,
     layout,
     this,
@@ -2329,13 +2321,17 @@ Target_sparc<size, big_endian>::scan_relocs(
 
 template<int size, bool big_endian>
 void
-Target_sparc<size, big_endian>::do_finalize_sections(Layout* layout)
+Target_sparc<size, big_endian>::do_finalize_sections(
+    Layout* layout,
+    const Input_objects*,
+    Symbol_table*)
 {
   // Fill in some more dynamic tags.
   Output_data_dynamic* const odyn = layout->dynamic_data();
   if (odyn != NULL)
     {
-      if (this->plt_ != NULL)
+      if (this->plt_ != NULL
+         && this->plt_->output_section() != NULL)
        {
          const Output_data* od = this->plt_->rel_plt();
          odyn->add_section_size(elfcpp::DT_PLTRELSZ, od);
@@ -2345,7 +2341,8 @@ Target_sparc<size, big_endian>::do_finalize_sections(Layout* layout)
          odyn->add_section_address(elfcpp::DT_PLTGOT, this->plt_);
        }
 
-      if (this->rela_dyn_ != NULL)
+      if (this->rela_dyn_ != NULL
+         && this->rela_dyn_->output_section() != NULL)
        {
          const Output_data* od = this->rela_dyn_;
          odyn->add_section_address(elfcpp::DT_RELA, od);
@@ -2418,11 +2415,11 @@ Target_sparc<size, big_endian>::Relocate::relocate(
                              || r_type == elfcpp::R_SPARC_WDISP19
                              || r_type == elfcpp::R_SPARC_WDISP16))
     {
-      elfcpp::Elf_Xword value;
+      elfcpp::Elf_Xword avalue;
 
-      value = target->plt_section()->address() + gsym->plt_offset();
+      avalue = target->plt_section()->address() + gsym->plt_offset();
 
-      symval.set_output_value(value);
+      symval.set_output_value(avalue);
 
       psymval = &symval;
     }
@@ -2743,7 +2740,7 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
   typedef typename elfcpp::Swap<32, true>::Valtype Insntype;
 
   const elfcpp::Elf_Xword addend = rela.get_r_addend();
-  typename elfcpp::Elf_types<size>::Elf_Addr value = psymval->value(object, 0);
+  typename elfcpp::Elf_types<size>::Elf_Addr avalue = psymval->value(object, 0);
 
   const bool is_final =
     (gsym == NULL
@@ -2763,18 +2760,18 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
          Insntype* wv = reinterpret_cast<Insntype*>(view);
          Insntype val;
 
-         value -= tls_segment->memsz();
+         avalue -= tls_segment->memsz();
 
          switch (r_type)
            {
            case elfcpp::R_SPARC_TLS_GD_HI22:
              // TLS_GD_HI22 --> TLS_LE_HIX22
-             Reloc::hix22(view, value, addend);
+             Reloc::hix22(view, avalue, addend);
              break;
 
            case elfcpp::R_SPARC_TLS_GD_LO10:
              // TLS_GD_LO10 --> TLS_LE_LOX10
-             Reloc::lox10(view, value, addend);
+             Reloc::lox10(view, avalue, addend);
              break;
 
            case elfcpp::R_SPARC_TLS_GD_ADD:
@@ -2798,13 +2795,13 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
           if (gsym != NULL)
             {
               gold_assert(gsym->has_got_offset(got_type));
-              value = gsym->got_offset(got_type);
+              avalue = gsym->got_offset(got_type);
             }
           else
             {
               unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
               gold_assert(object->local_has_got_offset(r_sym, got_type));
-              value = object->local_got_offset(r_sym, got_type);
+              avalue = object->local_got_offset(r_sym, got_type);
             }
           if (optimized_type == tls::TLSOPT_TO_IE)
            {
@@ -2815,12 +2812,12 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
                {
                case elfcpp::R_SPARC_TLS_GD_HI22:
                  // TLS_GD_HI22 --> TLS_IE_HI22
-                 Reloc::hi22(view, value, addend);
+                 Reloc::hi22(view, avalue, addend);
                  break;
 
                case elfcpp::R_SPARC_TLS_GD_LO10:
                  // TLS_GD_LO10 --> TLS_IE_LO10
-                 Reloc::lo10(view, value, addend);
+                 Reloc::lo10(view, avalue, addend);
                  break;
 
                case elfcpp::R_SPARC_TLS_GD_ADD:
@@ -2870,24 +2867,24 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
              switch (r_type)
                {
                case elfcpp::R_SPARC_TLS_GD_HI22:
-                 Reloc::hi22(view, value, addend);
+                 Reloc::hi22(view, avalue, addend);
                  break;
                case elfcpp::R_SPARC_TLS_GD_LO10:
-                 Reloc::lo10(view, value, addend);
+                 Reloc::lo10(view, avalue, addend);
                  break;
                case elfcpp::R_SPARC_TLS_GD_ADD:
                  break;
                case elfcpp::R_SPARC_TLS_GD_CALL:
                  {
                    Symbol_value<size> symval;
-                   elfcpp::Elf_Xword value;
+                   elfcpp::Elf_Xword xvalue;
                    Symbol* tsym;
 
                    tsym = target->tls_get_addr_sym_;
                    gold_assert(tsym);
-                   value = (target->plt_section()->address() +
-                            tsym->plt_offset());
-                   symval.set_output_value(value);
+                   xvalue = (target->plt_section()->address() +
+                             tsym->plt_offset());
+                   symval.set_output_value(xvalue);
                    Reloc::wdisp30(view, object, &symval, addend, address);
                  }
                  break;
@@ -2942,14 +2939,14 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
            case elfcpp::R_SPARC_TLS_LDM_CALL:
              {
                Symbol_value<size> symval;
-               elfcpp::Elf_Xword value;
+               elfcpp::Elf_Xword xvalue;
                Symbol* tsym;
 
                tsym = target->tls_get_addr_sym_;
                gold_assert(tsym);
-               value = (target->plt_section()->address() +
-                        tsym->plt_offset());
-               symval.set_output_value(value);
+               xvalue = (target->plt_section()->address() +
+                         tsym->plt_offset());
+               symval.set_output_value(xvalue);
                Reloc::wdisp30(view, object, &symval, addend, address);
              }
              break;
@@ -2967,20 +2964,20 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
     case elfcpp::R_SPARC_TLS_LDO_HIX22:
       if (optimized_type == tls::TLSOPT_TO_LE)
        {
-         value -= tls_segment->memsz();
-         Reloc::hix22(view, value, addend);
+         avalue -= tls_segment->memsz();
+         Reloc::hix22(view, avalue, addend);
        }
       else
-       Reloc::ldo_hix22(view, value, addend);
+       Reloc::ldo_hix22(view, avalue, addend);
       break;
     case elfcpp::R_SPARC_TLS_LDO_LOX10:
       if (optimized_type == tls::TLSOPT_TO_LE)
        {
-         value -= tls_segment->memsz();
-         Reloc::lox10(view, value, addend);
+         avalue -= tls_segment->memsz();
+         Reloc::lox10(view, avalue, addend);
        }
       else
-       Reloc::ldo_lox10(view, value, addend);
+       Reloc::ldo_lox10(view, avalue, addend);
       break;
     case elfcpp::R_SPARC_TLS_LDO_ADD:
       if (optimized_type == tls::TLSOPT_TO_LE)
@@ -3021,16 +3018,16 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
     case elfcpp::R_SPARC_TLS_IE_LO10:
       if (optimized_type == tls::TLSOPT_TO_LE)
        {
-         value -= tls_segment->memsz();
+         avalue -= tls_segment->memsz();
          switch (r_type)
            {
            case elfcpp::R_SPARC_TLS_IE_HI22:
              // IE_HI22 --> LE_HIX22
-             Reloc::hix22(view, value, addend);
+             Reloc::hix22(view, avalue, addend);
              break;
            case elfcpp::R_SPARC_TLS_IE_LO10:
              // IE_LO10 --> LE_LOX10
-             Reloc::lox10(view, value, addend);
+             Reloc::lox10(view, avalue, addend);
              break;
            }
          break;
@@ -3042,23 +3039,23 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
          if (gsym != NULL)
            {
              gold_assert(gsym->has_got_offset(GOT_TYPE_TLS_OFFSET));
-             value = gsym->got_offset(GOT_TYPE_TLS_OFFSET);
+             avalue = gsym->got_offset(GOT_TYPE_TLS_OFFSET);
            }
          else
            {
              unsigned int r_sym = elfcpp::elf_r_sym<size>(rela.get_r_info());
              gold_assert(object->local_has_got_offset(r_sym,
                                                       GOT_TYPE_TLS_OFFSET));
-             value = object->local_got_offset(r_sym,
-                                              GOT_TYPE_TLS_OFFSET);
+             avalue = object->local_got_offset(r_sym,
+                                               GOT_TYPE_TLS_OFFSET);
            }
          switch (r_type)
            {
            case elfcpp::R_SPARC_TLS_IE_HI22:
-             Reloc::hi22(view, value, addend);
+             Reloc::hi22(view, avalue, addend);
              break;
            case elfcpp::R_SPARC_TLS_IE_LO10:
-             Reloc::lo10(view, value, addend);
+             Reloc::lo10(view, avalue, addend);
              break;
            }
          break;
@@ -3079,8 +3076,8 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
       // have been created for this location, so do not apply it now.
       if (!parameters->options().shared())
        {
-         value -= tls_segment->memsz();
-         Reloc::hix22(view, value, addend);
+         avalue -= tls_segment->memsz();
+         Reloc::hix22(view, avalue, addend);
        }
       break;
 
@@ -3089,8 +3086,8 @@ Target_sparc<size, big_endian>::Relocate::relocate_tls(
       // have been created for this location, so do not apply it now.
       if (!parameters->options().shared())
        {
-         value -= tls_segment->memsz();
-         Reloc::lox10(view, value, addend);
+         avalue -= tls_segment->memsz();
+         Reloc::lox10(view, avalue, addend);
        }
       break;
     }
@@ -3109,7 +3106,8 @@ Target_sparc<size, big_endian>::relocate_section(
                        bool needs_special_offset_handling,
                        unsigned char* view,
                        typename elfcpp::Elf_types<size>::Elf_Addr address,
-                       section_size_type view_size)
+                       section_size_type view_size,
+                       const Reloc_symbol_changes* reloc_symbol_changes)
 {
   typedef Target_sparc<size, big_endian> Sparc;
   typedef typename Target_sparc<size, big_endian>::Relocate Sparc_relocate;
@@ -3126,7 +3124,8 @@ Target_sparc<size, big_endian>::relocate_section(
     needs_special_offset_handling,
     view,
     address,
-    view_size);
+    view_size,
+    reloc_symbol_changes);
 }
 
 // Return the size of a relocation while scanning during a relocatable
@@ -3148,7 +3147,6 @@ Target_sparc<size, big_endian>::Relocatable_size_for_reloc::get_size_for_reloc(
 template<int size, bool big_endian>
 void
 Target_sparc<size, big_endian>::scan_relocatable_relocs(
-                       const General_options& options,
                        Symbol_table* symtab,
                        Layout* layout,
                        Sized_relobj<size, big_endian>* object,
@@ -3169,7 +3167,6 @@ Target_sparc<size, big_endian>::scan_relocatable_relocs(
 
   gold::scan_relocatable_relocs<size, big_endian, elfcpp::SHT_RELA,
       Scan_relocatable_relocs>(
-    options,
     symtab,
     layout,
     object,
@@ -3241,18 +3238,18 @@ public:
                      (size == 64 ? "elf64-sparc" : "elf32-sparc"))
   { }
 
-  Target* do_recognize(int machine, int, int)
+  Target* do_recognize(int amachine, int, int)
   {
     switch (size)
       {
       case 64:
-       if (machine != elfcpp::EM_SPARCV9)
+       if (amachine != elfcpp::EM_SPARCV9)
          return NULL;
        break;
 
       case 32:
-       if (machine != elfcpp::EM_SPARC
-           && machine != elfcpp::EM_SPARC32PLUS)
+       if (amachine != elfcpp::EM_SPARC
+           && amachine != elfcpp::EM_SPARC32PLUS)
          return NULL;
        break;
 
This page took 0.035054 seconds and 4 git commands to generate.