From: Michael Krasnyk Date: Sat, 17 Jul 2021 15:35:56 +0000 (+0200) Subject: PR28098 Skip R_*_NONE relocation entries with zero r_sym without counting X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7c6ff8af98718116c835f46a55b480b9684ea4ef;p=binutils-gdb.git PR28098 Skip R_*_NONE relocation entries with zero r_sym without counting PR gold/28098 * reloc.cc (Track_relocs::advance): Skip R_*_NONE relocation entries with r_sym of zero without counting in advance method. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index d37902b8d24..6aba1e0e3ec 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2021-07-17 Michael Krasnyk + + PR gold/28098 + * reloc.cc (Track_relocs::advance): Skip R_*_NONE relocation entries + with r_sym of zero without counting in advance method. + 2021-07-03 Nick Clifton * po/gold.pot: Regenerate. diff --git a/gold/reloc.cc b/gold/reloc.cc index 34a836f4e6f..82ec6cbcc05 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -1602,7 +1602,10 @@ Track_relocs::advance(off_t offset) elfcpp::Rel rel(this->prelocs_ + this->pos_); if (static_cast(rel.get_r_offset()) >= offset) break; - ++ret; + // Skip R_*_NONE relocation entries with r_sym of zero + // without counting. + if (rel.get_r_info() != 0) + ++ret; this->pos_ += this->reloc_size_; } return ret; diff --git a/gold/reloc.h b/gold/reloc.h index 5f1d382a707..773e79bdb7b 100644 --- a/gold/reloc.h +++ b/gold/reloc.h @@ -1171,7 +1171,7 @@ class Track_relocs next_addend() const; // Advance to OFFSET within the data section, and return the number - // of relocs which would be skipped. + // of relocs which would be skipped, excluding r_info==0 relocs. int advance(off_t offset);