Constify value_cstring
[deliverable/binutils-gdb.git] / gold / target-reloc.h
index e44519b23ce20e1c71854aa17c85add5111736e4..89906af2b4a5298b04442f138de001ef47893e42 100644 (file)
@@ -1,6 +1,6 @@
 // target-reloc.h -- target specific relocation support  -*- C++ -*-
 
-// Copyright (C) 2006-2014 Free Software Foundation, Inc.
+// Copyright (C) 2006-2015 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.
 
 // This file is part of gold.
@@ -666,6 +666,7 @@ relocate_relocs(
 
       // Get the new symbol index.
 
+      Output_section* os = NULL;
       unsigned int new_symndx;
       if (r_sym < local_count)
        {
@@ -698,7 +699,7 @@ relocate_relocs(
                unsigned int shndx =
                  object->local_symbol_input_shndx(r_sym, &is_ordinary);
                gold_assert(is_ordinary);
-               Output_section* os = object->output_section(shndx);
+               os = object->output_section(shndx);
                gold_assert(os != NULL);
                gold_assert(os->needs_symtab_index());
                new_symndx = os->symtab_index();
@@ -780,7 +781,8 @@ relocate_relocs(
                typename elfcpp::Elf_types<size>::Elf_Swxword addend;
                addend = Reloc_types<sh_type, size, big_endian>::
                           get_reloc_addend(&reloc);
-               addend = psymval->value(object, addend);
+               gold_assert(os != NULL);
+               addend = psymval->value(object, addend) - os->address();
                Reloc_types<sh_type, size, big_endian>::
                  set_reloc_addend(&reloc_write, addend);
              }
This page took 0.025144 seconds and 4 git commands to generate.