diff options
author | Ian Lance Taylor <ian@airs.com> | 2009-06-24 14:36:14 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2009-06-24 14:36:14 +0000 |
commit | 1307d6cd4a961a2cd31a1ff63d8cd8dcf27b470a (patch) | |
tree | a93b095bb03e522a0bb5c345e6dea0e727998f35 /gold/reloc.cc | |
parent | cf13d6995d27492605b42fb8d6bb22659cb35a0b (diff) | |
download | gdb-1307d6cd4a961a2cd31a1ff63d8cd8dcf27b470a.zip gdb-1307d6cd4a961a2cd31a1ff63d8cd8dcf27b470a.tar.gz gdb-1307d6cd4a961a2cd31a1ff63d8cd8dcf27b470a.tar.bz2 |
PR 10244
* reloc.cc (relocate_sections): Skip empty relocation sections.
Diffstat (limited to 'gold/reloc.cc')
-rw-r--r-- | gold/reloc.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gold/reloc.cc b/gold/reloc.cc index b6394a5..1985867 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -822,6 +822,10 @@ Sized_relobj<size, big_endian>::relocate_sections( if (sh_type != elfcpp::SHT_REL && sh_type != elfcpp::SHT_RELA) continue; + off_t sh_size = shdr.get_sh_size(); + if (sh_size == 0) + continue; + unsigned int index = this->adjust_shndx(shdr.get_sh_info()); if (index >= this->shnum()) { @@ -851,7 +855,6 @@ Sized_relobj<size, big_endian>::relocate_sections( continue; } - off_t sh_size = shdr.get_sh_size(); const unsigned char* prelocs = this->get_view(shdr.get_sh_offset(), sh_size, true, false); |