diff options
author | Jeff Law <law@redhat.com> | 1994-04-10 08:12:33 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1994-04-10 08:12:33 +0000 |
commit | 9a5334e5905194876a799a2af08d7a0d9c885a0c (patch) | |
tree | b58f3ccb7f886a393992f14ad9db616def3d4cac /bfd | |
parent | 35be712d11ae403253c8ae60d7d230a8e9c33b68 (diff) | |
download | gdb-9a5334e5905194876a799a2af08d7a0d9c885a0c.zip gdb-9a5334e5905194876a799a2af08d7a0d9c885a0c.tar.gz gdb-9a5334e5905194876a799a2af08d7a0d9c885a0c.tar.bz2 |
* elfcode.h (write_relocs): For rela relocations, adjust the
addend for relocations involving section symbols to account
for the lossage of 1:1 mapping from input section symbols to
output section symbols.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elfcode.h | 11 |
2 files changed, 18 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8c19a10..29dcd29 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +Sun Apr 10 01:02:24 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * elfcode.h (write_relocs): For rela relocations, adjust the + addend for relocations involving section symbols to account + for the lossage of 1:1 mapping from input section symbols to + output section symbols. + Fri Apr 8 12:22:02 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * aoutx.h (NAME(aout,make_sections)): New function. diff --git a/bfd/elfcode.h b/bfd/elfcode.h index 5fd4299..50878fc 100644 --- a/bfd/elfcode.h +++ b/bfd/elfcode.h @@ -1171,6 +1171,17 @@ write_relocs (abfd, sec, xxx) dst_rela.r_offset = ptr->address; sym = *ptr->sym_ptr_ptr; + + /* If SYM is a section symbol for an input section, which + has been combined with other similar input sections (ld -r), + then adjust the addend by the output_offset of sym->section. + + Apparently elf_symbol_from_bfd_symbol doesn't provide a 1:1 + mapping from bfd symbol to elf symbols in this case. */ + if ((sym->flags & BSF_SECTION_SYM) + && sym->section) + ptr->addend += sym->section->output_offset; + if (sym == last_sym) n = last_sym_idx; else |