From: Alan Modra Date: Tue, 3 Nov 2020 10:21:13 +0000 (+1030) Subject: PowerPC problem building gold with clang X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b0d0d02bde06c61969160c0c5a3d7f48daa8b24a;p=binutils-gdb.git PowerPC problem building gold with clang * powerpc.cc (Target_powerpc::tocsave_loc): Return a pointer. (Target_powerpc::Relocate::relocate): Avoid -Wdangling-gsl error. --- diff --git a/gold/ChangeLog b/gold/ChangeLog index 48e315affeb..73a74190511 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2020-11-03 Alan Modra + + * powerpc.cc (Target_powerpc::tocsave_loc): Return a pointer. + (Target_powerpc::Relocate::relocate): Avoid -Wdangling-gsl error. + 2020-11-03 Nick Gasson PR 26827 diff --git a/gold/powerpc.cc b/gold/powerpc.cc index 476fb4e588d..b0d6a74bec5 100644 --- a/gold/powerpc.cc +++ b/gold/powerpc.cc @@ -757,10 +757,10 @@ class Target_powerpc : public Sized_target } // Accessor - const Tocsave_loc + const Tocsave_loc* tocsave_loc() const { - return this->tocsave_loc_; + return &this->tocsave_loc_; } void @@ -11946,8 +11946,8 @@ Target_powerpc::Relocate::relocate( loc.object = relinfo->object; loc.shndx = relinfo->data_shndx; loc.offset = rela.get_r_offset(); - Tocsave_loc::const_iterator p = target->tocsave_loc().find(loc); - if (p != target->tocsave_loc().end()) + const Tocsave_loc *tocsave = target->tocsave_loc(); + if (tocsave->find(loc) != tocsave->end()) { // If we've generated plt calls using this tocsave, then // the nop needs to be changed to save r2.