aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2020-11-03 20:51:13 +1030
committerAlan Modra <amodra@gmail.com>2020-11-04 00:48:51 +1030
commitb0d0d02bde06c61969160c0c5a3d7f48daa8b24a (patch)
tree72303c490983c889132a693082ed663d577d2de7 /gold
parent3a959875ea0a017ef378fa084c6cbddee01db9d8 (diff)
downloadgdb-b0d0d02bde06c61969160c0c5a3d7f48daa8b24a.zip
gdb-b0d0d02bde06c61969160c0c5a3d7f48daa8b24a.tar.gz
gdb-b0d0d02bde06c61969160c0c5a3d7f48daa8b24a.tar.bz2
PowerPC problem building gold with clang
* powerpc.cc (Target_powerpc::tocsave_loc): Return a pointer. (Target_powerpc::Relocate::relocate): Avoid -Wdangling-gsl error.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog5
-rw-r--r--gold/powerpc.cc8
2 files changed, 9 insertions, 4 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 48e315a..73a7419 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@
+2020-11-03 Alan Modra <amodra@gmail.com>
+
+ * powerpc.cc (Target_powerpc::tocsave_loc): Return a pointer.
+ (Target_powerpc::Relocate::relocate): Avoid -Wdangling-gsl error.
+
2020-11-03 Nick Gasson <nick.gasson@arm.com>
PR 26827
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 476fb4e..b0d6a74 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -757,10 +757,10 @@ class Target_powerpc : public Sized_target<size, big_endian>
}
// 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<size, big_endian>::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.