X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=gold%2Freloc.cc;h=9cab05264171d23c2a155ca4a867546b23875a02;hb=5a3ca6e319583a49310067a4b47d7b0dd080c2cd;hp=7cd9f859e0d9973ac46b0fd383c61817cb44cd71;hpb=b3adc24a0713411ab38a21dc894dd40dbc5c8f4f;p=binutils-gdb.git diff --git a/gold/reloc.cc b/gold/reloc.cc index 7cd9f859e0d..9cab0526417 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -1,6 +1,6 @@ // 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 . // This file is part of gold. @@ -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;