]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix segfault in relocate_erratum_stub on aarch64.
authorPeter Smith <peter.smith@linaro.org>
Thu, 30 Nov 2017 21:30:58 +0000 (13:30 -0800)
committerCary Coutant <ccoutant@gmail.com>
Thu, 30 Nov 2017 23:16:03 +0000 (15:16 -0800)
The fix for PR21868 (an internal error when --fix-cortex-a53-843419
is applied) has a small mistake in it. When the stub_owner section
needs an erratum fix an incorrect address for the stubs for the section
is given to relocate_erratum_stub. If we are lucky we will get a segfault;
if we aren't, an incorrect patch or data corruption is possible.
The error is visible in PR21868, but the side-effects aren't fatal.

gold/
PR gold/22233
* aarch64.cc (AArch64_relobj::fix_errata_and_relocate_erratum_stubs):
Fix calculation of stub address.

gold/ChangeLog
gold/aarch64.cc

index f4210664b12a3c4f9b3bb9e539216fd832be241b..b02dcba5b5a549751df0667ca23ab88946483759 100644 (file)
@@ -1,3 +1,9 @@
+2017-11-30  Peter Smith  <peter.smith@linaro.org>
+
+       PR gold/22233
+       * aarch64.cc (AArch64_relobj::fix_errata_and_relocate_erratum_stubs):
+       Fix calculation of stub address.
+
 2017-11-21  Ian Lance Taylor  <iant@google.com>
 
        Apply from master:
index b4287a6f25b4a26a66a9f024cdc728c31bc1a719..d0839ce0af55419d3e4d86cbf8c23c1840a59c12 100644 (file)
@@ -2041,7 +2041,7 @@ AArch64_relobj<size, big_endian>::fix_errata_and_relocate_erratum_stubs(
           // executed.
           stub_table->relocate_erratum_stub(
            stub,
-           pview.view + view_offset + (stub_table->address() - pview.address));
+           pview.view + (stub_table->address() - pview.address));
 
           // Next erratum stub.
          ++p;