diff options
author | Ian Lance Taylor <iant@google.com> | 2006-11-07 18:51:39 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2006-11-07 18:51:39 +0000 |
commit | 645f81233bd13bc6102580bac4b886c6056028e3 (patch) | |
tree | e104ddfc8f2a1f52326b8a2fa9c3b5c50ae43fa0 /gold/reloc.cc | |
parent | 9e59254c41b56b91b7640ed5b727430cc537daac (diff) | |
download | gdb-645f81233bd13bc6102580bac4b886c6056028e3.zip gdb-645f81233bd13bc6102580bac4b886c6056028e3.tar.gz gdb-645f81233bd13bc6102580bac4b886c6056028e3.tar.bz2 |
Add Elf_file interface which can be used by both Sized_relobj and
Sized_dynobj.
Diffstat (limited to 'gold/reloc.cc')
-rw-r--r-- | gold/reloc.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gold/reloc.cc b/gold/reloc.cc index 7233266..bc38904 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -150,7 +150,7 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd) rd->relocs.reserve(shnum / 2); - const unsigned char *pshdrs = this->get_view(this->shoff_, + const unsigned char *pshdrs = this->get_view(this->elf_file_.shoff(), shnum * This::shdr_size); // Skip the first, dummy, section. const unsigned char *ps = pshdrs + This::shdr_size; @@ -181,7 +181,7 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd) if ((secshdr.get_sh_flags() & elfcpp::SHF_ALLOC) == 0) continue; - if (shdr.get_sh_link() != this->symtab_shnum_) + if (shdr.get_sh_link() != this->symtab_shndx_) { fprintf(stderr, _("%s: %s: relocation section %u uses unexpected " @@ -227,12 +227,12 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd) } // Read the local symbols. - if (this->symtab_shnum_ == 0 || this->local_symbol_count_ == 0) + if (this->symtab_shndx_ == 0 || this->local_symbol_count_ == 0) rd->local_symbols = NULL; else { typename This::Shdr symtabshdr(pshdrs - + this->symtab_shnum_ * This::shdr_size); + + this->symtab_shndx_ * This::shdr_size); assert(symtabshdr.get_sh_type() == elfcpp::SHT_SYMTAB); const int sym_size = This::sym_size; const unsigned int loccount = this->local_symbol_count_; @@ -293,7 +293,7 @@ Sized_relobj<size, big_endian>::do_relocate(const General_options& options, unsigned int shnum = this->shnum(); // Read the section headers. - const unsigned char* pshdrs = this->get_view(this->shoff_, + const unsigned char* pshdrs = this->get_view(this->elf_file_.shoff(), shnum * This::shdr_size); Views views; @@ -419,7 +419,7 @@ Sized_relobj<size, big_endian>::relocate_sections( assert((*pviews)[index].view != NULL); - if (shdr.get_sh_link() != this->symtab_shnum_) + if (shdr.get_sh_link() != this->symtab_shndx_) { fprintf(stderr, _("%s: %s: relocation section %u uses unexpected " |