diff options
author | Ian Lance Taylor <ian@airs.com> | 2008-05-29 23:51:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2008-05-29 23:51:30 +0000 |
commit | e09ad04ada67c0aa5c6c0f233aeede49c1ed484f (patch) | |
tree | 1075a2a3c74eec5f0bde6714bf2856c73470ec96 /gold/target-reloc.h | |
parent | b15591bb36cc0a263f3fa2e8cdd20021fd4a26fc (diff) | |
download | gdb-e09ad04ada67c0aa5c6c0f233aeede49c1ed484f.zip gdb-e09ad04ada67c0aa5c6c0f233aeede49c1ed484f.tar.gz gdb-e09ad04ada67c0aa5c6c0f233aeede49c1ed484f.tar.bz2 |
PR 6407
* target-reloc.h (relocate_for_relocatable): Fix new_offset
calculation.
Diffstat (limited to 'gold/target-reloc.h')
-rw-r--r-- | gold/target-reloc.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gold/target-reloc.h b/gold/target-reloc.h index d06dc82..15d59bb 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)); |