Skip to content

Commit 7c6ff8a

Browse files
mkrasnykamodra
authored andcommitted
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.
1 parent 85460c1 commit 7c6ff8a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

gold/ChangeLog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2021-07-17 Michael Krasnyk <michael.krasnyk@gmail.com>
2+
3+
PR gold/28098
4+
* reloc.cc (Track_relocs::advance): Skip R_*_NONE relocation entries
5+
with r_sym of zero without counting in advance method.
6+
17
2021-07-03 Nick Clifton <nickc@redhat.com>
28

39
* po/gold.pot: Regenerate.

gold/reloc.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,10 @@ Track_relocs<size, big_endian>::advance(off_t offset)
16021602
elfcpp::Rel<size, big_endian> rel(this->prelocs_ + this->pos_);
16031603
if (static_cast<off_t>(rel.get_r_offset()) >= offset)
16041604
break;
1605-
++ret;
1605+
// Skip R_*_NONE relocation entries with r_sym of zero
1606+
// without counting.
1607+
if (rel.get_r_info() != 0)
1608+
++ret;
16061609
this->pos_ += this->reloc_size_;
16071610
}
16081611
return ret;

gold/reloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ class Track_relocs
11711171
next_addend() const;
11721172

11731173
// Advance to OFFSET within the data section, and return the number
1174-
// of relocs which would be skipped.
1174+
// of relocs which would be skipped, excluding r_info==0 relocs.
11751175
int
11761176
advance(off_t offset);
11771177

0 commit comments

Comments
 (0)