summaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-05-29 23:51:30 +0000
committerIan Lance Taylor <ian@airs.com>2008-05-29 23:51:30 +0000
commite63fa4c49ea98d36aa30ae6ae46d69519bc0e46e (patch)
treed8c130599aa35802863a047320d9a73cbaea4755 /gold
parent108a2d06ef3c563bf4cf42e35d05ac2225f52414 (diff)
downloadbinutils-redhat-e63fa4c49ea98d36aa30ae6ae46d69519bc0e46e.tar.gz
PR 6407
* target-reloc.h (relocate_for_relocatable): Fix new_offset calculation.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/target-reloc.h6
2 files changed, 11 insertions, 1 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index a20de3a116..0fb667d1e4 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
+
+ PR 6407
+ * target-reloc.h (relocate_for_relocatable): Fix new_offset
+ calculation.
+
2008-05-28 Caleb Howe <cshowe@google.com>
* reduced_debug_output.cc: New file.
diff --git a/gold/target-reloc.h b/gold/target-reloc.h
index d06dc82023..15d59bb901 100644
--- a/gold/target-reloc.h
+++ b/gold/target-reloc.h
@@ -542,7 +542,11 @@ relocate_for_relocatable(
// In an executable or dynamic object, generated by
// --emit-relocs, r_offset is an absolute address.
if (!parameters->options().relocatable())
- new_offset += view_address;
+ {
+ new_offset += view_address;
+ if (offset_in_output_section != -1)
+ new_offset -= offset_in_output_section;
+ }
reloc_write.put_r_offset(new_offset);
reloc_write.put_r_info(elfcpp::elf_r_info<size>(new_symndx, r_type));