diff options
author | Ian Lance Taylor <iant@google.com> | 2006-11-30 23:52:50 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2006-11-30 23:52:50 +0000 |
commit | 5a6f7e2db556f93765b75baf2d1ee1509225410d (patch) | |
tree | 6db53a1cd843958dc18135430dbf37bd7b92b17e /gold/output.cc | |
parent | 2621033b5dbe773f00cb90d24604b70a1cead2f1 (diff) | |
download | gdb-5a6f7e2db556f93765b75baf2d1ee1509225410d.zip gdb-5a6f7e2db556f93765b75baf2d1ee1509225410d.tar.gz gdb-5a6f7e2db556f93765b75baf2d1ee1509225410d.tar.bz2 |
Added a testsuite. More support for COPY relocations.
Diffstat (limited to 'gold/output.cc')
-rw-r--r-- | gold/output.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gold/output.cc b/gold/output.cc index e4720df..2dbf576 100644 --- a/gold/output.cc +++ b/gold/output.cc @@ -415,19 +415,19 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::get_symbol_index() gold_unreachable(); case GSYM_CODE: - if (this->u_.gsym == NULL) + if (this->u1_.gsym == NULL) index = 0; else if (dynamic) - index = this->u_.gsym->dynsym_index(); + index = this->u1_.gsym->dynsym_index(); else - index = this->u_.gsym->symtab_index(); + index = this->u1_.gsym->symtab_index(); break; case SECTION_CODE: if (dynamic) - index = this->u_.os->dynsym_index(); + index = this->u1_.os->dynsym_index(); else - index = this->u_.os->symtab_index(); + index = this->u1_.os->symtab_index(); break; default: @@ -439,7 +439,7 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::get_symbol_index() gold_unreachable(); } else - index = this->u_.object->symtab_index(this->local_sym_index_); + index = this->u1_.relobj->symtab_index(this->local_sym_index_); break; } gold_assert(index != -1U); @@ -456,8 +456,16 @@ Output_reloc<elfcpp::SHT_REL, dynamic, size, big_endian>::write_rel( Write_rel* wr) const { Address address = this->address_; - if (this->od_ != NULL) - address += this->od_->address(); + if (this->shndx_ != INVALID_CODE) + { + off_t off; + Output_section* os = this->u2_.relobj->output_section(this->shndx_, + &off); + gold_assert(os != NULL); + address += os->address() + off; + } + else if (this->u2_.od != NULL) + address += this->u2_.od->address(); wr->put_r_offset(address); wr->put_r_info(elfcpp::elf_r_info<size>(this->get_symbol_index(), this->type_)); |