// reloc.cc -- relocate input files for gold.
-// Copyright (C) 2006-2020 Free Software Foundation, Inc.
+// Copyright (C) 2006-2022 Free Software Foundation, Inc.
// Written by Ian Lance Taylor <iant@google.com>.
// This file is part of gold.
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;