aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-08-18 12:43:46 +0930
committerAndreas K. Hüttel <dilfridge@gentoo.org>2021-09-25 21:13:05 +0200
commit49904ac3a95f69303a491789984a0674289c6749 (patch)
treecc6e9c541e16a6176b8047f527a97b037c2f8e0f
parentRevert "Gentoo: ld: enable new dtags by default for linux/gnu targets" (diff)
downloadbinutils-gdb-49904ac3a95f69303a491789984a0674289c6749.tar.gz
binutils-gdb-49904ac3a95f69303a491789984a0674289c6749.tar.bz2
binutils-gdb-49904ac3a95f69303a491789984a0674289c6749.zip
[GOLD] PowerPC64 relocation overflow for -Os register save/restore funcs
Fixes a silly mistake in calculating the address of -Os out-of-line register save/restore function copies. Copies of these linker defined functions are added to stub sections when the original (in target->savres_section) can't be reached. * powerpc.cc (Target_powerpc::Relocate::relocate): Correct address calculation of out-of-line save/restore function copies. (cherry picked from commit 89c905a342d2cb35ebc4d66ad7cdca581b5134c3) (cherry picked from commit 1e9d14eb5814e86fbe146e7632d1b818ab087e2e)
-rw-r--r--gold/powerpc.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gold/powerpc.cc b/gold/powerpc.cc
index 6b12ed8869b..11b98695e64 100644
--- a/gold/powerpc.cc
+++ b/gold/powerpc.cc
@@ -11201,6 +11201,8 @@ Target_powerpc<size, big_endian>::Relocate::relocate(
{
if (ent->save_res_)
value = (value - target->savres_section()->address()
+ + stub_table->stub_address()
+ + stub_table->plt_size()
+ stub_table->branch_size());
else
{