]> Git Repo - binutils.git/blobdiff - gold/target-reloc.h
Update copyright years. Update language files.
[binutils.git] / gold / target-reloc.h
index 09f5076d8572d1d8156f77ba0cfac9bc1e3f3bce..c5bb4f1dc7853443188dfec3e57bec3c927c01f5 100644 (file)
@@ -1,6 +1,6 @@
 // target-reloc.h -- target specific relocation support  -*- C++ -*-
 
-// Copyright 2006, 2007 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <[email protected]>.
 
 // This file is part of gold.
@@ -375,7 +375,7 @@ relocate_for_relocatable(
     off_t offset_in_output_section,
     const Relocatable_relocs* rr,
     unsigned char* view,
-    typename elfcpp::Elf_types<size>::Elf_Addr,
+    typename elfcpp::Elf_types<size>::Elf_Addr view_address,
     section_size_type,
     unsigned char* reloc_view,
     section_size_type reloc_view_size)
@@ -466,6 +466,12 @@ relocate_for_relocatable(
          gold_assert(new_offset != -1);
        }
 
+      // In an object file, r_offset is an offset within the section.
+      // In an executable or dynamic object, generated by
+      // --emit-relocs, r_offset is an absolute address.
+      if (!parameters->options().relocatable())
+       new_offset += view_address;
+
       reloc_write.put_r_offset(new_offset);
       reloc_write.put_r_info(elfcpp::elf_r_info<size>(new_symndx, r_type));
 
This page took 0.025106 seconds and 4 git commands to generate.