diff options
author | Michael Krasnyk <mkrasnyk@argo.ai> | 2021-07-17 17:35:56 +0200 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-07-18 22:04:36 +0930 |
commit | 7c6ff8af98718116c835f46a55b480b9684ea4ef (patch) | |
tree | 21028741672beec5c91424ed4aba6ceebd5c03dc /gold | |
parent | 85460c161d9b25b96320e6e234e1e83c01a51f09 (diff) | |
download | gdb-7c6ff8af98718116c835f46a55b480b9684ea4ef.zip gdb-7c6ff8af98718116c835f46a55b480b9684ea4ef.tar.gz gdb-7c6ff8af98718116c835f46a55b480b9684ea4ef.tar.bz2 |
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.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 6 | ||||
-rw-r--r-- | gold/reloc.cc | 5 | ||||
-rw-r--r-- | gold/reloc.h | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index d37902b..6aba1e0 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,9 @@ +2021-07-17 Michael Krasnyk <michael.krasnyk@gmail.com> + + 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 <nickc@redhat.com> * po/gold.pot: Regenerate. diff --git a/gold/reloc.cc b/gold/reloc.cc index 34a836f..82ec6cb 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -1602,7 +1602,10 @@ Track_relocs<size, big_endian>::advance(off_t offset) elfcpp::Rel<size, big_endian> rel(this->prelocs_ + this->pos_); if (static_cast<off_t>(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 5f1d382..773e79b 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); |