]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[GOLD] PowerPC64 relocation overflow for -Os register save/restore funcs
authorAlan Modra <amodra@gmail.com>
Wed, 18 Aug 2021 03:13:46 +0000 (12:43 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 19 Aug 2021 01:22:15 +0000 (10:52 +0930)
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)

gold/powerpc.cc

index ec6f950eb21bfeea742d4cb929bdff2689e5b5e4..fbda058898ab097920877028c7fb6baf256104a4 100644 (file)
@@ -11086,6 +11086,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
                    {